It almost seems like you're coming at this from the wrong end, with the page calling 
the action.  It's the other way around.  I know that with php and asp development is 
page centric.  In JSP it's action centric.  The page is just a display.
Something like this is what you want I think:
/context/showTeamSelection.do  -- populate your lists, collections in request scope 
would do it. and forward
to the JSP.  This can also be the ForwardAction if you have nothing to setup for the 
page.  Then later, if you do have something change the struts-config.xml to point at 
the new action, nothing else changes.

Person clicks submit, which goes to /context/teamSelected.do -- which pulls from the 
database, populates the
request scope with appropriate data and then forwards to the page.



> -----Original Message-----
> From: Jamison Roberts [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 25, 2004 11:46 AM
> To: Struts Mailing List
> Subject: Trying to learn Struts, need help understanding 
> design process
> 
> 
> I've been a C#/.Net developer for two years.  Recently my company has
> decided to move towards Java/Struts, so I've spent the last three
> weeks familiarizing myself with Java, JDBC, Type 4 drivers, Tomcat,
> Ant, and Struts.
> 
> Struts is the last thing i've tried to tackle, and I thought I had a
> handle on it, however I don't.  I'm not sure of the best (or
> correct/standard) way of doing simple things.  I've read that if I
> ever have a *.jsp showing in the address bar outside of the entry
> page, i've done something wrong.
> 
> I'd like to give an example, and hear suggestions on the correct way
> to implement such an idea.  Simple example to follow...
> 
> Let's say I have a database that contains a two tables:  one called
> teams, and one called riders.  There is a one-to-many relationship
> between teams and riders based on a "teamid."
> 
> In the teams table, we have the following data (Primary Key 
> in parens):
> (1) USPS
> (2) T-Mobile
> (3) Cofidis
> (4) Phonak
> ...
> 
> In the riders table, we have this data (relationship in parens):
> Lance Armstrong (teamid = 1)
> George Hincapie (teamid = 1)
> Jan Ullrich (teamid = 2)
> Alexandre Vinokourov (teamid = 2)
> David Millar (teamid = 3)
> Tyler Hamilton (teamid = 4)
> ...
> 
> From the Index.jsp, there should be a link to another page that will
> have a single select box, and a submit button.  The select box needs
> to be populated with a list of teams/teamids from the database.
> 
> Upon submission of the form, all riders will be displayed in a table.
> 
> Pretty simple stuff, except I can't seem to figure out how to do it
> with Struts.  The closest i've gotten is to have a "static" Teams.jsp
> with an input-text box, which calls an Action to display the users. 
> In otherwords my Index.jsp links to Teams.jsp, instead of something
> like Teams.do (and I can't figure out how to populate a select box
> from a Vector or other sort of list).
> 
> I apologize for asking simple questions, but i'm at the end of my rope
> trying to figure out all these "new" technologies (new to my Microsoft
> dominated world).
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to