logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: servlet response = xml document: msg#00002

Subject: Re: servlet response = xml document
Thanks Natalia

Your code was helpful. Now it works.

And your advice... too. I did not know how to take a look at classes from Xindice folders clearly. Although it has not helped me either much in my application, now I know how to use it better a little.

Regards,
Iñaki

2007/2/16, Natalia Shilenkova <nshilenkova@xxxxxxxxx>:
Hi Iñaki,

On 2/15/07, Iñaki Salinas Bueno <inksalinas@xxxxxxxxx> wrote:
> Hello,
>
>  I'm working with XForms and Xindice through a servlet. I want the servlet
> response my XForms application with a XML document (content-type:
> application/xml).

The code for getting a document from a collection may look like this:
    Resource res = col.getResource(docName);
    if (res != null) {
        response.setContentType("application/xml");
        String doc = (String) res.getContent();
        response.getOutputStream().print(doc);
    } else {
            // document not found
    }

where col is the collection you are trying to access and docName is a
document key.

Also, it might help to take a look at
org/apache/xindice/tools/XMLTools.java class from Xindice source code.
This class allows you to execute different commands on Xindice
database, such as adding, retrieving, deleting documents and so on.
Every supported command is implemented as a separate java class, and
all of those classes can be found under
org/apache/xindice/tools/commands.

Regards,
Natalia


Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>