I m new to Struts2 and Hibernate. I am trying to save values from the form. On submit the value of the textarea will be saved null;
我的表象是这样。
<s:form action="saveComment">
<s:push value="ai">
<s:hidden name="id"/>
<table cellpadding="5px">
<tr><td><s:textarea name="description" rows="5" cols="60" theme="simple" />
</td>
<td> <s:submit type="image" src="images/sbt.gif" >
</s:submit>
</td></tr>
</table>
</s:push>
</s:form>
and my Action Method is like this-
public String saveComment() throws Exception {
Map session = ActionContext.getContext().getSession();
ExternalUser user = (ExternalUser) session.get("user");
AIComment aiComment = new AIComment();
aiComment.setAi(ai);
aiComment.setPostedOn(new java.util.Date());
aiComment.setPostedBy(user);
aiCommentDao.saveAIComment(aiComment);
return SUCCESS;
}