outputting ${argument} shows content of toString() - using ${argument.name}
gives me following error:
"According to TLD or attribute directive in tag file, attribute value does
not accept any expressions"
To summarize:
My tiles definition is:
<tiles:insertTemplate template="/someminorjsppage.jsp">
<tiles:putAttribute name="argument">
<s:property value="map['key']"/>
</tiles:putAttribute>
</tiles:insertTemplate>
My action has an attribute 'map' with objects mapped by keys, and i get the
proper instance from the 'key'.
The someminorjsppage.jsp is just:
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<tiles:importAttribute name="argument"/>
<tiles:useAttribute name="argument"/>
<%-- different suggestions below, tried one at the time --%>
<tiles:getAsString name="component"/> <%-- gives output of toString() --%>
<s:property value="argument.name" /> <%-- gives nothing, what i would like
to get --%>
<s:property value="argument" /> <%-- gives nothing --%>
${argument} <%-- gives output of toString() --%>
${argument.name} <%-- gives the "According to..." error --%>
It seems to me that i get the proper object from my map in my action, since
it gives me proper toString() information (shows proper classname of
instance i got from the map).
But i have no idea of how i would use this instance properly in the jsp
page - any pointers are welcome.
kr. Lars Dam
On Wed, Apr 30, 2008 at 3:54 PM, Antonio Petrelli <
[EMAIL PROTECTED]> wrote:
> 2008/4/30 Lars Dam <[EMAIL PROTECTED]>:
> > I used the tiles:importAttribute, like:
> >
> > <tiles:getAsString name="argument"/>
> > but i dont get anything when i try to access this, using s: tags,e.g:
> >
> > <s:property value="argument.name"/>
>
> IMO it is because it is not put inside the Struts value stack, but in
> the page scope.
> To be sure, try simple to output it:
> ${argument.name}
>
> Antonio
>