• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

mvc

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
srinivasan doraiswamy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic