You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by JRD <da...@hotmail.com> on 2008/04/15 23:55:44 UTC

Hi there,

I have an action/form that contains properties x, y, & z with values 1, 2, &
3.  I have a .JSP where I want to write out the values of them dynamically.  

<c:set var="currentProperty" value="x"/>

How do I write a <s:property value=""/> using currentProperty that would
result it showing my actions value (1).

If I were using runtime expressions I would write it like
<s:property value="${currentProperty}"/>
but that is verboten by the tld.

All help is appreciated,
Jonathan
-- 
View this message in context: http://www.nabble.com/%3Cs%3Aproperty-with-dynamic-values-tp16711862p16711862.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Posted by JRD <da...@hotmail.com>.
I can't use ${x} because I am not always looking for x.

The basics of what I am doing is building a tile that will print out any
property in my action/form.

So I have some JSP #1 that says

<tiles:insertDef name="textOutput">
    <tiles:putAttribute name="property" value="x"/>
</tiles:insertDef>
<tiles:insertDef name="textOutput">
    <tiles:putAttribute name="property" value="y"/>
</tiles:insertDef>
...

And for each definition it inserts JSP #2 that looks like...

<tiles:useAttribute name="property">
<s:property ??? />

I just can't figure out how to write that property tag.  I need it to show
the value of the property passed in.  As I said if I could use runtime
expressions I could just write <s:property value="${property}"/>

So I can't use the:

Or use <s:set name="currentProperty" value="x"/> with either the "bare" JSP
2.0+ notation or via <s:property value="#currentProperty"/>.

It would work if I knew to write in 'x' for the currentProperty, but since I
have to evaluate property to get x it doesn't work.

Any other thoughts? Thanks,
Jonathan


newton.dave wrote:
> 
> --- JRD <da...@hotmail.com> wrote:
>>  I have a .JSP where I want to write out the values of them dynamically.
>>  
>> 
>> <c:set var="currentProperty" value="x"/>
>> 
>> How do I write a <s:property value=""/> using currentProperty that would
>> result it showing my actions value (1).
>> 
>> If I were using runtime expressions I would write it like
>> <s:property value="${currentProperty}"/>
>> but that is verboten by the tld.
> 
> Why wouldn't you just use ${x} (in a JSP 2.0+ container) or <s:property
> value="x"/>?
> 
> If you're dead-set on using the "currentProperty" thing use
> ${currentProperty} or <s:property value="currentProperty"/>. 
> 
> Or use <s:set name="currentProperty" value="x"/> with either the "bare"
> JSP
> 2.0+ notation or via <s:property value="#currentProperty"/>.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cs%3Aproperty-with-dynamic-values-tp16711862p16722511.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Posted by Dave Newton <ne...@yahoo.com>.
--- JRD <da...@hotmail.com> wrote:
>  I have a .JSP where I want to write out the values of them dynamically.
>  
> 
> <c:set var="currentProperty" value="x"/>
> 
> How do I write a <s:property value=""/> using currentProperty that would
> result it showing my actions value (1).
> 
> If I were using runtime expressions I would write it like
> <s:property value="${currentProperty}"/>
> but that is verboten by the tld.

Why wouldn't you just use ${x} (in a JSP 2.0+ container) or <s:property
value="x"/>?

If you're dead-set on using the "currentProperty" thing use
${currentProperty} or <s:property value="currentProperty"/>. 

Or use <s:set name="currentProperty" value="x"/> with either the "bare" JSP
2.0+ notation or via <s:property value="#currentProperty"/>.

Dave



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