ssh中action的各种处理系列一

来源:互联网 发布:seo好做吗 编辑:程序博客网 时间:2024/05/19 16:48

1.在ssh的构架中,如果action中可以获取jsp页面的值,并且使用request进行设置,在另一个页面进行获取

示例:jsp页面1

<body>    <center>请输入用户名:<br><br>    <form action="key.action" method="post">    <input type="text" name="info.name"><br/>    <input type="submit" value="提交">    </form></center>  </body>

action中的处理

private HttpServletRequest request = ServletActionContext.getRequest();

request.setAttribute("info", info);//info是与表单相关的VO

jsp页面的获取

<s:property  value="#request.info.question"/><br/>    问题:<input type="text" name="info.question"  value="<s:property value='#request.info.question'/>" readonly="true" />