Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2873

action named "logout" fails.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.2
    • 2.1.3
    • Core Actions
    • None
    • Windows Vista x64, JDK 1.6.0_07, tomcat 6.0.18

    Description

      I'm having an issue with naming one of my actions logout. I have a action named logout and another one called out. They both have the exact same class and results. However when I try to browse to logout.action I get a stack trace and when I browse to out.action everything works as expected. I tested this issue using spring and guice both with the same issue.

      see http://www.nabble.com/Something-special-about-action-named-%22logout%22-td20513297.html for more information.

      Bellow is my configuration:

      public class LogoutAction implements ServletRequestAware, Serializable {
      private static final long serialVersionUID = -5615396306298191276L;
      private HttpServletRequest request;

      public void setServletRequest(final HttpServletRequest request)

      { this.request = request; }

      public String execute() throws Exception

      { request.getSession().invalidate(); return Action.SUCCESS; }

      }

      struts.xml

      <?xml version="1.0" encoding="UTF-8" ?>
      <!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
      "http://struts.apache.org/dtds/struts-2.0.dtd">

      <struts>
      <!-- Constant Settings -->
      <constant name="struts.enable.DynamicMethodInvocation" value="false" />
      <constant name="struts.codebehind.pathPrefix" value="/WEB-INF/pages/" />
      <constant name="struts.url.includeParams" value="none" />
      <constant name="struts.custom.i18n.resources" value="global-messages" />
      <constant name="struts.ui.theme" value="atalatal" />
      <constant name="struts.objectFactory" value="guice" />
      <constant name="guice.module" value="kiff.util.LoaderModule" />

      <!-- Development Settings "Change these when going to production" -->
      <constant name="struts.devMode" value="true" />
      <constant name="struts.i18n.reload" value="true" />
      <constant name="struts.configuration.xml.reload" value="true" />

      <package name="boardDefault" extends="struts-default">
      <interceptors>
      <interceptor name="login" class="kiff.interceptor.LoginInterceptor" />

      <interceptor-stack name="defaultSecuredStack">
      <interceptor-ref name="timer" />
      <interceptor-ref name="exception" />
      <interceptor-ref name="alias" />
      <interceptor-ref name="servletConfig" />
      <interceptor-ref name="login" />
      <interceptor-ref name="params" />
      <interceptor-ref name="prepare" />
      <interceptor-ref name="i18n" />
      <interceptor-ref name="debugging" /> <!-- Remove debug and profiling before prod. -->
      <interceptor-ref name="profiling" />
      <interceptor-ref name="scopedModelDriven" />
      <interceptor-ref name="modelDriven" />
      <interceptor-ref name="fileUpload" />
      <interceptor-ref name="checkbox" />
      <interceptor-ref name="staticParams" />
      <interceptor-ref name="actionMappingParams" />
      <interceptor-ref name="params" />
      <interceptor-ref name="conversionError" />
      <interceptor-ref name="validation">

      input,back,cancel,browse
      </interceptor-ref>
      <interceptor-ref name="workflow">
      input,back,cancel,browse
      </interceptor-ref>
      </interceptor-stack>

      <interceptor-stack name="defaultInsecureStack">
      <interceptor-ref name="timer" />
      <interceptor-ref name="exception" />
      <interceptor-ref name="alias" />
      <interceptor-ref name="servletConfig" />
      <interceptor-ref name="params" />
      <interceptor-ref name="prepare" />
      <interceptor-ref name="i18n" />
      <interceptor-ref name="debugging" /> <!-- Remove debug and profiling before prod. -->
      <interceptor-ref name="profiling" />
      <interceptor-ref name="scopedModelDriven" />
      <interceptor-ref name="modelDriven" />
      <interceptor-ref name="fileUpload" />
      <interceptor-ref name="checkbox" />
      <interceptor-ref name="staticParams" />
      <interceptor-ref name="actionMappingParams" />
      <interceptor-ref name="params">
      dojo\..*
      </interceptor-ref>
      <interceptor-ref name="conversionError" />
      <interceptor-ref name="validation">
      input,back,cancel,browse
      </interceptor-ref>
      <interceptor-ref name="workflow">
      input,back,cancel,browse
      </interceptor-ref>

      </interceptor-stack>
      </interceptors>

      <default-interceptor-ref name="defaultInsecureStack" />

      <default-action-ref name="index" />

      <global-results>
      <result name="error">/WEB-INF/pages/error/default.jsp
      </result>
      <result name="login">/WEB-INF/pages/login.jsp
      </result>
      </global-results>

      <global-exception-mappings>
      <exception-mapping result="java.lang.Exception"
      exception="error" />
      </global-exception-mappings>

      <action name="index">
      <result name="input">/WEB-INF/pages/index.jsp
      </result>
      <result name="success">/WEB-INF/pages/index.jsp
      </result>
      </action>
      <action name="login">
      <interceptor-ref name="defaultSecuredStack" />
      <result name="success" type="redirectAction">
      index
      /
      </result>
      </action>
      <action name="out" class="kiff.action.LogoutAction">
      <result name="success" type="redirectAction">
      index
      /
      </result>
      </action>
      <action name="logout" class="kiff.action.LogoutAction">
      <result name="success" type="redirectAction">
      index
      /
      </result>
      </action>
      </package>

      <!-- Mapping Files -->
      <!-- <include file="struts-mappings.xml"/> -->

      </struts>

      Here is my stack trace.

      No result defined for action kiff.action.LogoutAction and result success

      com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:357)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259)
      com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:141)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:248)
      org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:124)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:104)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:84)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:208)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:88)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:130)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:137)
      com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:130)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
      com.google.inject.struts2.GuiceObjectFactory$ProvidedInterceptor.intercept(GuiceObjectFactory.java:224)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230)
      com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229)
      com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456)
      com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227)
      org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
      org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:477)
      org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:467)
      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:233)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      java.lang.Thread.run(Thread.java:619)

      Attachments

        Activity

          People

            Unassigned Unassigned
            adamruggles Adam Ruggles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: