You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by de...@ubs.com on 2001/08/24 10:23:59 UTC

template tags

I put a special header and footer on all my pages. I'd like
to do this with the template tags. Template tags allow
you to pass named parameters to the template. However, I need
to pass a list of things (navigation URLs) into my header
so it can print a list of hyperlinks. It doesn't seem possible
to pass a list of items with the template tags. Can anyone
suggest anything?

Devon


How to include an .do from a jsp

Posted by Gregor Rayman <gr...@gmx.net>.
Hi all, 

some time ago I've written about my problem including *.do in jsps.
E.g. in the template tags. The problem is caused be the way, how 
Action/ActionServlet controls the invocation of its view.

The request is either forwarded or redirected to the view and neither
forwarding nor redirecting work, when the action is included.

My workaround is, to let the Action's perform() method to return null
and then in my composite view include the sub-view.

So something like:

<jsp:include page="thing.do" />
<jsp:inlcude page="thing-success.jsp" />

This definitely breaks the MVC pattern, since the composite view 
controls the view of the sub-action.


My proposal: 

Now I can specify in struts-config.xml that a forward should be
redirected with redirect="true". What about allowing include as
well? Even better would be, it ActionServlet recognised, the
action is beeing included and it would include the view instead
of forwarding/redirecting to it.


I'll try to have a look at it in September and submit a patch.

--
gR


Re: template tags

Posted by Gregor Rayman <gr...@gmx.net>.
<de...@ubs.com> wrote:


> I put a special header and footer on all my pages. I'd like
> to do this with the template tags. Template tags allow
> you to pass named parameters to the template. However, I need
> to pass a list of things (navigation URLs) into my header
> so it can print a list of hyperlinks. It doesn't seem possible
> to pass a list of items with the template tags. Can anyone
> suggest anything?
> 
> Devon

You can put the list in an request scoped bean with defined name.
The template can then access it, e.g. with <ligic:iterate>

--
gR