This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 1.3 Database

 
Lorenzo Tagliaferro
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What in particular is causing you problems?
 
Lorenzo Tagliaferro
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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......
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic