L4N0
L4N0

Reputation: 267

Compiling servlets for tomcat

Hello
I am trying to modify one of the default files that comes with tomcat SessionExample.java, and trying to compile it but I get an error.

javac -classpath "E:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.18\lib\servlet-api.jar" SessionExample.java

Gives me this error

SessionExample.java:26: package util does not exist
import util.HTMLFilter;
           ^
SessionExample.java:90: cannot find symbol
symbol  : variable HTMLFilter
location: class SessionExample
            out.println(HTMLFilter.filter(name) + " = "
                        ^
SessionExample.java:91: cannot find symbol
symbol  : variable HTMLFilter
location: class SessionExample
                        + HTMLFilter.filter(value) + "
"); ^ 3 errors

Thank you

Upvotes: 0

Views: 3300

Answers (1)

Bozho
Bozho

Reputation: 597016

You have to compile HTMLFilter. Use can use the -sourcepath switch. See the javac docs. Consider using some IDE like Eclipse or NetBeans

Upvotes: 3

Related Questions