Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JSP Interest »

Struts question

Jan Arenö

2003-10-20

Replies:

Hi

I'm learning Struts at the moment and just finished a very easy example.
Now when I want to extend it I don't know for sure where to put it, or
if I have missunderstood something.

I'm also new to taglibs. So i don't know exacly how they work either,
but I think I start to get a hang of it

I have inputpage with ActionForm and Action-servlets
On my input page i have 2 fields at the moments, destination and type.
These fields are validated and errormessages are returned as they should
etc etc. When validated I go to page2.jsp that writes "Hello World"

Ok. Heter is my problem.
I now want to change my destination from a inputform <html:text> to a
selectbox <html:select>. And I would like to populate it with a Vector
that I shall get from a database.

Earlier (before struts) I would create a bean conn. Then call :

conn.createDBConnection();
Vector myDest = conn.getDestinations(); conn.closeDBConnection();

Where should I now do this? Where should I store the Vector?
In the ActionForm? I thought that it only had references to the fields
that the user are supposed to submit. The Action class is not called
until ActionForm is validated, ain't it so?

How should this be done...

Thanks for any help

===========================================================================
To unsubscribe: mailto listserv@(protected)".
For digest: mailto listserv@(protected)".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com


©2008 junlu.com - Jax Systems, LLC, U.S.A.