You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Andy Nuss <an...@siebel.com> on 2000/03/10 20:00:30 UTC

is there a "best" way to combine JSP and XML?

Hi,

What I would do is create a simple servlet that parses XML docs
and converts them to HTML depending on nature of the XML doc,
and then specify the xml document in the query string.  Then,
from the JSP page, I would either use an include directive or a simple
HREF link as appropriate.

<A HREF="/servlet/MyXMLServlet?myparam=folder1/MyDoc.xml">mylink</A>

or

<jsp:include page="/servlet/MyXMLServlet?myparam=folder1/MyDoc.xml"/>


Are there better, or more correct ways to do this kind of thing, built into
Tomcat?

Thanks,
Andy


Re: is there a "best" way to combine JSP and XML?

Posted by cm...@hood.mytownnet.com.
It's not built in to Tomcat, but works with it -- check out the Cocoon
project at <http://xml.apache.org>.  Cocoon is a servlet that does exactly
what you describe, along with a lot of other cool stuff.

Craig McClanahan


On Fri, 10 Mar 2000, Andy Nuss wrote:

> Hi,
> 
> What I would do is create a simple servlet that parses XML docs
> and converts them to HTML depending on nature of the XML doc,
> and then specify the xml document in the query string.  Then,
> from the JSP page, I would either use an include directive or a simple
> HREF link as appropriate.
> 
> <A HREF="/servlet/MyXMLServlet?myparam=folder1/MyDoc.xml">mylink</A>
> 
> or
> 
> <jsp:include page="/servlet/MyXMLServlet?myparam=folder1/MyDoc.xml"/>
> 
> 
> Are there better, or more correct ways to do this kind of thing, built into
> Tomcat?
> 
> Thanks,
> Andy
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>