hi,
i think whats not possible is
...
< param name="...">${actionclass'sVariable} </..>
...
i.e. getting the variable form action calss and accessing it or evaluating
an expression as the param value.
any ideas how this is possible
cheers,
ravi
nuwan chandrasoma-2 wrote:
>
> 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">
> 80
> </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]
>
>
>
--
View this message in context:
http://www.nabble.com/is-it-possible-to-pass-a-parameter--to-an-interceptor-from-the-xml-file--tp15074977p15080834.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]