wood burning stoves 2.0*
The moose likes Struts and the fly likes html:options VERY confusing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:options VERY confusing" Watch "html:options VERY confusing" New topic
Author

html:options VERY confusing

Jason Berk
Ranch Hand

Joined: May 03, 2006
Posts: 41
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

Joined: Feb 08, 2006
Posts: 948
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

Joined: May 03, 2006
Posts: 41

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:options VERY confusing