I would like to know how the default value can be set in textarea , the scenario would be after a page refresh , or fail of validation bedore save operation.
<s:textarea name="desc" value="" theme="xhtml" required="true" cssClass="text textarea small"/>
value=”<%= “Default” %>” , this code is not working out.
Perhaps I’m missing something, but IMO this is the same as for any field: the value attribute of a Struts2 tag looks up the respective property in your stack. In the typical scenario, when you type, say,
<s:textarea value="comment" ..>Struts2 will use theMyAction.getComment()andMyAction.setComment()to read/write the textarea value. Then, you just have to assign a default value for the attribute in your action -which, BTW, is conceptually the right way.