File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 1.3 Database

 
Lorenzo Tagliaferro
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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......
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic