This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes bean:define property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:define property" Watch "bean:define property" New topic
Author

bean:define property

Hemang Joshi
Greenhorn

Joined: Feb 26, 2006
Posts: 5
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

Joined: Oct 01, 2003
Posts: 5
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 ]
 
 
subject: bean:define property