I have create a
java bean named TransactionBean and save it under C:\Tomcat\webapps\examples\WEB-INF\classes\bean
The transaction codes are started as follows:
__________________________________________________
package beans;
public class TransactionBean
{
all the codes is writen here
}
_______________________________________________________________________
This java bean is used by a java
servlet(TransactionHandler.java)that has the follwoing codes:
_______________________________________________________________________
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.util.*;
import beans.TransactionBean;
public class TransactionHandler extends HttpServlet
{
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException
{
int studentId=Integer.parseInt(req.getParameter("studentId"));
............some other codes..........
TransactionBean trans= new TransactionBean();
trans.setStudentId(rst.getInt("student_id"));
}
___________________________________________________________________________
I have no problem in compiling the java beans.
However, when i compile the java servlet(TransactionHandler.java), I get these error message:
C:\Tomcat\webapps\examples\WEB-INF\classes>javac TransactionHandler.java
TransactionHandler.java:6: package beans does not exist
import beans.TransactionBean;
^
TransactionHandler.java:31: cannot resolve symbol
symbol : class TransactionBean
location: class TransactionHandler
TransactionBean trans= new TransactionBean();
^
May I know how this problem can be solved?
Thank You.