![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
It depends on what you are trying to do as to which is better in a given situation. A JSP is Sun's attempt at de-coupling content (HTML) from code. A servlet generally is a class that has �HTML� embedded as Strings that are output to the HttpServletResponse�s PrintWriter. The problem with this approach is that every time you want to change your HTML, you have to make a coding change. Think of a JSP as a Servlet �inside-out�. In other words, a Servlet is a class with HTML within it. A JSP on the other hand is HTML with Java scriptlets within it. I prefer to use a combination of Servlets and JSPs. I use the Servlet as a controller to speak to the backend server-side, and I use JSP�s to format and display content back to the browser. Enough for now. There are plenty of good books out on JSPs as well as some good websites. I suggest starting here: http://java.sun.com/products/jsp/index.html > Dear Friends,
Replies: |
Sponsored Links
|