| Author |
Difference between these 2 methods?
|
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
|
This may be a stupid question, but what is the difference between creating a simple HTML page that directs to a Servlet which produces the dynamic content of the web page, and creating a JSP page that probably still uses the same servlet as mentioned above? Where as the servlet this time probably won't handle any formatting of HTML?
|
My Blog | DZone Articles
|
 |
Matthew Phillips
Ranch Hand
Joined: Mar 09, 2001
Posts: 2676
|
|
|
I generally want my servlets generating as little HTML as possible due to maintenance issues. Servlets tend to get large when they generate html and editing them becomes error prone.
|
Matthew Phillips
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
|
Ahh, I c. Thanks.
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
So the appropriate method then would be: RequestJSP to Servlet1 to ResponseJSP to Web Browser. I had read that before, just didn't know if this was generally good practice or if the example just used it as a "you could do it this way" method.
|
 |
Matthew Phillips
Ranch Hand
Joined: Mar 09, 2001
Posts: 2676
|
|
|
Everything I have read recommends this practice.
|
 |
Mark Howard
Ranch Hand
Joined: Feb 14, 2001
Posts: 285
|
|
Or that Model-View-Controller pattern of: 1) Client request invokes Servlet (Controller) 2) Controller servlet creates JavaBeans (Model) 3) Controller servlet forwards request to JSP (View) 4) JSP uses Beans created by Controller servlet 5) JSP renders response to Client Neat and tidy
|
 |
Gregg Bolinger
Sheriff
Joined: Jul 11, 2001
Posts: 15040
|
|
|
Thanks guys. That's what I needed to know.
|
 |
 |
|
|
subject: Difference between these 2 methods?
|
|
|