Having trouble getting interceptors to work. I think it's because my
namespace and packages aren't aligned correctly. Using Convention
plugin and when I start the app I get an error that ref-name can't be
found.
My interceptor is defined in struts.xml
<package name="default" extends="struts-default">
<interceptors>
<interceptor name="login"
class="com.fiserv.sourceone.sigmm.interceptor.AuthorizationInterceptor" />
<interceptor-stack name="defaultLoginStack">
<interceptor-ref name="servletConfig" />
<interceptor-ref name="params" />
<interceptor-ref name="login" /> <!-- Custom
Login Interceptor -->
<interceptor-ref name="prepare" />
<interceptor-ref name="chain" />
<interceptor-ref name="fileUpload" />
<interceptor-ref name="staticParams" />
<interceptor-ref name="params" />
<interceptor-ref name="conversionError" />
<interceptor-ref name="validation" />
<interceptor-ref name="workflow" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="defaultLoginStack" />
<global-results>
<result
name="custom-error">/WEB-INF/content/custom-error.jsp</result>
</global-results>
</package>
Action is
package com.fiserv.sourceone.sigmm.actions.mobilemoney;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.InterceptorRefs;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
@Namespace("")
@InterceptorRefs({
@InterceptorRef("login")
})
public class MaintainParameters extends ActionSupport {
private static final long serialVersionUID = -161735293208543752L;
@Override
@Action(value = "maintain-parameters", results = {
@Result(name = SUCCESS, location =
"auth/maintain-parameters-success.jsp" ) } )
public String execute()
{
return SUCCESS;
}
}
--
Greg Akins
http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]