一.在JSP页面中,使用<s:property value="....."/>,要引入标签头,上午就是因为少了这个忙活了半天。。。。。
<%@ taglib uri="/struts-tags" prefix="s" %>二.JSP中获取action的request设置的值的各种方法 <body>
<center>
<%
//方法一
MemberRegisterInfo info = (MemberRegisterInfo)request.getAttribute("info");
System.out.println("JSP:=>" + info.getId());
%>
<form action="keyThree" method="post">
<!--方法二-->
ID:<s:property value="#request.info.id"/><br/>
<% System.out.print("hello=>"+request.getAttribute("info.id"));%>
<!--方法三--> ID:<s:property value="${info.id}"/><br/>
<!--方法四-->
<%--<input type="text" name="info.id" value="<s:property value='#request.info.id'/>"/>--%>
<input type="text" name="info.id" value="<s:property value='#request.info.id'/>"/><br/> 新密码:<input type="password" name="info.password"/><br>
确认密码:<input type="password" name="info.password2"/><br>
<input type="submit" value="确认"/>
</form>
</center>
</body>
本文介绍在 Struts 框架下如何在 JSP 页面中通过多种方式获取并显示 action 中设置的请求属性值,包括直接使用 Java 代码、Struts 的标签库等方式。
1095

被折叠的 条评论
为什么被折叠?



