hello everyone,
I am using
servlets and
jsp to publish a database to an intranet . My problem is that my servlets are not compiling. I am having this error when I complile my servlet :
C:\Tomcat\Tomcat\webapps\CoreData\WEB-INF\classes\ProjectServlet.java:38: package broker does not exist
private broker.RelationBroker rb = broker.RelationBroker.getRelationBroker();
And when I compile a broker class I have this error:
C:\Tomcat\Tomcat\webapps\CoreData\WEB-INF\classes\broker\ProjectBroker.java:157: package core does not exist
core.Project dr = new core.Project();
I have a package called "broker" for my brokers and anpther package called "core' for my bean classes in my classes package. i don't know why it's not compiling.
As a result I can't
test my program since when I call my servlet class from my jsp page, the servlet class is not found because it has not been compiled.
Here is how my servlet class looks like:
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ProjectServlet extends HttpServlet
{
//Variables here
private broker.RelationBroker rb = broker.RelationBroker.getRelationBroker();
private Connection con = rb.getConnection();
/*
Description: This method is used to print out the display table
Parameter: HttpServletRequest request
Parameter: HttpServletResponse response
Return: none
*/
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
{
HttpSession session = request.getSession();
response.setContentType("text/html");
PrintWriter out = response.getWriter();
System.out.println("hi Marcy");
request.setAttribute("session", session);
gotoPage("http://nepru", request, response);
}
// Method to get the request dispatcher and forward the request to the following address
public void gotoPage(
String address, HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(address);
dispatcher.forward(request, response);
}
// Method to close the db connection.
public void destroy()
{
try{
con.close();}
catch(SQLException sqle){
System.out.println("SQL error" + sqle.getMessage());
sqle.printStackTrace();}
}
I hope I am in the write forum for this.
Please help.Thanks