IntelliJ Java IDE
The moose likes Struts and the fly likes action mapping ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "action mapping ??" Watch "action mapping ??" New topic
Author

action mapping ??

Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi
I'm using Struts 1.1 and i'm new in this framework.

How can I solve this example :

I have a jsp site for a StudentForm to insert a new student in a DB. (it's ok). In the action Tag I have <forward name="default" path="/ListStudents.jsp" />.

In the ListStudents.jsp I need the Collection of students. How is the best way, to get the Collection ???
In the Action, I insert the student? A new actrion (How have I to do the mapping)?

I would like to call the site "ListStudents.jsp" from a Link, so I need the Collection too. How can I get a Collection (EJB) at the beginning of the site (I can, but I would not use JavaScriptlets).

I hope for some information for a struts beginner.

Georg


SCJP, SCWCD, SCBCD<br /> <br />Vienna, Austria
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4695

The Action that is a part of that ActionMapping should make the call to the db (or the business delegate) and place the collection into your ActionForm.

Struts html tags make it very easy to reference things from your ActionForm. If you do not do it this way, you might end up having to put unnecessary scriptlets in your jsp.


A good workman is known by his tools.
Georg Joo
Ranch Hand

Joined: Feb 24, 2004
Posts: 49
Hi

I do not understand, who does it work.

My first jsp works good. I have a form with name,... of student, submit --> ActionForm --> Action --> update with EJB.

But how can I show a list of students ? I need --> Action (to get the list) --> jsp (?) .

Or how can I use the ActionForm with html tags ??

Can you give me a little help .

Georg
 
 
subject: action mapping ??
 
Threads others viewed
Struts 2 Textfield showing comma delimited values?
Ajax and Struts
Need a sample query
how do struts interact with other apps
Design question (struts/mvc)
developer file tools