SSH整合报错:No result defined for action actions.RegisterAction and result input 20

我的struts.xml配置文件:<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheS... 我的struts.xml配置文件:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.i18n.encoding" value="utf-8"></constant>
<package name="struts2" extends="struts-default">
<!-- 验证码action配置 -->
<action name="imageCode" class="imageCode">
<result name="success" type="stream">
<param name="contentType">image/jpeg</param>
<param name="inputName">inputStream</param>
</result>
</action>
<!-- 登录action配置 -->
<action name="Login" class="login">
<result name="success">/index.jsp</result>
<result name="input">/jsp/login.jsp</result>
<result name="error">/jsp/error.jsp</result>
</action>
<!-- 配置注册action -->
<action name="register" class="register">
<result name="success">/jsp/register_varify.jsp</result>
<result name="input">/jsp/register.jsp</result>
</action>
</package>
</struts>

RegisterAction.java:
public String execute() throws Exception {
int tmp = -1;
ActionContext ac = ActionContext.getContext();
Map<String, Object> map = ac.getSession();
map.put("username", getUserName());
map.put("email", getEmail());
if (getUserType() == 1) {
tmp = this.userService.addUser(userName, password, email, false,
true);
}
if (getUserType() == 2) {
tmp = this.userService.addUser(userName, password, email, false,
false);
}
if (1== tmp) {
return SUCCESS;
} else {
this.clearActionErrors();
this.addActionError("注册失败,请重试!");
return INPUT;
}
}
log4j中的信息:
2013-04-27 19:19:15,316 - org.apache.struts2.convention.ConventionUnknownHandler -20213 [http-bio-8080-exec-4] DEBUG - Trying to locate the correct result for the FQ action [/register] with an file extension of [jspx] in the directory [/WEB-INF/content/] and a result code of [input]
2013-04-27 19:19:15,316 - org.apache.struts2.convention.ConventionUnknownHandler -20213 [http-bio-8080-exec-4] DEBUG - Checking ServletContext for [/WEB-INF/content/register-input.jspx]
2013-04-27 19:19:15,316 - org.apache.struts2.convention.ConventionUnknownHandler -20213 [http-bio-8080-exec-4] DEBUG - Checking ClasLoader for /WEB-INF/content/register-input.jspx
2013-04-27 19:19:15,316 - org.apache.struts2.convention.ConventionUnknownHandler -20213 [http-bio-8080-exec-4] DEBUG - Checking ServletContext for [/WEB-INF/content/register.jspx]
2013-04-27 19:19:15,317 - org.apache.struts2.convention.ConventionUnknownHandler -20214 [http-bio-8080-exec-4] DEBUG - Checking ClasLoader for /WEB-INF/content/register.jspx
2013-04-27 19:19:15,317 - org.apache.struts2.convention.ConventionUnknownHandler -20214 [http-bio-8080-exec-4] DEBUG - Checking ServletContext for [/WEB-INF/content/input.jspx]

我很不理解,为什么Struts会在/WEB-INF/content/路径下查找,我明明有配置success和input,但是为什么找不到呢?
还有我在JSP页面提交的数据已经可以插入数据库
展开
 我来答
ligenshu1992
2013-04-28 · TA获得超过302个赞
知道小有建树答主
回答量:834
采纳率:0%
帮助的人:382万
展开全部
在package里加个 namespace="/" 试试
追问
试了,报同样的错,不过我解决了,把“register”改一下名就好用了,这让我非常无语,不知道为什么,之前login也是-------
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式