• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 " .
 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic