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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 ()

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Manikandan ThiagarajanSenior consultantAuthor Commented:
what is the use of response.sendredirect?

differenc3e between forward and send redirect
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

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

could you explain the need for this code
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.
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.
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
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).
Mayank SAssociate Director - Product EngineeringCommented:
You could ask a new question for this.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.