You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luo Yong <lu...@gmail.com> on 2007/12/18 13:36:51 UTC

JSP to HTML

Hi all.

Is there any way to produce HTML from a JSP file?

I'm wrting a servlet which can get the HTML result of a JSP file in
the same container.

Is there any class or method can do this?

Thanks.

Sorry for that my English is poor.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP to HTML

Posted by David Smith <dn...@cornell.edu>.
How about servletContext.getRequestDispatcher( path ).include( req, resp 
)?  Seems like it should do what you are asking.

--David

Luo Yong wrote:

>Hi all.
>
>Is there any way to produce HTML from a JSP file?
>
>I'm wrting a servlet which can get the HTML result of a JSP file in
>the same container.
>
>Is there any class or method can do this?
>
>Thanks.
>
>Sorry for that my English is poor.
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP to HTML

Posted by Luo Yong <lu...@gmail.com>.
On Dec 19, 2007 12:43 AM, Hassan Schroeder <ha...@gmail.com> wrote:
> On Dec 18, 2007 8:27 AM, Luo Yong <lu...@gmail.com> wrote:
> > In fact, I'm implementing a new web development framework. JSP tag
> > must not be supported in the framework and the web page cannot contain
> > any java code. so i must analyse the jsp page within a servlet and
> > expand it with web component attribute(like the Tapestry way).
>
> Then why are you even calling your component a "JSP"?  :-)
>
> If you're just parsing a text file with no taglibs or Java code using a
> servlet, that seems pretty far afield from "JSP"...
>

It seems that programmers like taglib and inline code but the web
designers don't.

The framework I'm implementing is for a company, the web development
team want these, not me. I love taglib too : )

It seems that velocity is the only way for me.

Thanks all   :)

> --
>
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP to HTML

Posted by Hassan Schroeder <ha...@gmail.com>.
On Dec 18, 2007 8:27 AM, Luo Yong <lu...@gmail.com> wrote:
> In fact, I'm implementing a new web development framework. JSP tag
> must not be supported in the framework and the web page cannot contain
> any java code. so i must analyse the jsp page within a servlet and
> expand it with web component attribute(like the Tapestry way).

Then why are you even calling your component a "JSP"?  :-)

If you're just parsing a text file with no taglibs or Java code using a
servlet, that seems pretty far afield from "JSP"...

-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP to HTML

Posted by Luo Yong <lu...@gmail.com>.
In fact, I'm implementing a new web development framework. JSP tag
must not be supported in the framework and the web page cannot contain
any java code. so i must analyse the jsp page within a servlet and
expand it with web component attribute(like the Tapestry way). I want
to embed velocity support in the framework but it's seems that other
people in my team don't want to use it.

Is there any way to do this?

If there is no other way. I may persuade other people to use velocity.

On Dec 18, 2007 8:52 PM, Hassan Schroeder <ha...@gmail.com> wrote:
> On Dec 18, 2007 4:36 AM, Luo Yong <lu...@gmail.com> wrote:
>
> > Is there any way to produce HTML from a JSP file?
>
> JSPs produce HTML by default  :-)
>
> And usually a servlet is used to populate values for a JSP -- the "View"
> in MVC --  rather than the other way around.
>
> FWIW,
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP to HTML

Posted by Hassan Schroeder <ha...@gmail.com>.
On Dec 18, 2007 4:36 AM, Luo Yong <lu...@gmail.com> wrote:

> Is there any way to produce HTML from a JSP file?

JSPs produce HTML by default  :-)

And usually a servlet is used to populate values for a JSP -- the "View"
in MVC --  rather than the other way around.

FWIW,
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JSP to HTML

Posted by Martin Gainty <mg...@hotmail.com>.
One way is to implement a transform
In other words java embedded in as jsp which parses files of a known format
(such as xml) which then transforms the results to html
Be mindful that you will need the input as well formed xml and a stylesheet
to identify display characteristics
http://www.oreilly.com/catalog/javaxslt/chapter/ch05.html

Anyone else?
Martin--
----- Original Message -----
From: "Luo Yong" <lu...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Tuesday, December 18, 2007 7:36 AM
Subject: JSP to HTML


> Hi all.
>
> Is there any way to produce HTML from a JSP file?
>
> I'm wrting a servlet which can get the HTML result of a JSP file in
> the same container.
>
> Is there any class or method can do this?
>
> Thanks.
>
> Sorry for that my English is poor.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org