aspose file tools*
The moose likes JSP and the fly likes JSP with XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP with XML" Watch "JSP with XML" New topic
Author

JSP with XML

James Sivakumar
Greenhorn

Joined: Nov 16, 2000
Posts: 21
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.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
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:
dileep keely
Ranch Hand

Joined: Jun 28, 2010
Posts: 98
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>

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP with XML