Eclipse - Tomcat Setup
Eclipse - Tomcat Setup
Eclipse - Tomcat Setup
SETUP & 1 ST
APPLICATION
SOFTWARES REQUIRED
JDK 1.5
ECLIPSE 3.4
TOMCAT 5.0
ECLIPSE PLUGIN – TOMCAT
MYSQL DATABASE
MYSQL JDBC DRIVER
JDK
Copy jdk to your folder c:\programme
Set classpath
CLASSPATH
.;C:\Programme\Java\jdk1.6.0_11;
PATH
%SystemRoot%\system32;%SystemRoot%;%SystemRoot
%\System32\Wbem;C:\Programme\ATI Technologies\ATI
Control
Panel;C:\Programme\QuickTime\QTSystem\;C:\Programme\
Java\jdk1.6.0_11\bin;
TOMCAT
TOMCAT - RUN EXE FILE
jakarta-tomcat-5.0.28.exe
SET USER- admin , PASSWORD- admin
Download tomcatPluginVxxx.zip
Unzip it in :
- Eclipse_Home/dropins for Eclipse 3.4, 3.5 and 3.6
- Eclipse_Home/plugins for Eclipse 2.1, 3.0, 3.1, 3.2 and 3.3
…click on the Next button and call our new project “Hello World”
After a click on the next Button we now can adjust under
which URI (Uniform Resource Identifier) we
want our new application to respond to our requests. To
illustrate what part of the URL this is, just take a look at the
fat part in the following address: http://localhost:8080/HelloWorld/hello.
The default adjustments on the other controls should be fine by
now, so we don’t bother to adjust them. They should look similar
to following image.
<>
If we now “Finish” the Wizard, we can see, that Eclipse has created a
whole bunch of new directories. It should look similar to this:
Now we can create a new class named
HelloServlet in the directory WEB-INF/src
Copy the code
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class HelloServlet extends HttpServlet {
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter out = res.getWriter();
out.println("Hello, Brave new World!");
out.close(); } }
Unfortunately we are not yet finished. We still
need to create the web.xml descriptor, which
contains certain elements of configuration
specific to our application and the server
behaviour. So we create the file web.xml in the
directory WEB-INF (Note: not in the
directory WEB-INF/src !!!). For our simple
application, the following parameters should
be fine.
Check http://localhost:8080/HelloWorld/hello