struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravi_eze <ravichand...@ivycomptech.com>
Subject RE: Simplified usage of:@com.company.Constants.StaticCOnstants
Date Thu, 01 May 2008 09:04:33 GMT

hi,

even this doesnt seem to be working.

is it possible to load the constant class to the context and then display it
form there.? or in that case it expects a setters and getters... or some way
of getting this done.. the code is very bad to read 'cos every time i am
using @com.company.... 

any help???

cheers,
ravi 



Wes Wannemacher wrote:
> 
> Did you try to import your Constants class?
> 
> <%@ page import="com.company.Constants" %>
> 
> <s:property value="@Constants@STATIC_CONSTANTS1" />
> 
> As far as say C.staticconstant1, all I can really say is that the @
> symbol is how you access static vars/methods in OGNL. 
> 
> Another choice might be to use regular ol' EL expressions. 
> 
> -Wes
> 
> On Tue, 2008-04-29 at 21:45 -0700, ravi_eze wrote:
>> hi,
>> 
>> 
>> Does the following work - 
>> 
>> <s:set name="C" value="@com.company.Constants@STATIC_CONSTANTS1" />
>> <s:property value="#C" />
>> 
>> Yes it does. But my requirement is more like i would import the class
>> into
>> some bean/ variable (C) so that i can say C.staticconstant1 etc... but by
>> the approach mentioned above, i should repeat the @com.company.Constant
>> string always which reduces the readability. Hope this adds some clarity.
>> Something similar to import.... and then say Constant....
>> 
>> Also, is com.company.Constants.STATIC_CONSTANTS1 a String?
>> 
>> Yes its a string.  i would be greatful to any further help.
>> 
>> 
>> cheers,
>> ravi 
> 
> 
> ---------------------------------------------------------------------
> 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/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16993179.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


Mime
View raw message