File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:options VERY confusing

 
Jason Berk
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MyAction.java:
request.setAttribute("departments", service.getDepartments());

so I have an ArrayList in my request scope which contains "department" objects....

Department.java:
private String deptNum;
private String deptShortName;
public String getDeptNum(){ return this.deptNum; }
public String getDeptShortName(){ return this.deptShortName; }

now in my JSP:
<html:select property="whatever" size="1">
<html ptions
collection="departments"
property="DeptNum"
labelProperty="DeptShortName"
/>
</html:select>

what the he!! am I doing wrong? why is this tag _so_ confusing?

Jason
[ June 06, 2006: Message edited by: Jason Berk ]
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is not working for you? The one thing that I see is that the property and labelProperty should start with a lower case. Like this:

property="deptNum"
labelProperty="deptShortName"

- Brent
 
Jason Berk
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What is not working for you? The one thing that I see is that the property and labelProperty should start with a lower case. Like this:

property="deptNum"
labelProperty="deptShortName"

- Brent


I _assumed_ that since my getter method was "getDeptNum" that I needed to just drop the "get". I didn't realize the tag took the liberty of (not) eval'ing the case of my input.

it now works....

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic