velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: Struts/Velocity integration
Date Tue, 04 Dec 2001 23:09:17 GMT
RequestUtils is JSP-centric since it was written to support the tag
extensions. 

Any other apparent bias simply flows from the fact that right now, JSPs
is all Struts developers have at their disposal. But the framework
itself, is just tossing around JavaBeans and URIs, and things straight
out of the Servlet specification. There *is* a Servlet and JavaBean
bias, which I doubt would change anytime soon.

Meanwhile, If there were methods we could add to RequestUtils that would
benefit other presentation systems, then I'd be happy to commit them. I
do not consider JSPs to have any special status with the framework, they
are just want the initial volunteers were interested in doing.

The Struts resources themselves are first-order objects exposed in the
application scope, where anyone in the application can use them. 

I believe that the original VelocityServlet idea is sound, and could
expose Velocity to any Web framework that uses the standard Servlet
contexts, including Struts. 

A subclass of that might then provide access to the Struts specific
resources, like the MessageResources, ActionMappings, ActionForwards,
and ActionForms. That should be about it really. 

MessageResouces - provides localised messages and labels.
ActionForward - provides a logical name for an URI, so it is not
embedded in the page. 
ActionForms - a JavaBean "buffer" for HTML controls, with a hook for
automatic validation.
ActionMappings - a configuration object for a server-side Action. Most
often the target for a HTML form.

These are the framework specific objects, but developers are always
tossing in their own JavaBeans, and Vectors, and what-have-you, into the
servlet request or sessions contexts, in the same way the
VelocityContext is used (I imagine). 

So, the other first step, along with Donnie's bean, I think, is to chain
the request, session, and application contexts to a VelocityContext,
behind a facade. 

Konstantin Priblouda wrote:
> 
> > Hm.  If I recall, I did get it to work.  The point
> > is not to reinvent the
> > wheel here, but integrate.
> >
> > It's been a while since I did this, but if I recall,
> > it's bean:message
> > because its using a regular bean that does the
> > actual message stuff.
> 
> Hmm, I looked inside on sunday, and found that
> message getting stuff actually lives inside
> RequestUtils and isinfested with PageContext stuff
> 
> ( mostly for generating stupid jsp exceptions in
> case property no existed while it would be enough
> to display property key instead )
> 
> Struts is VERY jsp-centric...
> 
> regards,
> 
> =====
> Konstantin Priblouda ( ko5tik )    Freelance Software developer
> < http://www.pribluda.de > < play java games -> http://www.yook.de >
> < render charts online -> http://www.pribluda.de/povray/ >
> 
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message