This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes How to get a default value in html:textarea from a properties file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get a default value in html:textarea from a properties file." Watch "How to get a default value in html:textarea from a properties file." New topic
Author

How to get a default value in html:textarea from a properties file.

Satish Kumar
Ranch Hand

Joined: Oct 16, 2006
Posts: 85
I have the following in my jsp

<html:textarea cols="30" rows="4" name="disputeForm" property="strRemarks" value="Please type in your remarks for disputing here (up to 500 characters)"/>

I want the value to come from the applicationresources.properties.
I tried bean:message and fmt:message but it s not working.
Can somebody suggest if i am missin something.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I am sure you can do this in your JSP, but I would probably put the code to initialize this value in my Action class using code something like this:

ResourceBundle bundle = ResourceBundle.getBundle("application");
form.setStrRemarks(bundle.getString("DefaultDisputeRemarks"));

- Brent
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get a default value in html:textarea from a properties file.
 
It's not a secret anymore!