Re: error 404 with servlet not found...newbie question
marco_at_pivitsoft.com
Date: 08/05/04
- Next message: Liz: "Re: Graphic effects"
- Previous message: ak: "Re: graphic rendering question"
- In reply to: Bryce: "Re: error 404 with servlet not found...newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 4 Aug 2004 21:14:00 -0700
Bryce <spamtrap@berzerker-soft.com> wrote in message news:<f1atg0dn1nr4fegui60s3q8vafssa14dvi@4ax.com>...
> On 2 Aug 2004 10:57:28 -0700, marco@pivitsoft.com
> (marco@pivitsoft.com) wrote:
>
> >Good day,
> >
> >my issue is basically I have a very simple setup of a webappliction.
> >A couple of jsp pages and a couple of servlets.
> >
> >If I copy my classes into...
> >
> >C:\jakarta-tomcat-5.0.19\webapps\ROOT\WEB-INF\classes
> >
> >everything works...if I copy the same classes into
> >
> >C:\jakarta-tomcat-5.0.19\webapps\ROOT\test\WEB-INF\classes
> >
> >I get a 404 error. Now I know that my classes are working...and also
> >that my jsp pages are working.
> >
> >I have tried several things...here is what I placed in my server.xml:
> >
> >
> > <Context path="/DiscoverRealtor/"
> > docBase="DiscoverRealtor"
> > debug="1"
> > reloadable="true">
> > </Context>
> >
> >I have changed several times the CLASSPATH, and I have also added the
> >entire path into it...with no success...
>
> You shouldn't have to change the classpath. Tomcat will take care of
> that for you.
>
> What you aren't tell us is:
>
> 1. What does your web.xml look like?
> 2. What URL are you trying to access your servlets with.
>
> >if my classpath has the following:
> >
> >C:\jakarta-tomcat-5.0.19\webapps\ROOT\WEB-INF\classes
> >
> >everything works...if I put
> >
> >C:\jakarta-tomcat-5.0.19\webapps\ROOT\test\WEB-INF\classes
> >
> >it does not work...yet I know that the files are there and that they
> >work...
> >
> >Any help would be greatly appreciated!!
> >
> >
> >Marco
Thank you very much for all your help!!! I works perfectly!!!
Here is my setup that I have now...
Web.xml I left empty for now...I will add to it as I go along...
In the the Server.xml file I added
<Context path="webapps/test/"
docBase="test"
debug="1"
reloadable="true">
</Context>
Directory structure:
C:\jakarta-tomcat-5.0.19\webapps\test
-css
-images
(all jsp files)
...
-WEB-INF
-classes
(all my servlets)
-lib
(all my *.jar files)
The main issue that I had was to know what path to use when I called a
servlet from a jsp page / form...here is an example:
<form action="http://localhost/test/servlet/main.userlogin"
method="post">
and the next issue was to know how to forward(path) the jsp after the
"userlogin" and that was...
(java file)
String address = "/logged.jsp";
RequestDispatcher dispatcher =
request.getRequestDispatcher(address);
dispatcher.forward(request, response);
So, thx again for all your help...
Marco
I got a fever, and the only prescription is more cowbell!
- Next message: Liz: "Re: Graphic effects"
- Previous message: ak: "Re: graphic rendering question"
- In reply to: Bryce: "Re: error 404 with servlet not found...newbie question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|