This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 1.3 Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1.3 Database" Watch "Struts 1.3 Database" New topic
Author

Struts 1.3 Database

Lorenzo Tagliaferro
Greenhorn

Joined: Jun 15, 2009
Posts: 20

Hi!

I'm learning Struts Framework 1.3.

I have to create an JSP page with the ReasulSet of the query on the Database, by a Collection or an ArrayList.

Someone can explain me, how to create a JSP with this characteristic, using Struts 1.3?!

Thanks in advance!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What in particular is causing you problems?
Lorenzo Tagliaferro
Greenhorn

Joined: Jun 15, 2009
Posts: 20

I have not understood how to create by MVC model 2 , that INSERT an SQL rows, QUERY database, then show on an JSP page.
I have created an ActionForm and an Action with Collection of ActionForm.
But, where have I insert the code to connect the database (MySql Driver, Statement, ect) usig Struts?!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You should never have a collection of ActionForms.

Database logic is best handled in a service class, but could also be put directly in the action (makes testing more difficult).
Lorenzo Tagliaferro
Greenhorn

Joined: Jun 15, 2009
Posts: 20

Great!!

Can you counsel me, a site or a book where can I find a example about that?!

I'm studiyng on "Struts 1, Best Pratices", but it isn't enough to understand Struts 1.3!!!

Thank you, so much!!
Ravi Sree
Ranch Hand

Joined: Jan 24, 2010
Posts: 64

David Newton wrote:You should never have a collection of ActionForms.

Database logic is best handled in a service class, but could also be put directly in the action (makes testing more difficult).


Hi there,

Can you please provide some link of using service class......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1.3 Database