You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Robert J. Sanford, Jr." <rs...@nolimitsystems.com> on 2002/04/03 19:11:01 UTC

alternative jsp compiler?

i don't know if this sort of thing even exists or if it is even feasible but
asking never hurts...

what i want is to not have my jsp's compiled into servlets but into beans.
with struts i already have a nice framework that allows multi-threaded
access to a centralized controller with the ability to route requests
to/through a series of actors. why can't the presentation actors be beans
instead of servlets? wouldn't creating a nifty little jspBean class be
reasonably easy to do?

rjsjr


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: alternative jsp compiler?

Posted by Marcelo Vanzin <va...@rededc.com.br>.
Robert J. Sanford, Jr. wrote:
> the difference is that a new servlet is actually a "process" (for
> lack of a better term) in the container where the bean would not
> be - it would be invoked from the thread accessing the controller
> servlet.

	So you're substituting:

	container -> servlet -> dispatch
		  -> servlet
		( etc )

	For:
	container -> servlet -> bean (-> bean?)

	So everything runs in the same "process tree" instead of finishing the 
execution of one servlet, pass the control to other (thus freeing some 
resources from the previous one) and so on?

	I don't know, it seems to me that the dispatch method used by the 
container is better...it may be slower (though I doubt it makes a big 
difference), but, it's a compromise.

-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
vanza@rededc.com.br
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: alternative jsp compiler?

Posted by "Robert J. Sanford, Jr." <rs...@nolimitsystems.com>.
thanks!

and you're right about drinking cheap beer as well.

rjsjr

> -----Original Message-----
> From: Marcelo Vanzin [mailto:vanza@rededc.com.br]
> Sent: Wednesday, April 03, 2002 2:12 PM
> To: Struts Users Mailing List
> Subject: Re: alternative jsp compiler?
>
>
> Robert J. Sanford, Jr. wrote:
> > so velocity is using the same idea of a controller servlet with
> > a "bean" of some sort to actually render a page instead of
> > generating a new servlet for each displayed page? cool.
>
> 	Kind of. :-) You're actually just calling a method that'll read a
> template with Velocity's tags, and passing a "Context" object (this is a
> Velocity object that kinda looks like a Hashtable) from where it'll take
> the beans to make the substitutions in the template.
>
> 	But, you do not have a new servlet created for it, you're
> just executing
> a method in a class.
>
> > are there any sort of visual tools for creating the layout of
> > a velocity page?
>
> 	A Velocity template looks pretty much like plain HTML with
> some added
> syntax for the commmands and variable names. I don't think there's an
> environment ready for it, but, as it looks just like plain HTML (with
> just some added noise from the commands), Dreamweaver has a chance of
> showing them nicely.
>
> 	Take a look at its page: http://jakarta.apache.org/velocity
>
> --
> []'s
> Marcelo Vanzin
> Touch Tecnologia
> vanza@rededc.com.br
> "Life is too short to drink cheap beer"
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: alternative jsp compiler?

Posted by Marcelo Vanzin <va...@rededc.com.br>.
Robert J. Sanford, Jr. wrote:
> so velocity is using the same idea of a controller servlet with
> a "bean" of some sort to actually render a page instead of
> generating a new servlet for each displayed page? cool.

	Kind of. :-) You're actually just calling a method that'll read a 
template with Velocity's tags, and passing a "Context" object (this is a 
Velocity object that kinda looks like a Hashtable) from where it'll take 
the beans to make the substitutions in the template.

	But, you do not have a new servlet created for it, you're just executing 
a method in a class.

> are there any sort of visual tools for creating the layout of
> a velocity page? 

	A Velocity template looks pretty much like plain HTML with some added 
syntax for the commmands and variable names. I don't think there's an 
environment ready for it, but, as it looks just like plain HTML (with 
just some added noise from the commands), Dreamweaver has a chance of 
showing them nicely.

	Take a look at its page: http://jakarta.apache.org/velocity

-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
vanza@rededc.com.br
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: alternative jsp compiler?

Posted by "Robert J. Sanford, Jr." <rs...@nolimitsystems.com>.
so velocity is using the same idea of a controller servlet with
a "bean" of some sort to actually render a page instead of
generating a new servlet for each displayed page? cool.

are there any sort of visual tools for creating the layout of
a velocity page? my designers are using dreamweaver to layout
jsp's and would want to continue along similar veins if we
switched over to a new template engine...

rjsjr

> -----Original Message-----
> From: Marcelo Vanzin [mailto:vanza@rededc.com.br]
> Sent: Wednesday, April 03, 2002 11:49 AM
> To: Struts Users Mailing List
> Subject: Re: alternative jsp compiler?
> 
> 
> Robert J. Sanford, Jr. wrote:
> > the difference is that a new servlet is actually a "process" (for
> > lack of a better term) in the container where the bean would not
> > be - it would be invoked from the thread accessing the controller
> > servlet.
> 
> 	BTW, if I understand you correctly, what you're proposing 
> can be done 
> easily with a templating engine like Velocity.
> 
> 	In your action class within Struts, call 
> "Velocity.merge(bla bla bla)" 
> (or whatever the method is called), which'll send the data of the 
> template to te client, and then return null, so that Struts does not do 
> any further dispatches.
> 
> 
> 
> -- 
> []'s
> Marcelo Vanzin
> Touch Tecnologia
> vanza@rededc.com.br
> "Life is too short to drink cheap beer"
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: alternative jsp compiler?

Posted by Marcelo Vanzin <va...@rededc.com.br>.
Robert J. Sanford, Jr. wrote:
> the difference is that a new servlet is actually a "process" (for
> lack of a better term) in the container where the bean would not
> be - it would be invoked from the thread accessing the controller
> servlet.

	BTW, if I understand you correctly, what you're proposing can be done 
easily with a templating engine like Velocity.

	In your action class within Struts, call "Velocity.merge(bla bla bla)" 
(or whatever the method is called), which'll send the data of the 
template to te client, and then return null, so that Struts does not do 
any further dispatches.



-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
vanza@rededc.com.br
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: alternative jsp compiler?

Posted by "Robert J. Sanford, Jr." <rs...@nolimitsystems.com>.
the difference is that a new servlet is actually a "process" (for
lack of a better term) in the container where the bean would not
be - it would be invoked from the thread accessing the controller
servlet.

like i said, i don't know if this is even a reasonable request, it
just sort of floated into my head one day.

rjsjr

> -----Original Message-----
> From: Marcelo Vanzin [mailto:vanza@rededc.com.br]
> Sent: Wednesday, April 03, 2002 11:30 AM
> To: Struts Users Mailing List
> Subject: Re: alternative jsp compiler?
> 
> 
> Robert J. Sanford, Jr. wrote:
> > servlet (instantiated by compiling .jsp->.java->.class) the controller
> > servlet simply invokes a method on the newly defined bean.
> 
> 	And how is this different from invoking a method in the 
> newly defined 
> servlet?
> 
> 	Your "bean" sounds too much like a "servlet" with a different name.
> 
> -- 
> []'s
> Marcelo Vanzin
> Touch Tecnologia
> vanza@rededc.com.br
> "Life is too short to drink cheap beer"
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: alternative jsp compiler?

Posted by Marcelo Vanzin <va...@rededc.com.br>.
Robert J. Sanford, Jr. wrote:
> servlet (instantiated by compiling .jsp->.java->.class) the controller
> servlet simply invokes a method on the newly defined bean.

	And how is this different from invoking a method in the newly defined 
servlet?

	Your "bean" sounds too much like a "servlet" with a different name.

-- 
[]'s
Marcelo Vanzin
Touch Tecnologia
vanza@rededc.com.br
"Life is too short to drink cheap beer"


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: alternative jsp compiler?

Posted by "Robert J. Sanford, Jr." <rs...@nolimitsystems.com>.
struts provides the controller servlet. all requests from any page that
is being managed by struts goes first through the controller. instead
of having the struts controller servlet forward a request to another
servlet (instantiated by compiling .jsp->.java->.class) the controller
servlet simply invokes a method on the newly defined bean.

does that make sense to anyone other than myself?

is what i'm asking a reasonable thing or am i off in left field?

rjsjr

> -----Original Message-----
> From: Giuseppe Galli [mailto:ggalli@e-tree.com]
> Sent: Wednesday, April 03, 2002 11:12 AM
> To: Struts Users Mailing List; struts-user@jakarta.apache.org
> Subject: Re: alternative jsp compiler?
>
>
> Hi Robert,
> how these bean could be invoked by http requests even if they are not
> servlet? the only way I know alternative to servlet to handle http
> interactions is SOAP.
> Pino
>
> At 11.11 03/04/2002, Robert J. Sanford, Jr. wrote:
> >i don't know if this sort of thing even exists or if it is even
> feasible but
> >asking never hurts...
> >
> >what i want is to not have my jsp's compiled into servlets but
> into beans.
> >with struts i already have a nice framework that allows multi-threaded
> >access to a centralized controller with the ability to route requests
> >to/through a series of actors. why can't the presentation actors be beans
> >instead of servlets? wouldn't creating a nifty little jspBean class be
> >reasonably easy to do?
> >
> >rjsjr
> >
> >
> >--
> >To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> >For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: alternative jsp compiler?

Posted by Giuseppe Galli <gg...@e-tree.com>.
Hi Robert,
how these bean could be invoked by http requests even if they are not 
servlet? the only way I know alternative to servlet to handle http 
interactions is SOAP.
Pino

At 11.11 03/04/2002, Robert J. Sanford, Jr. wrote:
>i don't know if this sort of thing even exists or if it is even feasible but
>asking never hurts...
>
>what i want is to not have my jsp's compiled into servlets but into beans.
>with struts i already have a nice framework that allows multi-threaded
>access to a centralized controller with the ability to route requests
>to/through a series of actors. why can't the presentation actors be beans
>instead of servlets? wouldn't creating a nifty little jspBean class be
>reasonably easy to do?
>
>rjsjr
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>