calling in mvc2 architect

in mvc2 architecture.

jsp--servlet--javacalls

modal  contains no of classes.

suppose i have customer details button in jsp.

that would invoke particular servlet.

how servlet identify particular customer detailsclass in many classes and that would call.

 how custmer details return to servlet and view through jsp

could you explain the calling flow from jsp--servlet---javaclass

then

javaclass--servlet---jsp.
LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
 
Mayank SAssociate Director - Product EngineeringCommented:
From the JSP, you will send requests to the servlet. The servlet will get these values from the request parameters:

String ID = request.getParameter ( "ID" ) ;
String name = request.getParameter ( "name" ) ;

Then the servlet can create objects for holding this data:

User user = new User ( ID, name ) ; // for example

This object can be passed to another layer of the application for further data-processing, like to an EJB:

result = ejbProxy.doProcessing ( user ) ;

The response from this method-call can be redirected to the UI using getRequestDispatcher ().forward ()
0
 
Jim CakalicSenior Developer/ArchitectCommented:
My favorite page for explaining JSP Model 2 Architecture:
http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

Regards,
Jim
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
what is the use of response.sendredirect?

differenc3e between forward and send redirect
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Manikandan ThiagarajanSenior consultantAuthor Commented:
>>result = ejbProxy.doProcessing ( user ) ;

could you explain the need for this code
0
 
Mayank SAssociate Director - Product EngineeringCommented:
That is just an example to an EJB method call - it could be a call to anything else which will do some business-processing over the data.
0
 
Mayank SAssociate Director - Product EngineeringCommented:
In sendRedirect () you don't pass the request/ response. You can just redirect to a new URL and that will become a new request.
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
suppose i want to design login page.

waht i have to implement in model class

is it simple java bean class or java with jdbc or java with entity bean

could you tell me which is better
0
 
Mayank SAssociate Director - Product EngineeringCommented:
>> java with jdbc or java with entity bean

I would prefer to abstract the data-layer from the business-layer. You could use a session bean for the business logic, and make sure that it does not get tied up to a particular data-source. You could use LDAP, web-services, JDBC, XML files, or any other kind of interface for talking to the data-store (select it from a configuration-file).
0
 
Mayank SAssociate Director - Product EngineeringCommented:
You could ask a new question for this.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.