You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by water autumn <bp...@hotmail.com> on 2003/09/20 17:45:27 UTC

servlet question

hello:
   My environment is follow:
              JDK :  j2sdk_1.4.2_01
              Web Server :  TOMCAT 5.0.0
   When i devloped servlet program, such as test.java, while i typed this 
line :
"import javax.servlet.*;", javac tell me the error:
"
F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
import javax.servlet.http.*;"

why? can you tell me how i can resolve it?
i can't find serlet.jar in directory"TOMCAT\common\lib"

                                                       water autumn

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  


Re: servlet question

Posted by Ben Souther <bp...@adelphia.net>.
In order to compile servlets with javac, you will need to include all of the 
jar files found in ...common/lib in your classpath.   Tomcat will include 
them automatically when it starts up for running the servlets but you will 
need to do set up your environment manually in order to compile with javac.

Remember, each jar file needs to be explicitly added to your classpath. Don't 
just add the directory that they are under.






On Sunday 21 September 2003 06:26 am, you wrote:
> Indeed.
> There is a servlet-api.jar under $TOMCAT_HOME/common/lib/
> My Tomcat version is 5.0.0
>
> On Sunday 21 September 2003 11:42, BAO RuiXian wrote:
> > Bruno Costacurta wrote:
> > > It seems you miss J2EE.
> > > After installation (from www.java.sun.com/j2ee)
> > > you should find j2ee.jar (under $J2EE_HOME/lib/) which contain
>
> javax.servlet.*
>
> > > Hope it helps.
> >
> > Maybe. But, there should also be a servlet.jar in
> > %TOMCATHOME%/common/lib directory. At least I have it for my tomcat
> > 4.18. And water autumn cannot find it in TOMCAT 5.0.0
> >
> > Best
> >
> > Bao
> >
> > > On Saturday 20 September 2003 17:45, water autumn wrote:
> > >>hello:
> > >>   My environment is follow:
> > >>              JDK :  j2sdk_1.4.2_01
> > >>              Web Server :  TOMCAT 5.0.0
> > >>   When i devloped servlet program, such as test.java, while i typed
> > >> this line :
> > >>"import javax.servlet.*;", javac tell me the error:
> > >>"
> > >>F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not
> > >> exist import javax.servlet.http.*;"
> > >>
> > >>why? can you tell me how i can resolve it?
> > >>i can't find serlet.jar in directory"TOMCAT\common\lib"
> > >>
> > >>                                                       water autumn
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: servlet question

Posted by Ben Souther <bp...@adelphia.net>.
In order to compile servlets with javac, you will need to include all of the 
jar files found in ...common/lib in your classpath.   Tomcat will include 
them automatically when it starts up for running the servlets but you will 
need to do set up your environment manually in order to compile with javac.

Remember, each jar file needs to be explicitly added to your classpath. Don't 
just add the directory that they are under.






On Sunday 21 September 2003 06:26 am, you wrote:
> Indeed.
> There is a servlet-api.jar under $TOMCAT_HOME/common/lib/
> My Tomcat version is 5.0.0
>
> On Sunday 21 September 2003 11:42, BAO RuiXian wrote:
> > Bruno Costacurta wrote:
> > > It seems you miss J2EE.
> > > After installation (from www.java.sun.com/j2ee)
> > > you should find j2ee.jar (under $J2EE_HOME/lib/) which contain
>
> javax.servlet.*
>
> > > Hope it helps.
> >
> > Maybe. But, there should also be a servlet.jar in
> > %TOMCATHOME%/common/lib directory. At least I have it for my tomcat
> > 4.18. And water autumn cannot find it in TOMCAT 5.0.0
> >
> > Best
> >
> > Bao
> >
> > > On Saturday 20 September 2003 17:45, water autumn wrote:
> > >>hello:
> > >>   My environment is follow:
> > >>              JDK :  j2sdk_1.4.2_01
> > >>              Web Server :  TOMCAT 5.0.0
> > >>   When i devloped servlet program, such as test.java, while i typed
> > >> this line :
> > >>"import javax.servlet.*;", javac tell me the error:
> > >>"
> > >>F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not
> > >> exist import javax.servlet.http.*;"
> > >>
> > >>why? can you tell me how i can resolve it?
> > >>i can't find serlet.jar in directory"TOMCAT\common\lib"
> > >>
> > >>                                                       water autumn
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Re: servlet question

Posted by Bruno Costacurta <bc...@wanadoo.be>.
Indeed.
There is a servlet-api.jar under $TOMCAT_HOME/common/lib/
My Tomcat version is 5.0.0

On Sunday 21 September 2003 11:42, BAO RuiXian wrote:
> Bruno Costacurta wrote:
> > It seems you miss J2EE.
> > After installation (from www.java.sun.com/j2ee) 
> > you should find j2ee.jar (under $J2EE_HOME/lib/) which contain 
javax.servlet.*
> > Hope it helps.
> 
> Maybe. But, there should also be a servlet.jar in
> %TOMCATHOME%/common/lib directory. At least I have it for my tomcat
> 4.18. And water autumn cannot find it in TOMCAT 5.0.0
> 
> Best
> 
> Bao
> 
> > On Saturday 20 September 2003 17:45, water autumn wrote:
> > 
> >>hello:
> >>   My environment is follow:
> >>              JDK :  j2sdk_1.4.2_01
> >>              Web Server :  TOMCAT 5.0.0
> >>   When i devloped servlet program, such as test.java, while i typed this 
> >>line :
> >>"import javax.servlet.*;", javac tell me the error:
> >>"
> >>F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
> >>import javax.servlet.http.*;"
> >>
> >>why? can you tell me how i can resolve it?
> >>i can't find serlet.jar in directory"TOMCAT\common\lib"
> >>
> >>                                                       water autumn
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: servlet question

Posted by Bruno Costacurta <bc...@wanadoo.be>.
Indeed.
There is a servlet-api.jar under $TOMCAT_HOME/common/lib/
My Tomcat version is 5.0.0

On Sunday 21 September 2003 11:42, BAO RuiXian wrote:
> Bruno Costacurta wrote:
> > It seems you miss J2EE.
> > After installation (from www.java.sun.com/j2ee) 
> > you should find j2ee.jar (under $J2EE_HOME/lib/) which contain 
javax.servlet.*
> > Hope it helps.
> 
> Maybe. But, there should also be a servlet.jar in
> %TOMCATHOME%/common/lib directory. At least I have it for my tomcat
> 4.18. And water autumn cannot find it in TOMCAT 5.0.0
> 
> Best
> 
> Bao
> 
> > On Saturday 20 September 2003 17:45, water autumn wrote:
> > 
> >>hello:
> >>   My environment is follow:
> >>              JDK :  j2sdk_1.4.2_01
> >>              Web Server :  TOMCAT 5.0.0
> >>   When i devloped servlet program, such as test.java, while i typed this 
> >>line :
> >>"import javax.servlet.*;", javac tell me the error:
> >>"
> >>F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
> >>import javax.servlet.http.*;"
> >>
> >>why? can you tell me how i can resolve it?
> >>i can't find serlet.jar in directory"TOMCAT\common\lib"
> >>
> >>                                                       water autumn
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


Re: servlet question

Posted by BAO RuiXian <ru...@pp.inet.fi>.
Bruno Costacurta wrote:
> It seems you miss J2EE.
> After installation (from www.java.sun.com/j2ee) 
> you should find j2ee.jar (under $J2EE_HOME/lib/) which contain javax.servlet.*
> Hope it helps.

Maybe. But, there should also be a servlet.jar in
%TOMCATHOME%/common/lib directory. At least I have it for my tomcat
4.18. And water autumn cannot find it in TOMCAT 5.0.0

Best

Bao

> On Saturday 20 September 2003 17:45, water autumn wrote:
> 
>>hello:
>>   My environment is follow:
>>              JDK :  j2sdk_1.4.2_01
>>              Web Server :  TOMCAT 5.0.0
>>   When i devloped servlet program, such as test.java, while i typed this 
>>line :
>>"import javax.servlet.*;", javac tell me the error:
>>"
>>F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
>>import javax.servlet.http.*;"
>>
>>why? can you tell me how i can resolve it?
>>i can't find serlet.jar in directory"TOMCAT\common\lib"
>>
>>                                                       water autumn



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: servlet question

Posted by BAO RuiXian <ru...@pp.inet.fi>.
Bruno Costacurta wrote:
> It seems you miss J2EE.
> After installation (from www.java.sun.com/j2ee) 
> you should find j2ee.jar (under $J2EE_HOME/lib/) which contain javax.servlet.*
> Hope it helps.

Maybe. But, there should also be a servlet.jar in
%TOMCATHOME%/common/lib directory. At least I have it for my tomcat
4.18. And water autumn cannot find it in TOMCAT 5.0.0

Best

Bao

> On Saturday 20 September 2003 17:45, water autumn wrote:
> 
>>hello:
>>   My environment is follow:
>>              JDK :  j2sdk_1.4.2_01
>>              Web Server :  TOMCAT 5.0.0
>>   When i devloped servlet program, such as test.java, while i typed this 
>>line :
>>"import javax.servlet.*;", javac tell me the error:
>>"
>>F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
>>import javax.servlet.http.*;"
>>
>>why? can you tell me how i can resolve it?
>>i can't find serlet.jar in directory"TOMCAT\common\lib"
>>
>>                                                       water autumn



Re: servlet question

Posted by Bruno Costacurta <bc...@wanadoo.be>.
It seems you miss J2EE.
After installation (from www.java.sun.com/j2ee) 
you should find j2ee.jar (under $J2EE_HOME/lib/) which contain javax.servlet.*
Hope it helps.

On Saturday 20 September 2003 17:45, water autumn wrote:
> hello:
>    My environment is follow:
>               JDK :  j2sdk_1.4.2_01
>               Web Server :  TOMCAT 5.0.0
>    When i devloped servlet program, such as test.java, while i typed this 
> line :
> "import javax.servlet.*;", javac tell me the error:
> "
> F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
> import javax.servlet.http.*;"
> 
> why? can you tell me how i can resolve it?
> i can't find serlet.jar in directory"TOMCAT\common\lib"
> 
>                                                        water autumn
> 
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: servlet question

Posted by Bruno Costacurta <bc...@wanadoo.be>.
It seems you miss J2EE.
After installation (from www.java.sun.com/j2ee) 
you should find j2ee.jar (under $J2EE_HOME/lib/) which contain javax.servlet.*
Hope it helps.

On Saturday 20 September 2003 17:45, water autumn wrote:
> hello:
>    My environment is follow:
>               JDK :  j2sdk_1.4.2_01
>               Web Server :  TOMCAT 5.0.0
>    When i devloped servlet program, such as test.java, while i typed this 
> line :
> "import javax.servlet.*;", javac tell me the error:
> "
> F:\JAVA\upload\AccUpload.java:8: package javax.servlet.http does not exist
> import javax.servlet.http.*;"
> 
> why? can you tell me how i can resolve it?
> i can't find serlet.jar in directory"TOMCAT\common\lib"
> 
>                                                        water autumn
> 
> _________________________________________________________________
> 与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
>