Reading Programming

Apr 07, 2002 00:28 # 2663

frank *** wants to know...

JSP vs. Servlets

This post was deleted by request of the author.

Apr 07, 2002 12:46 # 2670

tull * has all the information you need...

Just a hint

last week we had some theoretical things about jsp/servlets in university, so here just a few things:

- jsp and servlets doing the same thing (a javaserverpage will be run as a servlet)

- the only (afaik) difference between them is, that you can use mixed code (html and expressions, ..) in a jsp, in a servlet you have to print every html output in quotes, ..

short example for mixed code:

<% while (..) { %>
<tr><td>next line</td></tr>
<% } %>

basic examples you can find under: http://java.sun.com/products/jsp/html/jspbasics.fm.html

or a basic servlet example (extends HttpServlet, ..) http://java.sun.com/docs/books/tutorial/servlets/overview/simple.html

hope this helps a little bit.
tull.

Apr 07, 2002 15:29 # 2681

frank *** replies...

Re: Just a hint

This post was deleted by request of the author.

Apr 09, 2002 07:09 # 2703

tull * replies...

Re: Just a hint

So basically a JSP is kinda like PHP in that you can mix HTML and PHP code together in the same script.

exactly.

Is a servlet simply a java source code that gets compiled on the fly and outputs HTML or some other type of information?

imho not compiled on the fly (it runs in the servlet engine (eg tomcat)). About the output: yes.


Small text Large text

Netalive Amp (Skin for Winamp)