• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic question with Eclipse

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Guys,

I am beginner in this.

I have installed Tomcat, once I created new project i got these folders by default.

JRE
TOMCAT-HOM/../servelt.jar
TOMCAT-HOM/../asper-runtime.jar
WEB-INF/src/---------(Test.java)
work
WEB-INF/web.xml

I have created this folder

WEB_INF/classes(using prject-> prop->) and web.xml file by my self

I have created index.jsp, started the server, it was working fine.

when am writing new servlet

Test.java

package UnderDevelop;

/**
* @author Administrator
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Test extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
java.util.Date d = new java.util.Date();
PrintWriter out = response.getWriter();
out.println("Hello World..........");
}
}


web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

< !DOCTYPE web-app<br /> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"<br /> "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<servlet>
<servlet-name>H</servlet-name>
<servlet-class>Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>H</servlet-name>
<url-pattern>/ssss</url-pattern>
</servlet-mapping>
</web-app>


I could nt find the Test.class file in the WEB-INF/classes.

when I type this http://localhost:8080/TomcatProject/ssss
says Status 500 - error.

Please do help me, since am a beginner, u guys will encourage me to fix it.

with regards,
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

There is a free plugin for tomcat-eclipse (sysdeo I guess). You can get the plugin and save it under plugins directory of eclipse.

Then you will get some tomcat related buttons and settings in eclipse. Using them you can configure your classes files.

Thanks
KP
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic