Hi,

yes it is possible., just implement a setter and getter method for the parameter you have in the struts.xml file. and it will be available to you in the intercept method.

eg:-

// in the intercept class..

private String httpPort;

   public String getHttpPort() {
       return httpPort;
   }

   public void setHttpPort(String httpPort) {
       this.httpPort = httpPort;
   }

// in the struts.xml

       <interceptor-stack name="SecureStack">
       <interceptor-ref name="secure">
           <param name="httpPort">80</param>
        </interceptor-ref>

the value 80 will be inject to the variable httpPort in the interceptor class.,

Thanks,
Nuwan.
(http://struts2-ssl-plugin.googlecode.com/)





xianwinwin wrote:
Hi all,

I wonder if it is possible to pass a parameter with a value to an
interceptor.

Example:

I have the following interceptor:

 <interceptor name="authentication"
class="com.struts.security.AuthenticationInterceptor"/>

(parameterGivenInXmlFile==4)


the implementation is:

public String intercept (ActionInvocation invocation) throws Exception {
             ...
             if (parameterGivenInXmlFile ==3)
                //do something
              ....
        }       


thanks for any input



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to