org.apache.jasper.JasperException:找不到Struts调度程序

时间:2011-12-26 16:18:56

标签: struts2

struts.xml中

    <action name="tohome" class="action.ToSmsAction" method="execute">
        <result name="success">/pages/home.jsp</result>
        <result name="login">/pages/login.jsp</result>
    </action>        

TosmsAction.java

  public class ToSmsAction extends ActionSupport {

  private String time;

  public String execute() {

         System.out.println(" time is " + getTime());

          return SUCCESS;
      } else {
             return LOGIN;
      }
  }
 public String getTime() {
      return time;
 }

 public void setTime(String time) {
     this.time = time;
 }

}

如果我不包括class="action.ToSmsAction"那么它运作良好

但是当including class="action.ToSmsAction"显示以下错误时

HTTP Status 500 -

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling
this request.
exception

org.apache.jasper.JasperException: The Struts dispatcher cannot be found.  This is 
usually caused by using Struts tags without the associated filter. Struts tags are only 
usable when the request has passed through its servlet filter, which initializes the 
Struts dispatcher needed for this tag. - [unknown location]
root cause

The Struts dispatcher cannot be found.  This is usually caused by using Struts tags 
without the associated filter. Struts tags are only usable when the request has passed 
through its servlet filter, which initializes the Struts dispatcher needed for this tag. - 
[unknown location]
note The full stack traces of the exception and its root causes are available in the 
GlassFish Server Open Source Edition 3.1.1 logs.

0 个答案:

没有答案