Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

getting xml data from jsp to servlet

  Asked By: Madeleine    Date: Oct 07    Category: Java    Views: 2679
  

I am working on a project with another company... they have set up a
jsp so that I can retrieve data from their database... the problem is
the jsp outputs xml... I need a way to get that xml into either my
jsp or a bean... I don't know how to do this, or even if it can be
done... I've looked at the requestdispatcher include method... it
sounds right... but then I don't know how to access the information
from the other page... any input on this is greatly appreciatated...

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Guadalupe Rogers     Answered On: Oct 07

To start working  with xml  most important thing to do
is to disregard all the hypes around it. XML is more
or less some delimited ASCII text data  that follows
w3c standard.

Now what you can do with ASCII text with known
delimiter can be done with XML data as well. Good
thing about xml is that there are some tools and
technologies available for you to use freely.

If your xml is complicated use apache xslt processor
(www.apache.org) to access  data from xml using xsl
program. Otherwise you may like to use some xml
parser(comes with j2sdk) to get a DOM structure and
find the data from the dom tree node. You will come to
know about more tools and technologies such as SAX,
XSL:FO etc.

If you send me your xml structure and tell me what you
want to do with them, I will be able to help you
further.

 
Answer #2    Answered By: Gustavo Taylor     Answered On: Oct 07

To start working  with xml  most important thing to do
is to disregard all the hypes around it. XML is more
or less some delimited ASCII text data  that follows
w3c standard.

Now what you can do with ASCII text with known
delimiter can be done with XML data as well. Good
thing about xml is that there are some tools and
technologies available for you to use freely.

If your xml is complicated use apache xslt processor
(www.apache.org) to access  data from xml using xsl
program. Otherwise you may like to use some xml
parser(comes with j2sdk) to get a DOM structure and
find the data from the dom tree node. You will come to
know about more tools and technologies such as SAX,
XSL:FO etc.

If you send me your xml structure and tell me what you
want to do with them, I will be able to help you
further.

 
Answer #3    Answered By: Velma Adams     Answered On: Oct 07

sun.jdbc.rowset.WebRowSet(download the JDBC2.0 optional package from
http://java.sun.com/products/jdbc/)
may help you.
It is an extension of CachedRowSet that
can read and write a rowset in XML format.

Castor (http://castor.exolab.org/) may also be great for you.

 
Answer #4    Answered By: Wilbur Hall     Answered On: Oct 07

The standard solution for your problem  is
webservices,but if you need a simple solution that
needs less trainig than using web services that is
below:

you should do a HTTP request through java network API
in your servlet  and then get the content and pars it
through JAXP parsers which is included in J2EE.

please mention that using requestdispatcher just
forward the request and response objects to another
jsp and you can't access  the content (XML in your
case)
in your sevlet and the content will be sent to
browser.

I saw that their are 3 emails up to now that tried to
answer your question I think that all of them help you
to understand my solution.

 
Didn't find what you were looking for? Find more on getting xml data from jsp to servlet Or get search suggestion and latest updates.




Tagged: