action报错:No result defined for action and result error

快到碗里来ooO 2014-01-26 04:27:59
1.功能说明:
该功能是将txt乱码文件转换成txt正常文件。

2.代码如下:
a.


b.


c.


3.错误说明
当代码运行到a图(codeConversion方法)中的new Test(....)时程序报错,错误信息为:

...全文
560 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 8 楼 u012566872 的回复:
[quote=引用 5 楼 fangmingshijie 的回复:] struts单元测试不是这样测的,你要在容器中测才有哪个环境。部署到tomcat里测试。
额 什么意思。。。。[/quote]没有tomcat吗,发布到tomcat下,通过浏览器测试
ylovep 2014-01-27
  • 打赏
  • 举报
回复
a是一个action 需通过request提交测试 main测试不行 除非不继承action
fw347969680 2014-01-27
  • 打赏
  • 举报
回复
快到碗里来ooO 2014-01-27
  • 打赏
  • 举报
回复
引用 5 楼 fangmingshijie 的回复:
struts单元测试不是这样测的,你要在容器中测才有哪个环境。部署到tomcat里测试。
额 什么意思。。。。
tony4geek 2014-01-27
  • 打赏
  • 举报
回复
放到环境看看。
  • 打赏
  • 举报
回复
有有参构造函数就要把无参构造函数写上。
快到碗里来ooO 2014-01-27
  • 打赏
  • 举报
回复
引用 11 楼 fangmingshijie 的回复:
[quote=引用 8 楼 u012566872 的回复:] [quote=引用 5 楼 fangmingshijie 的回复:] struts单元测试不是这样测的,你要在容器中测才有哪个环境。部署到tomcat里测试。
额 什么意思。。。。[/quote]没有tomcat吗,发布到tomcat下,通过浏览器测试[/quote] 用tomcat还是一样
  • 打赏
  • 举报
回复
struts单元测试不是这样测的,你要在容器中测才有哪个环境。部署到tomcat里测试。
Mxreng 2014-01-26
  • 打赏
  • 举报
回复
 <action name="upTxt" class="jp.nanbu.attendance.web.action.login.LoginAction" method="upTxt">
           <result>/WEB-INF/content/test/upload.jsp</result>
         </action> 
错了
快到碗里来ooO 2014-01-26
  • 打赏
  • 举报
回复
bean.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <bean id="test" class="Test"> <property name="service" ref="service"></property> </bean> <bean id="service" class="Service"> </bean> </beans>
快到碗里来ooO 2014-01-26
  • 打赏
  • 举报
回复
struts2.xml <constant name="struts.custom.i18n.resources" value="global,attendance, sdk_config" /> <constant name="struts.ui.theme" value="simple"></constant><!-- Theme Default Simple --> <constant name="struts.configuration.xmlreload" value="false"></constant> <constant name="struts.objectFactory" value="spring"></constant> <constant name="struts.objectFactory.spring.autoWire.alwaysRespect" value="true" /> <constant name="struts.enable.DynamicMethodInvocation" value="true" /> <constant name="struts.devMode" value="false" /> <constant name="struts.multipart.saveDir" value="E:\\attendanceTemp"></constant> <constant name="struts.multipart.maxSize" value="4194304"></constant> <package name="default" namespace="/" extends="struts-default"> <default-action-ref name="index" /> <global-exception-mappings> <exception-mapping exception="java.lang.Exception" result="error" /> </global-exception-mappings> <action name="upTxt" class="jp.nanbu.attendance.web.action.login.LoginAction" method="upTxt"> <result>/WEB-INF/content/test/upload.jsp</result> </action>
coolbamboo2008 2014-01-26
  • 打赏
  • 举报
回复
楼主光给了源代码,没有给配置文件啊

67,549

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧