I a really sorry Mr David, i think i have not explained my question properly i would like to clear it more
here i am pasting a segment of my struts.xml
User_Login is the starting action i.e. User_Login action is created from the index.jsp. If the login is successfull then RegisterStudent.jsp is sent back to the browser.
The problem is RegisterStudent.jsp has a <s:select> tag named batchID (here the student selects his current batch) whose list must be populated using a method getBatchList() from class Batch. now given below is the tag
we can see that i am trying to populate the list using %{@administration.Batch@getBatchList()}. But my mistake is that i am trying to call the getBatchList method from Batch class using OGNL although the Batch class object does not exist on the value stack. Since the batch class is not mapped to any action so it cannot be registered in the struts.xml.
After a little thought i think i have following options
1. using the <s:bean> tag, i should modify my Batch class in this manner
i set this Batch bean to value stack using <s:bean>, and then access the bean. if the bean set to the value stack using <s:bean> is it possible for me to access its static getBatchList() method using OGNL like this
%{@administrator.Batch@getBatchList()}
secondly as you said
Make sure you're configured to allow static method access.
how do i know if i am configured to access static methods.
2. Using <s:set> tag
i can set the Batch object to the servletcontext and access the method getBatchList()
which one would be the correct way of doing this so that i can get the batch list and use it in my <s:select> tag to populate the options