现在的位置: 首页 > 综合 > 正文

菜鸟容易犯的低级错误一

2013年02月23日 ⁄ 综合 ⁄ 共 814字 ⁄ 字号 评论关闭

一.在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>














抱歉!评论已关闭.