You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dani <mc...@wanadoo.es> on 2003/04/11 11:20:23 UTC

About templates

I have to do an application with a menu included in each page. This menu
shows different options depending on some values (the actual operation saved
into session).

I've seen documentation about templates. This is the solution I've found:

* Each application page makes an insert of a template menuTemplate.jsp, like
that:
<template:insert template='/menuTemplate.jsp'>
  <template:put name='menu' content='/mainMenu.jsp' />
 </template:insert>
.... and the rest of the code page

* Page menuTemplate.jsp only has this:

<%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
<template:get name='menu'/>

* Page mainMenu.jsp is a normal Jsp.

The problem I've found is this: In  page mainMenu.jsp I have:
<%= request.getSession().getAttribute("selectedop") %>

But I've no result. I can see the value in the main page that insert
template. ¿What's happening?
Thks


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: About templates

Posted by Dani <mc...@wanadoo.es>.
I make a mistake. It's working. Thanks
----- Original Message -----
From: Dani <mc...@wanadoo.es>
To: Struts Users Mailing List <st...@jakarta.apache.org>
Sent: Friday, April 11, 2003 11:20 AM
Subject: About templates


> I have to do an application with a menu included in each page. This menu
> shows different options depending on some values (the actual operation
saved
> into session).
>
> I've seen documentation about templates. This is the solution I've found:
>
> * Each application page makes an insert of a template menuTemplate.jsp,
like
> that:
> <template:insert template='/menuTemplate.jsp'>
>   <template:put name='menu' content='/mainMenu.jsp' />
>  </template:insert>
> .... and the rest of the code page
>
> * Page menuTemplate.jsp only has this:
>
> <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
> <template:get name='menu'/>
>
> * Page mainMenu.jsp is a normal Jsp.
>
> The problem I've found is this: In  page mainMenu.jsp I have:
> <%= request.getSession().getAttribute("selectedop") %>
>
> But I've no result. I can see the value in the main page that insert
> template. ¿What's happening?
> Thks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: About templates

Posted by Alexandre Jaquet <al...@freesurf.ch>.
Hi Dan have a look for struts-menu. But don't care
so much about the design of the view part,
Mathew will take care.

--
Alexandre Jaquet
Lead Engineer
Noumenaut Software


----- Original Message -----
From: "Dani" <mc...@wanadoo.es>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, April 11, 2003 11:20 AM
Subject: About templates


> I have to do an application with a menu included in each page. This menu
> shows different options depending on some values (the actual operation
saved
> into session).
>
> I've seen documentation about templates. This is the solution I've found:
>
> * Each application page makes an insert of a template menuTemplate.jsp,
like
> that:
> <template:insert template='/menuTemplate.jsp'>
>   <template:put name='menu' content='/mainMenu.jsp' />
>  </template:insert>
> .... and the rest of the code page
>
> * Page menuTemplate.jsp only has this:
>
> <%@ taglib uri='/WEB-INF/tlds/struts-template.tld' prefix='template' %>
> <template:get name='menu'/>
>
> * Page mainMenu.jsp is a normal Jsp.
>
> The problem I've found is this: In  page mainMenu.jsp I have:
> <%= request.getSession().getAttribute("selectedop") %>
>
> But I've no result. I can see the value in the main page that insert
> template. ¿What's happening?
> Thks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org