• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Controller in MVC architecture

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a controller associated with a jsp page. I understand that on any event( submit) from the jsp page, the controller is called. Will the controller come into play before the page loads also?

Thanks in advance,
Srini
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Typically an application built on MVC architecture is started by invoking a servlet, and that could be your controller.

Think in this way, when a jsp is rendered, it will essentially use several beans and attributes etc. to build the page. For example, a dropdown on the page could be dynamic, for which items could come from a List stored in request. Now, the task of building the list might have been done by a controller invoked earlier. So, here answer to your question will be YES.

On the other hand, if you are rendering a page which does not have any dynamic content or all dynamic contents are available in session, then NO, the controller corresponding to the jsp will not be invoked when jsp is rendered.

True answer is IT DEPENDS on business need.
reply
    Bookmark Topic Watch Topic
  • New Topic