Why servlet used as controller in mvc2?Plz explain details
In mvc1 architecture there is no controller concept then why it is called as mvc architecture?
There is a controller in MVC1 architecture.
Controller in MVC1 architecture is implemented in jsp along with view of the page.
But the problem is there is no seperate controller in MVC1.
So burden of having both Controller and view in jsp is more.
JSP will implement both Controller and View components.
There is MVC means Model, View & Controller, There is no MVC1 & MVC2, There is Model1 & Model2 Architecture
What happens when we call destroy() method in init() method in servlets
We can call a destroy() method from init() or service() normally like any other methods. Container will executes the destroy() method but does not unloads the servlet object from the memory. The unloading of servlet can be taken care by container only.
The destroy method can be called inside the init method. It will execute the code written in the destroy method, and flow will be back to the init method and continues.Now the question arises.... &nbs...
Why genericservlet is an abstract class ?
when you are overriding any abstract class, you have to override all the methods of that class.
GenericServlet is an abstract class because its upto the user how he wants it to use the life-cycle methods of the servlet and also the server needs to make sure that all the life cycle methods of the...
What is dynamic content?In real time example?
See by dynamic content we mean the content which is decided at runtime.Depending on the request which a user is sending we get a respose which is dependent on the request and it is not fixed.For examp...
very simple if you ask me my profile or someone else ask my profile, i will answer in two seperate reply considering the consiquency, as per request reponse content is different, and thats the dynamic...
Can we put costructor in place of init() method . If yes how it works plz xplain in detail??
webcontainer create an object for servlet class.for createing an object use the newInstance() method.this object automaticaly create a defaultconstructor so we can not create parametarised constructior for this object.praveen kumar sakhamudi
constructor makes a simple object, when the container call init() on this simple object, now the simple object has become servlet which can serve the request.
they both r service methods.....
do get() has a disadvantage of sending very less amt of
information as it can send 24 to 255 character........
do post() is used for posting d information.....
in doPost() data of the client is send as apart of request body and in doGet() data of the client is send as a part of url
What is the difference between request.Forward and requestdispatcher.Forward?
The question should be like - What is the difference between requestdispatcher.forward and response.sendredirect? The response will not be sent back to the client and so the client will not know...
The question should be -- What is the difference between response.sendRedirect(url) and RequestDispatcher.forward(url)?
According to MVC2 the purpose of addition of the controller was to just separate the dynamic part of the application from the static part and for that the dynamic part given the name "view" is handle...
controlar is the servert,which task is to contol the prorm