Hi,
Adding some -claspath based upon man javac, I reduced the number of errors to
two.
bml0065:classes administrator$ sudo javac -classpath
/usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util:/usr/local/apache-tomcat-7.0.10/lib/servlet-api.jar
SessionExample.java SessionExample.java:33: package util does not exist
import util.HTMLFilter;
^
SessionExample.java:100: cannot access HTMLFilter
bad class file:
/usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util/HTMLFilter.java
file does not contain class HTMLFilter
Please remove or make sure it appears in the correct subdirectory of the
classpath.
out.println(HTMLFilter.filter(name) + " = "
^
2 errors
How can I get rid off these two ? I tried this command too:
sudo javac -classpath
/usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util/HTMLFilter.class:/usr/local/apache-tomcat-7.0.10/lib/servlet-api.jar
SessionExample.java
and also with HTMLFilter.java in place of HTMLFilter.class, but then the number
of errors climbed back to three :-(
Thanks ahead,
János
On Apr 27, 2011, at 11:25 AM, János Löbb wrote:
> Hi,
>
> During a good night sleep I realized that I have to compile the modified
> .java file :-)
>
> This is my current directory:
>
> bml0065:classes administrator$ pwd
> /usr/local/tomcat/webapps/examples/WEB-INF/classes
>
>
> When I do it I am getting the following errors:
>
> <nyissz>
>
> bml0065:classes administrator$ sudo javac SessionExample.java
> Password:
> SessionExample.java:27: package javax.servlet does not exist
> import javax.servlet.ServletException;
> ^
> SessionExample.java:28: package javax.servlet.http does not exist
> import javax.servlet.http.HttpServlet;
> ^
> SessionExample.java:29: package javax.servlet.http does not exist
> import javax.servlet.http.HttpServletRequest;
> ^
> SessionExample.java:30: package javax.servlet.http does not exist
> import javax.servlet.http.HttpServletResponse;
> ^
> SessionExample.java:31: package javax.servlet.http does not exist
> import javax.servlet.http.HttpSession;
> ^
> SessionExample.java:41: cannot find symbol
> symbol: class HttpServlet
> public class SessionExample extends HttpServlet {
> ^
> SessionExample.java:48: cannot find symbol
> symbol : class HttpServletRequest
> location: class SessionExample
> public void doGet(HttpServletRequest request,
> ^
> SessionExample.java:49: cannot find symbol
> symbol : class HttpServletResponse
> location: class SessionExample
> HttpServletResponse response)
> ^
> SessionExample.java:50: cannot find symbol
> symbol : class ServletException
> location: class SessionExample
> throws IOException, ServletException
> ^
> SessionExample.java:144: cannot find symbol
> symbol : class HttpServletRequest
> location: class SessionExample
> public void doPost(HttpServletRequest request,
> ^
> SessionExample.java:145: cannot find symbol
> symbol : class HttpServletResponse
> location: class SessionExample
> HttpServletResponse response)
> ^
> SessionExample.java:146: cannot find symbol
> symbol : class ServletException
> location: class SessionExample
> throws IOException, ServletException
> ^
> SessionExample.java:80: cannot find symbol
> symbol : class HttpSession
> location: class SessionExample
> HttpSession session = request.getSession(true);
> ^
> SessionExample.java:47: method does not override or implement a method from a
> supertype
> @Override
> ^
> SessionExample.java:143: method does not override or implement a method from
> a supertype
> @Override
> ^
> 15 errors
>
> <nyassz>
>
> What am I doing wrong ?
>
> My guess is that I need a -classpath option, so javac can find all those
> definitions it needs. What should that be on OSX 10.6.6 ?
>
> Thanks ahead,
>
> János
>
> On Apr 26, 2011, at 5:25 PM, János Löbb wrote:
>
>> Folks,
>>
>> What should I change if I want to have as title in this servlet not "Session
>> Example" but rather "Session Example Old" ?
>>
>> I modified the servlets/sessions.html and also the SessionExample.java in
>> the WEB-INF/classes, created a war file with jar, un-deployed and
>> re-deployed, but I do not see the change.
>>
>> Thanks ahead,
>>
>> János
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]