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

Design question (struts/mvc)

 
Raj Bhandari
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can you please suggest how should I design this. I'm using struts for implementing my mvc design (and I'm new to mvc and struts).

Say, my application has a form1.jsp page for the user to fill.
Now form1.jsp has some fields like dropdowns which get value from database.

form1.jsp (view) will contain struts/struts-el html tags.. but then should I have a Action class (say form1Action.java) just to get dropdown values and then a model which does database work (say form1Model.java).

All this just to populate fields for my forms ?

So basically all my forms which will need dropdowns or some other values from database would need an Action class behind it just to grap the data... is that correct ?

So that means I should not let the user do a form1.jsp directly on the url but make them click on a link that says form1 and use action mapping to map it to form1.jsp so that it always goes thro' my action class.. is that correct ?

Tks
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds correct to me. Good luck!

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic