• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

question for kennethxu

Hi Kenneth!
I still feel daft for not giving you the points last time (applet / servlet communication) and since I have another problem, I thought I ask you personally this time as compensation :-) (I only have 20 points left though...)

I have written a servlet which tries to utilise other classes, for example the QueryHandler class (see below).

public class DatabaseHelper extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{
        String qryparm = request.getParameter("id");
        int in = Integer.parseInt(qryparm);
        Vector myVec;
        QueryHandler myHandler = new QueryHandler();
        myVec = myHandler.idnumberQuery(in);

When I try to compile, the compiler tells me that it cannot find QueryHandler. QueryHandler's .class and .java files are in the same directory as DatabaseHelper.
What am I doing wrong?

Kind Regards
Sven Henry
  • 2
1 Solution
thanks for your trust.

try to add the dir to classpath when you compile:

javac -classpath %classpath%;c:\dir\to\classfiles ....

if you still have problem, please let me know:
1. do you use package?
2. where are you files( .java, .class ) located?
3. how do you compile? (full command you used)

SvenHJohanssonAuthor Commented:
Thanks Kenneth,
adding the dir to javac did it.

Kind regards
Sven Henry
glad to know that and thanks for the points :)

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now