Only 44 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet  RSS feed

 
rajee venkat
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

In a MVC architecture, role of a servlet is to redirect the Jsp/Html pages those come from User..
My questions are
1)Suppose User interface has 5 Forms(new user,calculation,Details of prod,..like). .Huv will the controller find ,which form has called the servlet this time...what identification will the New User form have ...
Beacuse all the forms target the controller...
2)suppose I have DAO as business component ..who will invoke this ...
(Java bean for each form ,i guess)
3)Also huv the servlet will identify which bean to call..
4)Suppose if have 5 java bean for the 5 forms for getting and setting values, could these java bean classes call DAO , seperately..
5)Actually what's going to be there in DAO(I hope all access logic to databse, business methods, )
5)Can a DAO have more than one classes..

I hope i will get a god response from u experts
Thanks
Rajee
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One simple way to identify a form is to use a hidden variable with a characteristic name and value. Something like:

Then getting the "formtype" parameter will tell you which form did the submit.
WBB
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can define an attribute in the action such as
<form method="POST" action="servlet/MyFormServlet?formName=mailbox" ....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!