Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

JSP with XML

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I'm quite new to JSP with XMl tech..
Can anybody help me out in solving this problem.

1a)How to create a JSP file which will generate an XML file containing all the records from the table(Use JDBC code within the JSP page instead of JavaBeans).
And also ....
b)Then the JSP file will use an XSL file that you have created to format the XML data into HTML code and send it back to the browser.

Shiva.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it is a good idea to try to do so much processing inside a JSP page - a JavaBean that creates a String containing the XML would work since you can feed the String to an XSL process. Why don't you want to do it that way?
Bill
------------------
author of:
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the contentType as <%@ page contentType="text/xml" %> which will generate the output as xml.
A sample example below.
<portal address="<%= request.getLocalAddr() %>" port="<%= request.getLocalPort() %>">
<serverinfo>
<hostname><%= request.getLocalName() %></hostname>
<address><%= request.getLocalAddr() %></address>
<port><%= request.getLocalPort() %></port>
<sessionid><%= request.getSession().getId() %></sessionid>
</serverinfo>
</portal>

 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!