I came across a discussion about view helpers, started by Tim Fennel,
author of Stripes. He advocates the "inverted" model for displaying
views, when view helper action is called from JSP if needed, instead
of forwarding to JSP page from action, like it works in Struts now.

With his approach, it is possible to navigate directly to JSP. On the
one hand, this is a step backward, since I used to consider a JSP page
as a mere view, and I prefer to navigate to web resource instead of
navigating to a concrete view.

On the other hand, using JSP directly from browser allows to employ
<jsp:include> without forwarding. Currently I create embedded JSP
controls by including Struts action into a JSP page. The action
forwards to JSP file to render a fragment. Servlet engines do not like
forwarding, and closes output stream immediately after returning from
forwarded fragment, so the rest of the parent page is not rendered.

Using JSP directly solves the problem, because no forwarding needed.

What about creating a tag that will allow to define a certain bean as
a view helper, and to automatically call something like processView()
on it, and return a string mapping, which could be used to select a
subview. Several subviews can be defined on one JSP page, and be
selected via tag or a scriptlet.

Michael J.

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

Reply via email to