Forums Register Login

mvc

+Pie Number of slices to send: Send
Actually in mvc which separates the controller from the view and the model
Is it the web container or any other thing? I need explanation. Will anybody help?
+Pie Number of slices to send: Send
its nothing out of this world. it is not the container, nor something else. its YOU who seperate the

model from view and control
view from model and control
control from model and view

it is like,

view --- > controller ------> model
model ----> controller ------> view
+Pie Number of slices to send: Send
Thanks adeel

I've another doubt how to call servlet context inside service/doget/dopost methods after calling init method without passing servletconfig as a parameter inside init method

srinivasan

SCJP 1.4
+Pie Number of slices to send: Send
what do you mean by after calling init(). you are not going to call init() anywhere, is it clear?

i hope it will clear your concept.


The servlet context is initialized when the Web application is loaded, and is contained
in the ServletConfig object that is passed to the init() method. Servlets
implementing the GenericServlet interface (directly or indirectly) can invoke the
getServletContext() method to get the context reference, because
GenericServlet implements the ServletConfig interface.
+Pie Number of slices to send: Send
 

Originally posted by srinivasan doraiswamy:
calling init method without passing servletconfig as a parameter inside init method



you must know this about init()

The container initializes the servlet by invoking its init() method, passing
an object implementing the ServletConfig interface. In the init() method, the
servlet can read configuration parameters from the deployment descriptor or perform
any other one-time activities, so the init() method is invoked once and only once by
the servlet container.
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 926 times.
Similar Threads
Need of Model in mvc
design patterns doubt
Relationship between Model (in MVC) and DAO
Violation of Separation of Concerns
How Tree fits into MVC pattern
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:49:13.