hello everybody

first of all thanks to Daniweb and all its users for helping me lot of time.
now come to the problem
I've just started studying servlets 1 week back it was going well but i got one problrm when i try to run a packaged servlet code.

path to servlet (invoker servlet) class

D:\apache-tomcat-6.0.35\webapps\helloprogram\WEB-INF\classes\coreservlets\HelloServlet2.java

package coreservlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloServlet2 extends HttpServlet {
  public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException 
  {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    
    String docType ="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 "+"Transitional//EN\">\n";
    
    out.println(docType +
                "<HTML>\n" +
                "<HEAD><TITLE>Hello (2)</TITLE></HEAD>\n" +
                "<BODY BGCOLOR=\"#FDF5E6\">\n" +
                "<H1>Hello (2)</H1>\n" +
                "</BODY></HTML>");
  }
}

URL which i entered to run this in browser

http://localhost:8080/helloprogram/servlet/coreservlets.HelloServlet2

the above code is working finely when i run this without package by putting .class file in classes folder of above.

i also set my classpath in environtment var

CLASSPATH=D:\apache-tomcat-6.0.35\webapps\helloprogram\WEB-INF\classes\coreservlets

please help me and ask me if any more information required to solve my problem.
Thanks once again to all daniweb family

what kind of error you getting

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.