File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes html:select and internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:select and internationalization" Watch "html:select and internationalization" New topic
Author

html:select and internationalization

Ergin Er
Ranch Hand

Joined: Sep 06, 2005
Posts: 60
Hi all,

I'm trying to modify my existing select box. This is how it looks now:


In the action I set the statusList on loading the page. It contains list of pojo's (workmates) that has a property isActive.
The statusList is a property in the Form, so I don't use request.setAttribute("statusList", statusList).
This displays the isActive values nicely in my dropdown box.
Now I have to make a switch by using resource bundle values. the isActive values will be linked to resource bundle. To do that I will need to fill in the dropdown box iteratively and link each statusList items isActive value to the bundle. And the isActive values in the db will be replaced by the keys that are put in the resource. This way the values can be internationalized.
this is how far I got:

This throws the following error: com.caucho.jsp.JspLineParseException: /jsp/PpoAdminListEmployees.jsp:55: attribute `value' in tag `bean:message' has no corresponding set method in tag class `org.apache.struts.taglib.bean.MessageTag'
What am I missing here?

Update: This throws nullPointerException

[ September 13, 2005: Message edited by: Ergin Er ]
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
You need to use the value of the "id" that you are iterating on.
I haven't actually tried the following code, but it gives the general idea

<logic:iterate id="id" name="ppoadminemployees" property="statusList">
<htmlption bundle="msg"><bean:write name="id" property="isActive"/></htmlption>
</logic:iterate>

or maybe:
<logic:iterate id="id" name="ppoadminemployees" property="statusList">
<htmlption bundle="msg" key="<%= id.getIsActive() %>"/>
</logic:iterate>
[ September 13, 2005: Message edited by: Stefan Evans ]
Ergin Er
Ranch Hand

Joined: Sep 06, 2005
Posts: 60
Thanks a lot dude. Your code didn't work but it did help me on my way. The id that I had to iterate on is in this case workmate and the bundle had to be placed in the section message where I write the interation results to the select box.

This is the working code:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: html:select and internationalization