• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp, xml,Servlets

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm generating xml inside my jsp page, now i want to send that xml to servlets using that same jsp page.. Can i do that, if i can how. can some one show me example how to do it..
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That sounds turned around. Why not have a servlet request the XML by opening a URL to the JSP?
Or do you mean that your JSP generates XML in addition to writing a HTML page?
Bill
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
1.One way of achieving this is in JSP u save the XML file to some path and in the servlet read the XML file from that path.
2.Else use this approach
In JSP
StringBuffer buff = new StringBuffer();
buff.append("<XML version=1.0>");
buff.append("<NAME>aaa</NAME>");
buff.append("</XML>");
<input type="hidden" name="xml" value = "<%=buff.toString()%>">
Post the JSP request to a servlet
In the servlet
String s = request.getParamter("xml");
Then use it..
Cheers
Geeta
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there,
Geeta's technique is a good one, it's what would do too.
Tom
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic