can anybody explain me what exactly the roles of bean , jsp , servlet in Model View Controller Artchitechture.
also i am confused to go ahead with implementing model 2 architecture. any resourses available on how to use JSP , servlets and beans together ??
ThanX
praveen
-
what are JSP, Servlet , Bean in MVC ?? (4 messages)
- Posted by: gjh jgjh
- Posted on: July 04 2000 16:01 EDT
Threaded Messages (4)
- what are JSP, Servlet , Bean in MVC ?? by saleem shah khan on July 05 2000 10:35 EDT
- what are JSP, Servlet , Bean in MVC ?? by Tom Eugelink on July 06 2000 08:22 EDT
- what are JSP, Servlet , Bean in MVC ?? by Lakshmi velagaleti on November 14 2000 08:12 EST
- Jsp as a controller VS Servlet as a controller by Prashant Danda on May 01 2003 02:40 EDT
- what are JSP, Servlet , Bean in MVC ?? by Lakshmi velagaleti on November 14 2000 08:12 EST
-
what are JSP, Servlet , Bean in MVC ??[ Go to top ]
- Posted by: saleem shah khan
- Posted on: July 05 2000 10:35 EDT
- in response to gjh jgjh
hello kumar
firstly u need to know when we use jsp when use beans and when Servlets
why use jsp.
jsp is use 4 dynamic web creation it works same like Asp but it is greater pawerfull the Asp because we can use the java code directly in it.
why use beans in Jsp
we use beans foe server side intrection these are the fully resuable components with help of these we can access the database and other server side components
why use Servlets
Servlets are use 4 load balencing by the jsp we call theservlets 4 specific purpose.
these three work side by side in best application
-
what are JSP, Servlet , Bean in MVC ??[ Go to top ]
- Posted by: Tom Eugelink
- Posted on: July 06 2000 08:22 EDT
- in response to gjh jgjh
Simpel: the bean is the model, JSP is the view and Servlet is the controller.
The bean contains data and is stored via the session mechanism. Multiple Webpages (JSP/Servlets) can access and modify the bean (exactly like a model).
A Webpage consist of a JSP an optionally a Servlet. The JSP reads the bean and displays it data (exactly like a view). When the resulting HTML page contains a HTML form, there should also be a Servlet to process this form an store the result in the bean again (exactly like a controller).
Model2 is a good model to work by. The discussion point is the fact that links between webpages are hardcoded in the JSP/Servlet.
Workflow:
JSP is called via URL
JSP creates bean
JSP is converted to HTML and displayed
User clicks "post" button.
HTML contains hardcoded link to Servlet.
Servlet received post request.
Servlet looks up bean in session object.
Servlet interpretes HTML form and set bean properties.
Servlet hardcoded calls another JSP...
and so forth.
-
what are JSP, Servlet , Bean in MVC ??[ Go to top ]
- Posted by: Lakshmi velagaleti
- Posted on: November 14 2000 08:12 EST
- in response to Tom Eugelink
In MVC architecture,
M -MODEL is the component model
can be a java bean, enterprise java bean or a CORBA component object in short any business model.
V- VIEW
The user's perspective whatever he sees VIEW of the MODEL
can be a simple HTML page, can be a DHTML page,
ASP page or JSP page.
C-CONTROLLER
And the controller is your servlets.
we very well know that every JSP is automatically translated abd compiled into Servlet.
Finally
you have a bean model(business logic in a javabean or EJB) seen through JSP and controlled at the backend by the servlets.
that's it..
u can mail me for further clarifications..
visa_lak at yahoo dot com
bye..
-
Jsp as a controller VS Servlet as a controller[ Go to top ]
- Posted by: Prashant Danda
- Posted on: May 01 2003 14:40 EDT
- in response to Lakshmi velagaleti
Hi all,
Can any one explain me what is the trade off involved in going in for a JSP to perform the controllers role, as compared to the traditional method of using a servlet as a controller.
One point is, it is very very easy for the developer to develop the jsp pageg as compared to the servlet, and coding time is also going to go down on choosing jsp as a controller.
Is there any real advantage to go in for a servlet to perform the controllers function ?
What is not possible in a JSP controller that is possible in a Servler.
I do agree that internally JSP is converted into a servlet but in the traditional MVC architecture why is a servlet given the controllers role ?
Can any one throw some light on this ?
Regards,
D. Prashant.