struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: [S2] Hooking up custom interceptors
Date Sun, 23 Sep 2007 01:26:34 GMT
I haven't tried this, but does the ParentPackage
annotation work? The JavaDocs (for now :) just say:

> Allows an action class to specify an xwork 
> package to inherit

d.

--- Eric D Nielsen <nielsene@MIT.EDU> wrote:

> I've written a pair of interceptors to implement my
> application's authentication
> and authorization requirements.  I'm now trying to
> add them into my
> application's default stack, but it doesn't seem to
> be working.  Looking around
> with config-browser I can see that the interceptors
> are not being listed.
> 
> I'm using most of the "Zero Configuration"
> techniques: actionPackages and the
> Result annotations.
> 
> I think the problem is that the auto-detected
> actions aren't being assigned to
> the package with the configured custom interceptor
> stack.
> 
> I've tried several variations on naming my XWork
> package based on the wording in
> the Zero Configuration page under "Action and
> Package name", but that seems to
> apply to the namespace of the autodetected action
> not their package.
> 
> Here's a current version of the struts.xml package
> definition.
> -----------------
>   <package name="cib-default"
> extends="struts-default">
>     <interceptors>
> 	  <interceptor name="authentication"
>
class="com.ballroomregistrar.compinabox.web.interceptors.AuthenticationInterceptor"
> />
> 	  <interceptor name="authorization"
>
class="com.ballroomregistrar.compinabox.web.interceptors.AuthorizationInterceptor"
> />
>  	 </interceptors>
>      <interceptor-stack name="cibStack">
>        <interceptor-ref name="authentication" />
>        <interceptor-ref name="authorization" />
>        <interceptor-ref name="defaultStak" />
>      </interceptor-stack>
>      <default-interceptor-ref name="cibStack" />
>    </package>
> ----------------
> 
> My actions live in:
> com.ballroomregistrar.compinabox.web.action
> 
> Here is a simple/sample action
> --------------
> package com.ballroomregistrar.compinabox.web.action;
> 
> import org.apache.struts2.config.Result;
> 
> import com.opensymphony.xwork2.Action;
> 
> @Result(name="success",
> value="WEB-INF/jsp/createcomp.jsp")
> public class CreateComp implements Action {
> 
> 	public String execute() {
> 		return "success";
> 	}
> 
> }
> ------------------
> 
> What am I missing?  How do I link the autodetected
> actions to a package?  Or how
> do I set my custome package as the default package
> for all actions, etc?
> 
> Thank you.
> Eric
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message