This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I try to get form attributes on a jsp page. I did the following: <% String myForAttribute = <jsp:getProperty name="attributeA" property="ampleForm"/>; %> But this does not seem to work. I am wondering if my code is not right or there is a better way? regards,
1. You can't embed a JSP tag in a scriptlet. 2. name is usually the attribute key of the bean you are trying to use and property is the name of the field in that bean. Thus, you would probably have something like <jsp:getProperty name="ampleForm" property="attributeA"> instead. 3. You could use bean:write instead: <bean:write name="ampleForm" property="attributeA"> 4. If you need to use the value in a scriptlet, you could use bean:define <bean:define id="attrA" name="ampleForm" property="attributeA" /> [ October 01, 2003: Message edited by: Junilu Lacar ]