Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:define property

 
Hemang Joshi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have already defined struts-bean tag at the start of JSP and would like to store bean property value in a java variable using <bean define> tag.

<bean efine id="Test"
name="javaBean"
property="attributeOfJavaBean"
type="java.lang.String"
scope="session" />

Test : <%=Test%>


It throws an exception stating that variable Test not identified as following.

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
Test cannot be resolved

I have reffered few books and according to it the above syntex is correct.

Looking for your input.

Thanks,
Hemang
 
art gems
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it would really have to be:

<%@ taglib uri="/tags/struts-bean" prefix="bean" %> (or whatever uri you mapped ur tld to in web.xml)

<bean: define id="Test" (without the space between bean: and define, of course)
name="javaBean"
property="attributeOfJavaBean"
type="java.lang.String"
scope="session" />;

Test : <%=Test%>
[ February 27, 2006: Message edited by: art gems ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic