错误信息:
Struts Problem ReportStruts has detected an unhandled exception:
# Messages: No result defined for action com.sum.FirstAction and result success
Stacktraces
No result defined for action com.sum.FirstAction and result success com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:364)struts.xml:
<package name="struts2" namespace="/mystruts" extends="struts-default">
<action name="sum" class="com.sum.FirstAction">
<result name="positive">/positive.jsp</result>
<result name="nagative">/nagative.jsp</result>
<result name="SUCCESS">/index.jsp</result>
</action>
</package>web.xml:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
sum.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>输入操作数</title>
</head>
<body>
求代数和
<br/>
<s:form action="mystruts/sum.action" >
<s:textfield name="i" label=" 操作数1"/>
<s:textfield name="j" label=" 操作数2" />
<s:submit value="代数和" />
</s:form>
</body>
</html>
positive.jsp
<html>
<head>
<title>显示代数和</title>
</head>
<body>
代数和为非负整数<h1><s:property value="sum" /></h1>
</body>
</html>
nagative.jsp
<html>
<head>
<title>显示代数和</title>
</head>
<body>
代数和为负整数<h1><s:property value="sum" /></h1>
</body>
</html>
Struts Problem ReportStruts has detected an unhandled exception:
# Messages: No result defined for action com.sum.FirstAction and result success
Stacktraces
No result defined for action com.sum.FirstAction and result success com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:364)struts.xml:
<package name="struts2" namespace="/mystruts" extends="struts-default">
<action name="sum" class="com.sum.FirstAction">
<result name="positive">/positive.jsp</result>
<result name="nagative">/nagative.jsp</result>
<result name="SUCCESS">/index.jsp</result>
</action>
</package>web.xml:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
sum.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>输入操作数</title>
</head>
<body>
求代数和
<br/>
<s:form action="mystruts/sum.action" >
<s:textfield name="i" label=" 操作数1"/>
<s:textfield name="j" label=" 操作数2" />
<s:submit value="代数和" />
</s:form>
</body>
</html>
positive.jsp
<html>
<head>
<title>显示代数和</title>
</head>
<body>
代数和为非负整数<h1><s:property value="sum" /></h1>
</body>
</html>
nagative.jsp
<html>
<head>
<title>显示代数和</title>
</head>
<body>
代数和为负整数<h1><s:property value="sum" /></h1>
</body>
</html>
解决方案 »
- java已经有了GC为什么内存还是会出现问题呢?求解释
- org.apache.catalina.core.ContainerBase.
- struts2页面传值问题
- servler链接数据库问题求解答!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 80分type Exception report!
- 我有问题
- resin与IIS共存问题请教?
- 请问如何在Jbuilder中调试EJB?
- 关于EJB部署问题,简单,送分
- 80 分求o'relly的java&xml 2 Editor 下载!!!
- Jquery自动补全功能
- 如何让struts2禁用的标签在后台也可以传值
否则返回到nagative.jsp
<result name="SUCCESS">/index.jsp</result>
Action类中的常量 SUCCESS 的值为:"success"
或
<result name="success">/index.jsp</result>