Can a JSP be used instaead of servlet as a Controller.

Can a JSP be used instaead of servlet as a Controller.If yes how is it going to handle get and post requets.Do we need to wrte any scriptlet code inside JSP t handle these requests.
[188 byte] By [varun_835a] at [2007-10-2 20:11:51]
# 1

Anything a servlet can do, a JSP can do as well. You know why? A jsp IS a servlet. The first time a JSP is executed it is translated into a servlet. Requests are handled in the same way: only a JSP will handle a GET or POST like they are the same thing.

Why would you want to use a JSP however? A servlet is better suited for such program logic, a JSP should be limited to the presentation part of a request only.

gimbal2a at 2007-7-13 22:52:27 > top of Java-index,Java Essentials,New To Java...