You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Saikat Podder <sa...@gmail.com> on 2009/02/04 18:44:37 UTC

public static field of a public inner class can't be accessed as @FQClassName@Field in struts 2

I found in the OGNL  Language reference that the a static field of a class
has to be referenced using the syntax @FQClassName@field where FQClassName
is the fully qualified name of the target class. It is working for any
normal class. But I failed to access the fields of an inner class using the
same syntax.



package myapp.test;

public class Constants
{
   //fields & methods here.....
   public class Plan
  {
      public static final String FREE = "free";
      //other things..
  }
}


  

  Trying to access it as

  


&lt;s:property value=&quot;@myapp.test.Constants.Plan@FREE&quot; /&gt;

  

  Is not working!! I also have tried it after making Plan as public static,
still dosnt work

so my question is, is there any way (at all) to access the static field of
the inner class?

Thanks in advance,

  Saikat

-- 
View this message in context: http://www.nabble.com/public-static-field-of-a-public-inner-class-can%27t-be-accessed-as-%40FQClassName%40Field-in-struts-2-tp21835614p21835614.html
Sent from the Struts - User mailing list archive at Nabble.com.