Hello all
Kindly help me to figure what is the mistake i am making while calling the simple class file in a servlet.
i have written a simple servlet and name it as LoginServer.java i am trying to call a class which i have in other notepad and saved it as Hello.java . i have complied Hello.java and after complilation i see class file of it.
In Servlet LoginServer i have used below command to call the class.
Hello h=new Hello();
but it gives me error cannot resolve symbol.Below is the error
C:\bea\punky\user_projects\punky\applications\DefaultWebApp\WEB-INF\classes>java
c LoginServer.java
LoginServer.java:19: cannot resolve symbol
symbol : class Hello
location: class LoginServer
Hello h= new Hello();
^
LoginServer.java:19: cannot resolve symbol
symbol : class Hello
location: class LoginServer
Hello h= new Hello();
^
2 errors
i have stored both servlet(LoginServer.java) and Hello.java in the same folder (same path)and i am trying to compile it in weblogic.
path is
C:\bea\punky\user_projects\punky\applications\DefaultWebApp\WEB-INF\classes
can anyone suggest what is the mistake that i might be making to get above error.
below is the code
===================
saved simple class as Hello.java
============
class Hello {
int length;
}
=================================
saved simple servelet as LoginServer.java
==================
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginServer extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
try
{ PrintWriter out= res.getWriter();
res.setContentType("text/html");
Hello h= new Hello();
out.println("This is a sample servlet");
out.close();
}
catch(Exception e){}
}
}
============================================
thanks in advance for your time .
nidhi
Kindly help me to figure what is the mistake i am making while calling the simple class file in a servlet.
i have written a simple servlet and name it as LoginServer.java i am trying to call a class which i have in other notepad and saved it as Hello.java . i have complied Hello.java and after complilation i see class file of it.
In Servlet LoginServer i have used below command to call the class.
Hello h=new Hello();
but it gives me error cannot resolve symbol.Below is the error
C:\bea\punky\user_projects\punky\applications\DefaultWebApp\WEB-INF\classes>java
c LoginServer.java
LoginServer.java:19: cannot resolve symbol
symbol : class Hello
location: class LoginServer
Hello h= new Hello();
^
LoginServer.java:19: cannot resolve symbol
symbol : class Hello
location: class LoginServer
Hello h= new Hello();
^
2 errors
i have stored both servlet(LoginServer.java) and Hello.java in the same folder (same path)and i am trying to compile it in weblogic.
path is
C:\bea\punky\user_projects\punky\applications\DefaultWebApp\WEB-INF\classes
can anyone suggest what is the mistake that i might be making to get above error.
below is the code
===================
saved simple class as Hello.java
============
class Hello {
int length;
}
=================================
saved simple servelet as LoginServer.java
==================
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginServer extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
try
{ PrintWriter out= res.getWriter();
res.setContentType("text/html");
Hello h= new Hello();
out.println("This is a sample servlet");
out.close();
}
catch(Exception e){}
}
}
============================================
thanks in advance for your time .
nidhi