File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting form values on jsp page

 
rick collette
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
rick collette
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
It works actually.
regards,
[ October 02, 2003: Message edited by: rick collette ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic