my dog learned polymorphism*
The moose likes Struts and the fly likes how to set the <bean:message key= into jsp:setProperty parameter" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to set the <bean:message key="abc.xyz" /> into jsp:setProperty parameter" Watch "how to set the <bean:message key="abc.xyz" /> into jsp:setProperty parameter" New topic
Author

how to set the <bean:message key="abc.xyz" /> into jsp:setProperty parameter

Polishetty Raghavendra
Greenhorn

Joined: Apr 09, 2006
Posts: 18
Hi,

I am trying to set the value of a bean property using jsp:setProperty.

This below code i am hardcoding the value as resourceABC into resourceId property of mybean. This working fine.

<jsp:useBean id="mybean" class="com.abc.xyz">
<jsp:setProperty name="mybean" property="resourceId" value="resourceABC" />
</jsp:useBean>

But when try to read the value from a property file using the struts-bean tags, and i want to set that particular value into resourceId property of mybean.

This is code :

<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<jsp:useBean id="mybean" class="com.abc.xyz">
<jsp:setProperty name="mybean" property="resourceId" value=" <bean:message key="abc.xyz"/> " />
</jsp:useBean>

I am getting the error as " Attribute abc.xyz is unrecognised for jsp element jsp:setProperty " .


Regards,<br />P Raghavendra<br />SCJP 1.5 - 70%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to set the <bean:message key="abc.xyz" /> into jsp:setProperty parameter