You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Thomson, Stewart" <st...@petrotechnics.com> on 2007/05/04 13:46:14 UTC

[S2] Using method parameters in the s:if tag

Hello

 

Is it possible while using the <s:if tag to call a method in your action
while passing in a parameter?

 

In the action

 

public boolean getSomeMethod(String someParam){

 

         .... Do some work based on someParam

         return answer;       

}

 

In the jsp 

 

<s:if test="getSomeMethod('some string')">

   some html

</s:if>

 

 

Thanks


Re: [S2] Using method parameters in the s:if tag

Posted by Laurie Harper <la...@holoweb.net>.
Thomson, Stewart wrote:
> Hello
> 
> Is it possible while using the <s:if tag to call a method in your action
> while passing in a parameter?
> 
> In the action
> 
> public boolean getSomeMethod(String someParam){
>          .... Do some work based on someParam
>          return answer;       
> }
> 
> In the jsp 
> 
> <s:if test="getSomeMethod('some string')">
>    some html
> </s:if>

Yes, that should work. The obvious thing to do with a simple question 
like this is to just try it.

L.


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