struts2 的错误!

Struts Problem Report

Struts has detected an unhandled exception:

Messages:
  • There is no Action mapped for namespace /projectInfo and action name query.

Stacktraces

There is no Action
mapped for namespace /projectInfo and action name query. - [unknown
location]

    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    java.lang.Thread.run(Unknown Source)


You are seeing this page because development mode is enabled. Development
mode, or devMode, enables extra debugging behaviors and reports to assist
developers. To disable this mode, set:

  struts.devMode=false

in your WEB-INF/classes/struts.properties file.

用了好久的ssh+Tomcat,今天突然出现这个问题,答案各种扯淡,各种翻译....说关了开发模式之类的

最后仔细看了下果然是There is no Action mapped for namespace /projectInfo and action name query这个原因:action中方法名和配置文件中的方法名写错了,真是粗心,切记!

看来以后要善用ctrl+c/v 保证不会错

时间: 2024-10-11 19:42:05

struts2 的错误!的相关文章

struts2中错误处理

定义一个 package,然后其他package都继承 这个package struts-global 就 有了这个错误处理功能了 然后再自己写个类 struts.xml 1 <constant name="struts.devMode" value="true" /> 2 <constant name="struts.enable.DynamicMethodInvocation" value="false"

Struts2验证错误信息的两个经典方法-addFieldError&amp;addActionError

这两个方法都是ActionSupport类实现的方法,应用中我们都会继承ActionSupport类,在ActionSupport类中实现了一个hasErrors()方法,该方法会判断是否存在这两种级别(Action级和Field级)的error,所以当我们需要报错时,我们可以方便的应用:如 try { XXX } catch (Exception e) { Super.addFieldError(“username”, “输入有误”); 或者: Super.addActionError(“输入

Struts2输入错误处理

1.Action类继承ActionSupport父类,将result的name属性设置为<result name="input">/inputError.jsp</result> Action类中无需做数据校验,struts2会自动处理输入类型不匹配的错误(如int类型输入的却是String),跳转到inputError.jsp. 2.如果要进一步地校验数据(如用户名是否为空),并向前台返回错误信息 ①可以在jsp页面需要显示错误的地方用<s:fielde

Struts2注解错误之There is no Action mapped for namespace /

我用最新版本的Struts2.3.4做注解操作的时候,一直出现这个问题.花了近两个小时才解决,错误原因让人啼笑皆非-- [plain] view plaincopy There is no Action mapped for namespace [/] and action name [test] associated with context path [/test]. - [unknown location] at com.opensymphony.xwork2.DefaultActionP

struts2中错误There is no Action mapped for namespace [/] and action name [] associated with context path

1 There is no Action mapped for namespace [/] and action name [] associated with context path [/Struts2_0300_Action2]. - [unknown location] 2 at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) 3 at org.apache.struts2.i

Struts2类型转换错误消息的显示

struts2类型转换时出错,比如Action中需要int类型数据,但却传入了不能转换为int类型的数据,比如abcd,不能转换为int form表单页: 1 <s:form action="conversionAction" namespace="/"> 2 Age:<s:textfield name="age"></s:textfield> 3 <br/> 4 <s:submit>&

struts2实验错误笔记

(1)struts.xml配置文件中 result的name属性要跟业务逻辑处理类(Action类)中的函数返回的字符串能匹配得上 (2)修改过struts.xml以及Action类后需要重新再服务器中更新web项目(redeploy) (3)相同业务逻辑对应的jsp页面最好分文件夹存放,不然显得jsp文件很多很杂 (4)一个Action处理多个业务逻辑 代码: <action name="loginAction_*" class="com.loginAction&qu

错误There is no Action mapped for namespace / and action name—Struts2

Struts2出现错误,总是提示"There is no Action mapped for namespace / and action name"的错误. 错误代码如下: 09:36:13,515 WARN [Dispatcher] Could not find action or result There is no Action mapped for namespace [/] and action name [css] associated with context path

关于Struts2中的错误:例如There is no Action mapped for namespace / and action name product-input.

            在配置struts.xml 文件时,会出现    There is no Action mapped for namespace / and action name ....    意思是没有product-input的映射文件或者是命名空间       出现这样的错误的原因后:     做如下检查:           1: 把struts.xml中的namespace="/"改成namespace=""或者去除,使用默认的命名空间. 2: