Struts question

Discussions

General J2EE: Struts question

  1. Struts question (1 messages)

    I am new to struts and i am trying to build a web application.
    When a user wishes to enter my homepage i am trying to populate a few drop down boxs by redirecting to a "setup" action performing the queries, putting the collections into a httpsession and then going back to my homepage. Now that the session is created i will be able to populate my drop down boxs.
    This seems and is very combersome, any suggestions on improving.

    Threaded Messages (1)

  2. Struts question[ Go to top ]

    Do you mean that you want to populate something into the
    drop down list once your homepage is invoked and you don't want to use httpSession to store the collection right?

    Have you ever tried to use a java bean to store your collection instead of using httpSession?

    The following is the step:

    (1) Set up a java class as a bean and simply contains setter and getter methods which are used for storing the property of your bean.

    (2) In the server side (servlet) , make your business logic there and create your queried collections and set the collections of your resultset into the java bean that you created.

    (3) In your jsp, simply get the property (collection) of your bean and load it into your drop down list.