On 10/13/05, Ted Husted <[EMAIL PROTECTED]> wrote:
> The Velocity Tools are a neat way to implement helpers.
>
> * http://jakarta.apache.org/velocity/tools/index.html
>
> Velocity Struts is an extension of the Velocity Tools that implements
> the Struts API as set of helper objects that are injected into the
> server page context. Very cool.

Thanks, I take a look at Velocity.

> I doubt that it would be difficult to use a custom tag or JSTL
> expression to fire a helper as the page was rendering. A kink with
> this strategy is the inverse of your forwarding issue. If something
> goes wrong while the page is rendering, it's too late to dispatch to
> another page.

Right, conceptually I prefer to navigate to action since action
represents a web resource to me, and JSP is just a view, and I can
have several views for an action. But the benefit of navigating
directly to JSP is to be able to include it in another JSP, and this
would work with currently available servlet engines. Including actions
that forward to JSP does not work in Tomcat, for example.

It is possible to dispatch to one or another page from within JSP,
therefore offloading portion of dispatching functionality to JSP. Does
not look nice conceptually, but works with servlet engines if I want
to embed a JSP fragment into another JSP page.

I think I can write a generic JSP view helper which would instantiate
action class and a form bean, initialize them, call execute() on
action, and then choose a proper JSP fragment to include. I will need
to read config info from struts-config, I have it all in the memory,
so it should be simple.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to