wood burning stoves 2.0*
The moose likes Servlets and the fly likes Beginning JSP and XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Beginning JSP and XML" Watch "Beginning JSP and XML" New topic
Author

Beginning JSP and XML

vasudevan gopalan
Greenhorn

Joined: Jul 09, 2000
Posts: 7
hi,
I am using JRUN server for processing JSP.I want to know
how to use JSP and XML in JRUN server with a small e.g since i dont know XML.
Bye,
Vasu

Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

yesterday someone posted that this is a good article
on the subject.
you see how it helps sneeking in other peoples' posts.
you could also use the search facility. HTH.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Bart Tubalinal
Greenhorn

Joined: Jul 18, 2001
Posts: 7
It is pretty easy to make JSP and XML work together. All you need to do is include at the top of the jsp page this line:
<% response.setContentType("text/xml"); %>
From that point forward, everything will be "considered" xml. You can use any jsp code inside of this xml document.
Example:

The only thing that you need to make sure of is that the document follows xml rules (well-formed and valid, if a dtd/schema is specified).
Note: This is not specifically for JRun, this should work using any JSP container.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Beginning JSP and XML
 
Similar Threads
strange output !! include / jsp:include
How to configure JRun Server?
JRun
JRUN App server/Web server
App Server /Web Server