aspose file tools*
The moose likes Servlets and the fly likes Servlet vs JSP as controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet vs JSP as controller" Watch "Servlet vs JSP as controller" New topic
Author

Servlet vs JSP as controller

Emmanuel Bellas
Greenhorn

Joined: Aug 01, 2001
Posts: 5
If JSP can do anything that a Servlet can do, why not use a single JSP (e.g index.jsp) as the controller to do everything in pretty much the same way as a servlet would (use the RequestDispatcher, access beans and so on)?
Our index.jsp would not need to display anything, so display and processing could be separated sufficiently, could it not?
deepak kukreja
Ranch Hand

Joined: Aug 13, 2001
Posts: 54
Hi
Yes you can use jsp as a controller, which do not contain ne presentation logic.
Just think of a person who knows writing html code.
How could that person write java code......


Deepak<br />SCJP
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Basicly a JSP is nothing else then a Servlet. The only difference is that it is especiall for presentation purpose. So you can use a JSP but you shouldn't.
 
Don't get me started about those stupid light bulbs.
 
subject: Servlet vs JSP as controller