action为什么没有进入jsp中定义的方法,直接返回了input?
jsp:
<form action="" method="post">
<table cellpadding="0" cellspacing="0" border="2" align="center">
<tr>
<td>用户ID</td><td>用户姓名</td><td>住址</td><td>Tel</td><td>是否已删除</td><td>修改用户信息</td>
</tr>
<%
List<Users> listuUsers=(List<Users>)session.getAttribute("users");
Iterator it=listuUsers.iterator();
while(it.hasNext())
{
Users users=(Users)it.next();
Integer userID=users.getUserID();
String userName=users.getName();
String address=users.getAddress();
String tel=users.getTel();
boolean del_tag=users.getDel_tag();
%>
<tr>
<td><input type="text" name="userID" value="<%=userID%>"></td>
<td><input type="text" name="username" value="<%=userName%>"></td>
<td><input type="text" name="address" value="<%=address%>"></td>
<td><input type="text" name="tel" value="<%=tel%>"></td>
<td><input type="text" name="del_tag" value="<%=del_tag%>"></td>
<td><a href="<%=request.getContextPath()%>/toUpdateuserManagerAction.action?userID=<%=userID%>>">修改用户信息</a></td>
</tr><%} %>
</table>
</form>
UserManagerAction.java
public class UserManagerAction extends BaseAction {
BLLUsers bllUsers=new BLLUsers();
private String username;
private Integer userID;
private String address;
private Boolean del_tag;
// private Boolean isAdmin;
private String Tel;
...........
public String toUpdate() {
System.out.println("aaaaaaaaaaaaa");//null
System.out.println(userID);
Users users=new Users();
users=bllUsers.findUsersByUsersID(userID);
this.userID=users.getUserID();
this.username=users.getName();
this.address=users.getAddress();
this.Tel=users.getTel();
this.del_tag=users.getDel_tag();
return "admin_update_users";
}.......
struts.xml:
<action name="*userManagerAction" class="com.Action.UserManagerAction" method="{1}">
<result name="show_users">/JSP/show_users.jsp</result>
<result name="admin_update_users">/JSP/admin_update_users.jsp</result>
<result name="user_update_user">/JSP/user_update_user.jsp</result>
<result name="user_index">/JSP/user_index.jsp</result>
<result name="admin_order_users">/JSP/admin_order_users.jsp</result>
<result name="input">/JSP/show_users.jsp</result>
</action>
------解决方案--------------------之前我也遇到过这类问题.记得貌似是改变了下jsp页面参数的name属性名,然后就可行了.
因为时间比较久,不能确定哈,试试看
------解决方案--------------------你有没有加输入校验嘛,校验失败,肯定input
------解决方案--------------------接收参数的时候 内部抛出异常都会进入 input的
~
------解决方案--------------------struts内置五个常量字符串