Struts Action Class

Is there any way to call an action from a jsp to fill a collection.

I have an Struts Action Class that retrieves records from DB (using data-source) and set the results into an ArrayList. Then the action class sets the list as request.setAttribute(list);

I want to use this list to populate a drop-down in my JSP as soon as the user opens the JSP.

In other words there is no explicit call to My Action Class.

How do i do that.

Thanx.

Message was edited by:

arunkumar504

[519 byte] By [arunkumar504a] at [2007-10-3 2:29:15]
# 1

If you want the action to run, then you have to enter the page through the struts action - ie displayRecords.do rather than displayRecords.jsp.

That is one reason that many developers hide the JSPs under the WEB-INF directory - that way they can't be directly referenced, only forwarded to from the struts controller.

evnafetsa at 2007-7-14 19:28:15 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks for taking time.
arunkumar504a at 2007-7-14 19:28:15 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...