This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
A JSP is just another way of constructing a servlet. Choosing one or the other depends on what you are trying to create. If the HTML pages you want to create are heavy on the HTML and don't need much Java code, JSP is worth looking at. If you creating functions that can be expressed as custom tags, JSP is what you want. If your application involves a lot of decision making and branching, a servlet is what you need. You can also combine a decision making servlet with JSP pages that handle various specific types of output. I suggest getting comfortable with writing servlets first so you can understand basic ideas and limitations of servlets. Servlets are easier to debug. Bill
aren't servlets dying down with the advent of JSP. Doesn't a jsp engine comiple a JSP into a servlet after it is accessed the first time? If the jsp requires lot of branching and complex programming stuff, wouldn't creating a bean (multi-tier) and still using JSP not a solution? Need clarification!!
IMHO, Servlets should be only used as dispatch/processing modules (ie. posting to or some other specialized task). JSPs should be used for presentation. This argument is made because clients I've worked with don't necessarily agree with my web-designers and they work out the kinks. I don't want a web-designer mucking around in my servlet code, it's harder to totally ruin a JSP page. If they do, it's their fault haha .
Author and all-around good cowpoke
Joined: Mar 22, 2000
aren't servlets dying down with the advent of JSP. NO! (Many people consider JSP to be Ugly Tech) Doesn't a jsp engine comiple a JSP into a servlet after it is accessed the first time? To be precise - WHEN it is accessed for the first time. If the jsp requires lot of branching and complex programming stuff, wouldn't creating a bean (multi-tier)and still using JSP not a solution? There is a near infinity of possible architectures, some people swear by a single servlet which takes all requests, decides what to do, and dispatches the request to the appropriate JSP for output. Like everything else in computing - consider the task at hand, don't just blindly apply the current buzzword technology. Bill (Who personally writes pretty big servlets)