Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MVC Paradigm & JSP... How to implement?

Status
Not open for further replies.

JediDan

Programmer
May 15, 2002
128
US
This is a big-topic question. I'm looking at converting some large Win32 executables to web applications at somepoint in the intermediate future.

I believe that I am an intermediate Java programmer, but new to JSPs, servlets, etc.

I understand the model-view-controller paradigm in terms of how it separates the data model from the operations from whatever visual end-result is desired.

How does one translate the three-tiered MVC structure into a practial Java-based web system?

Basically, I don't fully understand the difference between beans and servlets and the interaction each would have with a JSP page itself.

I would be grateful for any comments, links to other threads, books on the subject, etc.

Thanks,

Dan
 
Go to Apache Jakarta project and check out the Struts framework. jakarta.apache.org

-pete
 
From ....

Generally, a "Model 2" application is architected as follows:

The user interface will generally be created with JSP pages, which will not themselves contain any business logic. These pages represent the "view" component of an MVC architecture.
Forms and hyperlinks in the user interface that require business logic to be executed will be submitted to a request URI that is mapped to the controller servlet.
There will be one instance of this servlet class, which receives and processes all requests that change the state of a user's interaction with the application. This component represents the "controller" component of an MVC architecture.
The controller servlet will select and invoke an action class to perform the requested business logic.
The action classes will manipulate the state of the application's interaction with the user, typically by creating or modifying JavaBeans that are stored as request or session attributes (depending on how long they need to be available). Such JavaBeans represent the "model" component of an MVC architecture.
Instead of producing the next page of the user interface directly, action classes will generally use the RequestDispatcher.forward() facility of the servlet API to pass control to an appropriate JSP page to produce the next page of the user interface.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top