?
Solved

calling in mvc2 architect

Posted on 2006-04-27
9
Medium Priority
?
341 Views
Last Modified: 2013-11-24
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.
0
Comment
  • 5
  • 3
9 Comments
 
LVL 30

Accepted Solution

by:
Mayank S earned 500 total points
ID: 16552877
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
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 16553345
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
 
LVL 9

Author Comment

by:Manikandan Thiagarajan
ID: 16553700
what is the use of response.sendredirect?

differenc3e between forward and send redirect
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Author Comment

by:Manikandan Thiagarajan
ID: 16553709
>>result = ejbProxy.doProcessing ( user ) ;

could you explain the need for this code
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16554097
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16554183
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
 
LVL 9

Author Comment

by:Manikandan Thiagarajan
ID: 16583443
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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16583498
>> 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
 
LVL 30

Expert Comment

by:Mayank S
ID: 16583500
You could ask a new question for this.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question