File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Polishetty Raghavendra
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 " .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic