tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Dam" <lars...@gmail.com>
Subject Re: Proper way to use a definition attribute as argument or parameter for an action?
Date Wed, 30 Apr 2008 12:40:42 GMT
This works sort of. I get a value i can access using the <%= and
tiles:tiles:getAsString - but the <%=  gives me a string representation
where i would like to get the original object (which is retrieved from the
action).

It is also unclear for me how i would use this object on the jsp page?

I would be very happy if somebody could give me an example of how to
access/use the object that was placed in the 'argument' attribute (see
example) using struts2 tags in the someminorjsppage.jsp.

kr. Lars Dam

On Mon, Apr 28, 2008 at 9:07 PM, Chris Pratt <thechrispratt@gmail.com>
wrote:

> You can set the value of argument either using EL in the value=""
> attribute, or using JSP in the body of the putAttribute tag.
>
> Example:
>
>  <tiles:insertTemplate template="/someminorjsppage.jsp">
>     <tiles:putAttribute name="title" value="some.title.i18n.key"/>
>     <tiles:putAttribute name="argument" value="${myArgument}"/>
>  </tiles:insertTemplate>
>
>  <tiles:insertTemplate template="/someminorjsppage.jsp">
>     <tiles:putAttribute name="title" value="some.title.i18n.key"/>
>     <tiles:putAttribute name="argument"><s:property
> value="%{ognlValue}"/></tiles:putAttribute>
>  </tiles:insertTemplate>
>
> (*Chris*)
>
> On Mon, Apr 28, 2008 at 5:30 AM, Lars Dam <larsdam@gmail.com> wrote:
> > I am trying to make some kind of jsp 'component' page that can be reused
> >  multiple times with different datasets on a single jsp page. When
> defining
> >  the templates i use i can give some arguments that i can access on the
> >  template page, but how can i use these arguments on the action?
> >
> >  If i have a jsp page that contains two templates like:
> >  :
> >  <tiles:insertTemplate template="/someminorjsppage.jsp">
> >     <tiles:putAttribute name="title" value="some.title.i18n.key"/>
> >     <tiles:putAttribute name="argument" value="someargument"/>
> >  </tiles:insertTemplate>
> >  :
> >  <tiles:insertTemplate template="/someminorjsppage.jsp">
> >     <tiles:putAttribute name="title" value="some.title.i18n.key"/>
> >     <tiles:putAttribute name="argument" value="anotherargument"/>
> >  </tiles:insertTemplate>
> >  :
> >
> >  What would be the proper way to send the value of "argument" to the
> action,
> >  so the action could use this to find data for the jsp page?
> >
> >  Would it be possible to have some kind of callback to the action that
> gets
> >  the 'argument' attribute as parameter?
> >
> >  Or am i on some completely wrong track of how to do this?
> >
> >  kr. Lars Dam
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message