structs中从jsp页面为啥不能跳转到action中(请哪位大侠教教小弟,急!!)
jsp页面:
<%@ page language="java" contentType="text/html; charset=GB2312"%>
<%@ include file="../common/taglibs.jsp" %>
<html:html>
<head>
<title>新建用户</title>
</head>
<body>
<html:form action="newuser.do">
<table width="60%" border="1" align="center">
<tr>
<td width="30%" align="left">用户名:</td>
<td width="70%"><input name="username" type="text" ></td>
</tr>
<tr>
<td align="left">密码:</td>
<td><input name="password" type="password" ></td>
</tr>
<tr>
<td align="left">确认密码:</td>
<td><input name="password2" type="password"></td>
</tr>
<tr>
<td align="left">性别:</td>
<td>
<input name="sex" type="radio" value="1">男
<input name="sex" type="radio" value="0" checked>女
</td>
</tr>
<tr>
<td align="left">Email:</td>
<td><input name="email" type="text"></td>
</tr>
<tr>
<td align="left">通信地址:</td>
<td><input name="address" type="text"></td>
</tr>
<tr>
<td align="left">用户等级:</td>
<td>
<input name="grade" type="radio" value="1">管理员
<input name="grade" type="radio" value="0" checked>普通用户
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="Submit" value="提交">
</td>
</tr>
</table>
</html:form>
</body>
</html:html>
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="userInfoForm" type="nm.admin.form.UserInfoForm" />
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="ToUserList" path="/NoticeManager/admin/userlist.jsp" />
</global-forwards>
<action-mappings >
<action path="/newuser" type="nm.admin.action.NewUserAction" name="userInfoForm" scope="request" input="/NoticeManager/common/messagepage.jsp" />
</action-mappings>
<message-resources parameter="nm.ApplicationResources_zh" />
</struts-config>
在跳转到NewUserAction中我输入 System.out.println("aaaaaaaaaaa");打不出来
地址栏:http://localhost:8082/ch12_SSH/newuser.do
页面不显示任何内容。这到底是为什么呢??请哪位大侠教教小弟,实在想不出来。谢谢
<%@ page language="java" contentType="text/html; charset=GB2312"%>
<%@ include file="../common/taglibs.jsp" %>
<html:html>
<head>
<title>新建用户</title>
</head>
<body>
<html:form action="newuser.do">
<table width="60%" border="1" align="center">
<tr>
<td width="30%" align="left">用户名:</td>
<td width="70%"><input name="username" type="text" ></td>
</tr>
<tr>
<td align="left">密码:</td>
<td><input name="password" type="password" ></td>
</tr>
<tr>
<td align="left">确认密码:</td>
<td><input name="password2" type="password"></td>
</tr>
<tr>
<td align="left">性别:</td>
<td>
<input name="sex" type="radio" value="1">男
<input name="sex" type="radio" value="0" checked>女
</td>
</tr>
<tr>
<td align="left">Email:</td>
<td><input name="email" type="text"></td>
</tr>
<tr>
<td align="left">通信地址:</td>
<td><input name="address" type="text"></td>
</tr>
<tr>
<td align="left">用户等级:</td>
<td>
<input name="grade" type="radio" value="1">管理员
<input name="grade" type="radio" value="0" checked>普通用户
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="Submit" value="提交">
</td>
</tr>
</table>
</html:form>
</body>
</html:html>
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="userInfoForm" type="nm.admin.form.UserInfoForm" />
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="ToUserList" path="/NoticeManager/admin/userlist.jsp" />
</global-forwards>
<action-mappings >
<action path="/newuser" type="nm.admin.action.NewUserAction" name="userInfoForm" scope="request" input="/NoticeManager/common/messagepage.jsp" />
</action-mappings>
<message-resources parameter="nm.ApplicationResources_zh" />
</struts-config>
在跳转到NewUserAction中我输入 System.out.println("aaaaaaaaaaa");打不出来
地址栏:http://localhost:8082/ch12_SSH/newuser.do
页面不显示任何内容。这到底是为什么呢??请哪位大侠教教小弟,实在想不出来。谢谢
...全文
相关推荐
BBS jsp servlet structs
BBS jsp servlet structs 用到的服务器里面有下载地,很漂亮的 页面 按照安装说明安装一下就可以了
struct2传递list集合到页面
1,在首页加载便调用action把信息显示到首页 2,把首页的表单元素通过action获取并以list传到下一个页面 3,页面利用jstl显示集合元素
structs2 实例
structs2 实例 structs2 实例 eclipse
Structs2 vs Servlet
Structs和Servlet跳转对比,简答的入门程序,加强对MVC的理解。
structs框架实现登录(JSP)
structs框架分离前后台实现基本的登录界面。适合初学JSP者参考。


Web 开发
