Here is one option:
When you retrieve the data from the database in Test2Action, place it in the
session. Then the next time Test2Action is
executed, check for its existence in the session. If it exists, use it,
otherwise, refresh from the database.
When Test1Action is executed, remove the session attribute storing the list of
strings. This way, when Test2Action is executed, it will be forced to refresh
from the database.
HTH,
Pete
Michael Skariah wrote:
> Hello all,
> Please have the patience to go thru'..
>
> Assume that I have 2 pages... test1.jsp and test2.jsp. A link present in
> test1.jsp opens up a child window with test2.jsp. I also have the following
> in the config file:
>
> <action path="/test2"
> type="com.nri.xenos.uibase.ui.Test2Action"
> name="test1ActionForm"
> scope="request"
> validate="false"
> input="/test1.jsp">
> <forward name="failure" path="/test1.jsp"/>
> <forward name="success" path="/test2.jsp"/>
> </action>
>
> In Test2Action.java I am populating a List<String> by using values from the
> database which is to be used in test2.jsp
> .
> But, here is my problem.
> Every time I click on the link to open test2.jsp, a fetch from the database
> is made.
> If the test2.jsp link is more than once, fetch should not be made every time
> I click on the link, but rather the first time only, and also when the
> test1.jsp is reopened or refreshed.
>
> I hope you all understand my question.
>
> Thanks a lot,
> -Michael.