You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Zatko <mz...@boscovs.com> on 2004/02/24 19:27:37 UTC
Loading attributes into a tag attribute
Hello,
I am wondering what is the best method for loading a variable passed
to a page as an attribute into a tag's attribute?
For Example:
I have a String stored in a request attribute and it's called "startDate".
In the JSP, I do the following:
<bean:define id="startDate" name="startDate"/>
<bean:message key="salesResults.main.table.title" arg0='<%= new
String("" + startDate) %>'/>
It strikes me that there is probably a better, cleaner way to do this.
How would you use JSTL to do this? Originally, I wanted to use JSTL but
it appears that the c:set tag doesn't make startDate available as a
scripting value.
<c:set var="startDate" property="${startDate}"/>
Mike Zatko
* I know this topic has probably been covered before but the mailing
list archive was giving me timeouts.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Loading attributes into a tag attribute
Posted by Richard Yee <ry...@yahoo.com>.
Mike,
Use this link to get to the struts-user archives:
http://marc.theaimsgroup.com/?l=struts-user
-Richard
--- Mike Zatko <mz...@boscovs.com> wrote:
> Hello,
> I am wondering what is the best method for
> loading a variable passed
> to a page as an attribute into a tag's attribute?
>
> For Example:
>
> I have a String stored in a request attribute and
> it's called "startDate".
> In the JSP, I do the following:
>
> <bean:define id="startDate" name="startDate"/>
> <bean:message key="salesResults.main.table.title"
> arg0='<%= new
> String("" + startDate) %>'/>
>
> It strikes me that there is probably a better,
> cleaner way to do this.
> How would you use JSTL to do this? Originally, I
> wanted to use JSTL but
> it appears that the c:set tag doesn't make startDate
> available as a
> scripting value.
>
> <c:set var="startDate" property="${startDate}"/>
>
>
>
> Mike Zatko
>
> * I know this topic has probably been covered before
> but the mailing
> list archive was giving me timeouts.
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org