tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Smith" <sat-g...@home.com>
Subject Re: JSP vs Servlets...
Date Sun, 05 Nov 2000 03:03:18 GMT
Rui,

Try the following experiment. Put the source code
below into a file called hello.jsp in the /examples/ROOT directory:


<%! String hello; %>
<% hello = "Hello World"; %>
<html>
<head>
<title>Hello</title>
</head>
<body>
<P><%=hello%></P>
</body>
</html>

Access this file by using

http://localhost:8080/hello.jsp

in your browser. Now look in the
tomcat work directory. You will see 
a folder called something like localhost_8080.
In that folder will be some files with an odd
names like 0001fhello_0001ejsphello.java
and 0001fhello_0001ejsphello.class. This
is the source code for the JSP. If you look at
it you'll see it is basically a servlet -- pretty much
what you would write by hand to say "Hello World".

The JavaServer Pages system is merely a way to 
quickly produce servlets that would otherwise be
very tedious to write by hand. 


Dave

----- Original Message ----- 
From: "Rui Oliveira" <oliveira@milu.ipn.pt>
To: <tomcat-user@jakarta.apache.org>
Sent: Wednesday, December 20, 2000 11:39 AM
Subject: JSP vs Servlets...


> Hello,
> 
> can someone tell me which one is best: JSP or Servlets?
> 
> Is there a reason (beside implementatio reasons) to choose one instead
> of the other?
> 
> 
> Thx in advance
> Rui
> 


Mime
View raw message