Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Controller in MVC architecture

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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,
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • 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.
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!