You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by deepannair <de...@gmail.com> on 2009/09/11 15:51:38 UTC

Struts jsp access java class

I have a properties class which has soem properties being loaded from a
remote system. In my jsp I need to access the java class. In traditional jsp
I have 
[code]
<%
/* CAPTCHA */
boolean captchaEnabledFlag=PropertiesConfig.getCaptchaEnabled();
%>
<%if (captchaEnabledFlag)  {%>
<jsp:include page="/WEB-INF/jsp/sirius/login/captcha.jsp"/>
						
<%} %>
[code]

I want to change the if statement to  struts if <s:if> . How do I access the
PropertiesConfig class directly from struts tag?
-- 
View this message in context: http://www.nabble.com/Struts-jsp-access-java-class-tp25401337p25401337.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts jsp access java class

Posted by mu...@aol.com.
 Check out <s:bean>
http://struts.apache.org/2.1.6/docs/bean.html



 


Chris

 


 

-----Original Message-----
From: deepannair <de...@gmail.com>
To: user@struts.apache.org
Sent: Fri, Sep 11, 2009 9:51 am
Subject: Struts jsp access java class











I have a properties class which has soem properties being loaded from a
remote system. In my jsp I need to access the java class. In traditional jsp
I have 
[code]
<%
/* CAPTCHA */
boolean captchaEnabledFlag=PropertiesConfig.getCaptchaEnabled();
%>
<%if (captchaEnabledFlag)  {%>
<jsp:include page="/WEB-INF/jsp/sirius/login/captcha.jsp"/>
                        
<%} %>
[code]

I want to change the if statement to  struts if <s:if> . How do I access the
PropertiesConfig class directly from struts tag?
-- 
View this message in context: http://www.nabble.com/Struts-jsp-access-java-class-tp25401337p25401337.html
Sent from the Struts - User mailing list archive at Nabble.com.


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




 


Re: Struts jsp access java class

Posted by deepannair <de...@gmail.com>.
Thanks Wes. it worked.

Wes Wannemacher wrote:
> 
> <s:if
> test="%{@fully.qualified.package.PropertiesConfig@getCaptchaEnabled()}" />
> 
> -Wes
> 
> On Fri, Sep 11, 2009 at 9:51 AM, deepannair <de...@gmail.com> wrote:
>>
>> I have a properties class which has soem properties being loaded from a
>> remote system. In my jsp I need to access the java class. In traditional
>> jsp
>> I have
>> [code]
>> <%
>> /* CAPTCHA */
>> boolean captchaEnabledFlag=PropertiesConfig.getCaptchaEnabled();
>> %>
>> <%if (captchaEnabledFlag)  {%>
>> <jsp:include page="/WEB-INF/jsp/sirius/login/captcha.jsp"/>
>>
>> <%} %>
>> [code]
>>
>> I want to change the if statement to  struts if <s:if> . How do I access
>> the
>> PropertiesConfig class directly from struts tag?
>> --
>> View this message in context:
>> http://www.nabble.com/Struts-jsp-access-java-class-tp25401337p25401337.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> 
> -- 
> Wes Wannemacher
> 
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Struts-jsp-access-java-class-tp25401337p25408322.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts jsp access java class

Posted by Wes Wannemacher <we...@wantii.com>.
<s:if test="%{@fully.qualified.package.PropertiesConfig@getCaptchaEnabled()}" />

-Wes

On Fri, Sep 11, 2009 at 9:51 AM, deepannair <de...@gmail.com> wrote:
>
> I have a properties class which has soem properties being loaded from a
> remote system. In my jsp I need to access the java class. In traditional jsp
> I have
> [code]
> <%
> /* CAPTCHA */
> boolean captchaEnabledFlag=PropertiesConfig.getCaptchaEnabled();
> %>
> <%if (captchaEnabledFlag)  {%>
> <jsp:include page="/WEB-INF/jsp/sirius/login/captcha.jsp"/>
>
> <%} %>
> [code]
>
> I want to change the if statement to  struts if <s:if> . How do I access the
> PropertiesConfig class directly from struts tag?
> --
> View this message in context: http://www.nabble.com/Struts-jsp-access-java-class-tp25401337p25401337.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Struts jsp access java class

Posted by Paweł Wielgus <po...@gmail.com>.
Hi,
something like < s:if
test="@com.something.PropertiesConfig@getCaptchaEnabled()"/>
it was on this list a while ago.

Best greetings,
Paweł Wielgus.


2009/9/11 deepannair <de...@gmail.com>:
>
> I have a properties class which has soem properties being loaded from a
> remote system. In my jsp I need to access the java class. In traditional jsp
> I have
> [code]
> <%
> /* CAPTCHA */
> boolean captchaEnabledFlag=PropertiesConfig.getCaptchaEnabled();
> %>
> <%if (captchaEnabledFlag)  {%>
> <jsp:include page="/WEB-INF/jsp/sirius/login/captcha.jsp"/>
>
> <%} %>
> [code]
>
> I want to change the if statement to  struts if <s:if> . How do I access the
> PropertiesConfig class directly from struts tag?
> --
> View this message in context: http://www.nabble.com/Struts-jsp-access-java-class-tp25401337p25401337.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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