tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan" <ste...@killersites.com>
Subject Re: Servlet mapping problem.
Date Mon, 22 Nov 2004 17:06:16 GMT
Yoav,

As I stated in a previous post - I actually included the context name in the
context.xml file, I just omitted it in my email.

Beyond that, I initially did not include a context.xml file - but it did not
work, so I figured I'd give it a go.

But if you noticed in my last post, I just dropped in Bens war file and it
is not working either ... seems to be some container issue and not a web app
issue ...

Yes, you're right, I am just starting out (again) with Tomcat. First time
I've looked at it in years ...

Stefan



----- Original Message ----- 
From: "Shapira, Yoav" <Yoav.Shapira@mpi.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Monday, November 22, 2004 11:58 AM
Subject: RE: Servlet mapping problem.



Hi,
The problem is that you've messed up your configuration.  You created
context.xml and you created your static HTML page.  One says path="" and
the other asks for path="/context_name".  It's a beginner's mistake
that's trivial to correct, and it's your mistake, not Tomcat's fault.

You don't even need a context.xml file: you could have simply created a
directory for your app under webapps, and put your files there, and
voila: i.e. you didn't need to do ANY server configuration to get this
running.  But since you chose to have a context.xml file, it's up to you
to learn how to use it.

Yoav Shapira http://www.yoavshapira.com


>-----Original Message-----
>From: Stefan [mailto:stefan@killersites.com]
>Sent: Monday, November 22, 2004 11:54 AM
>To: Tomcat Users List
>Subject: Re: Servlet mapping problem.
>
>Thanks Ben - I'll give it a go .. the client may insist still on
Tomcat,
>anyway it bugs me that I can't get it to work!
>
>Thanks.
>
>Stefan
>
>www.killersites.com
>www.how-to-build-websites.com
>www.secretsites.com
>www.csstutorial.net
>www.websitereviews.org
>www.websitetemplates.name
>
>----- Original Message -----
>From: "Ben Souther" <bsouther@fwdco.com>
>To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>Sent: Monday, November 22, 2004 11:41 AM
>Subject: Re: Servlet mapping problem.
>
>
>> If you're interested, I've got some simple apps all WARed up on my
site.
>> http://simple.souther.us.
>>
>> Try dropping one of those wars in your webapps directory.  If they
work
>> (which they will if you have an out of the box installation of
Tomcat),
>> you can compare them with your app to see what's different.
>>
>> Good-luck.
>>
>>
>>
>>
>> On Mon, 2004-11-22 at 11:29, Stefan wrote:
>> > Hi,
>> >
>> > I actually put the context reference in the context tag ... just
>something I
>> > omitted in the email. But alas, it still does not work ...
>> >
>> > :(
>> >
>> > I'm actually going to see if I can get the client to use Resin (for
>some
>> > reason, everything works fine is Resin ... out of the box), frankly
at
>this
>> > point I'm not too impressed the Tomcat.
>> >
>> > Thanks Ben.
>> >
>> > Stefan
>> >
>> >
>> >
>> >
>> > ----- Original Message -----
>> > From: "Ben Souther" <bsouther@fwdco.com>
>> > To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>> > Sent: Monday, November 22, 2004 10:40 AM
>> > Subject: Re: Servlet mapping problem.
>> >
>> >
>> > > In your context tag, your specifying: path=""
>> > > but in your url you're using:
>> > > http://127.0.0.1/the_context/loginResponse.do"
>> > >                  ^^^^^^^^^^^
>> > >
>> > >
>> > > Either put: path="/the_context" in your context tag or
>> > > don't specify it in your url.
>> > > loginResponse.do
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > On Mon, 2004-11-22 at 10:31, Stefan wrote:
>> > > > Hi Ben,
>> > > >
>> > > > I've used a relative link - same problem ...
>> > > >
>> > > > Could this be a problem having to do with setting up the
context?
>What I
>> > did
>> > > > to do this,  was drop an xml file with my web apps name in the
>folder:
>> > > >
>> > > > conf\Catalina\localhost
>> > > >
>> > > > In the xml file (contexName.xml) I have this entry:
>> > > >
>> > > > <Context path="" docBase="${catalina.home}/webapps/the_context"
>> > > > reloadable="true"></Context>
>> > > >
>> > > > Of course, my web app is sitting in the 'webapps' directory in
>Tomcat.
>> > > >
>> > > > Any ideas?
>> > > >
>> > > > Stefan
>> > > >
>> > > > www.killersites.com
>> > > >
>> > > >
>> > > > ----- Original Message -----
>> > > > From: "Ben Souther" <bsouther@fwdco.com>
>> > > > To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>> > > > Sent: Monday, November 22, 2004 10:19 AM
>> > > > Subject: Re: Servlet mapping problem.
>> > > >
>> > > >
>> > > > > Why don't you just use a relative link?:
>> > > > > <form action="loginResponse.do" method="post">
>> > > > >
>> > > > > On Mon, 2004-11-22 at 10:13, Stefan wrote:
>> > > > > > Hi,
>> > > > > >
>> > > > > > Just out of curiousity I changed the forms' action
attribute to
>> > include
>> > > > the
>> > > > > > full path:
>> > > > > >
>> > > > > > <form
action="http://127.0.0.1/the_context/loginResponse.do"
>> > > > method="post">
>> > > > > >
>> > > > > > >From a page with this URL:
>http://127.0.0.1/the_context/logIn.jsp
>> > > > > >
>> > > > > > And when I submit the form I am taken to Tomcats' web
server
>admin
>> > tool
>> > > > > > login page!
>> > > > > >
>> > > > > > The URL: http://127.0.0.1/admin/index.jsp
>> > > > > >
>> > > > > > And for the sake of completeness my mapping for the
servlet:
>> > > > > >
>> > > > > > <servlet-mapping>
>> > > > > >   <servlet-name>loginResponse</servlet-name>
>> > > > > >   <url-pattern>/loginResponse.do</url-pattern>
>> > > > > >  </servlet-mapping>
>> > > > > >
>> > > > > >
>> > > > > > Does this shed any light on what is going on?
>> > > > > >
>> > > > > >
>> > > > > > Stefan
>> > > > > >
>> > > > > > www.killersites.com
>> > > > > >
>> > > > > >
>> > > > > > ----- Original Message -----
>> > > > > > From: "Stefan" <stefan@killersites.com>
>> > > > > > To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>> > > > > > Sent: Sunday, November 21, 2004 10:31 PM
>> > > > > > Subject: Re: Servlet mapping problem.
>> > > > > >
>> > > > > >
>> > > > > > > Hi,
>> > > > > > >
>> > > > > > > I am actually using a form to post to the target servlet:
>> > > > > > >
>> > > > > > > <form action="/context_name/loginResponse.do"
method="post">
>> > > > > > >
>> > > > > > > name: <input type="text" name="adminPassword">
>> > > > > > >
>> > > > > > > <input type="submit">
>> > > > > > >
>> > > > > > > </form>
>> > > > > > >
>> > > > > > > The form itself is sitting in a page with this URL:
>> > > > > > >
>> > > > > > > http://127.0.0.1/myWebsite/logIn.jsp
>> > > > > > >
>> > > > > > > And the strange thing is that when I submit the form
I am
>taken to
>> > > > this
>> > > > > > URL:
>> > > > > > >
>> > > > > > > http://127.0.0.1/login.jsp
>> > > > > > >
>> > > > > > > And I get this error:
>> > > > > > >
>> > > > > > > HTTP Status 404 - /login.jsp
>> > > > > > >
>> > > > > > >
>> > > > > >
>> > > >
>> >
>>
------------------------------------------------------------------------
-
>-
>> > > > > > --
>> > > > > > > ----
>> > > > > > >
>> > > > > > > type Status report
>> > > > > > >
>> > > > > > > message /login.jsp
>> > > > > > >
>> > > > > > > description The requested resource (/login.jsp) is
not
>available.
>> > > > > > >
>> > > > > > >
>> > > > > >
>> > > >
>> >
>>
------------------------------------------------------------------------
-
>-
>> > > > > > --
>> > > > > > > ----
>> > > > > > >
>> > > > > > > Apache Tomcat/5.0.28
>> > > > > > > Any ideas? Is this a bug in Tomcat ? This works fine
>(naturally)
>> > in
>> > > > Resin.
>> > > > > > >
>> > > > > > >
>> > > > > > > Stefan
>> > > > > > >
>> > > > > > > www.killersites.com
>> > > > > > >
>> > > > > > > ----- Original Message -----
>> > > > > > > From: "sven morales" <aka_sergio@yahoo.com>
>> > > > > > > To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
>> > > > > > > Sent: Sunday, November 21, 2004 9:58 PM
>> > > > > > > Subject: Re: Servlet mapping problem.
>> > > > > > >
>> > > > > > >
>> > > > > > > >    Can you show us what you type in to your browser?
>> > > > > > > >
>> > > > > > > > --- Stefan <stefan@killersites.com> wrote:
>> > > > > > > >
>> > > > > > > > > Hi,
>> > > > > > > > >
>> > > > > > > > > I first posted this question with the wrong
subject
>> > > > > > > > > heading ... sorry about
>> > > > > > > > > the duplicates.
>> > > > > > > > >
>> > > > > > > > > My question:
>> > > > > > > > >
>> > > > > > > > > Using Tomcat 5.0.28 standalone on windows
XP with
>> > > > > > > > > JVM 1.4, I get this error
>> > > > > > > > > even though I have mapped my servlet in the
web.xml
>> > > > > > > > > file of the web app:
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > HTTP Status 404 - /loginResponse.do
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > >
>> > > > > >
>> > > >
>> >
>>
------------------------------------------------------------------------
-
>-
>> > > > > > > --
>> > > > > > > > > ----
>> > > > > > > > >
>> > > > > > > > > type Status report
>> > > > > > > > >
>> > > > > > > > > message /loginResponse.do
>> > > > > > > > >
>> > > > > > > > > description The requested resource
>> > > > > > > > > (/loginResponse.do) is not available.
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > >
>> > > > > >
>> > > >
>> >
>>
------------------------------------------------------------------------
-
>-
>> > > > > > > --
>> > > > > > > > > ----
>> > > > > > > > >
>> > > > > > > > > Apache Tomcat/5.0.28
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > I've placed my webapp folder in Tomcats'
webapps
>> > > > > > > > > directory and all the jsp
>> > > > > > > > > pages run fine as do my POJO's for business
logic,
>> > > > > > > > > any ideas why the servlet
>> > > > > > > > > code could be causing problems?
>> > > > > > > > >
>> > > > > > > > > The servlet mappings:
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >   code:
>> > > > > > > > >
>> > > > > > >
>> > > > > >
>> > > >
>> >
>>
------------------------------------------------------------------------
-
>-
>> > > > > > > --
>> > > > > > > > > --
>> > > > > > > > >
>> > > > > > > > >   <servlet>
>> > > > > > > > > <servlet-name>loginResponse</servlet-name>
>> > > > > > > > >
>> > > > > > > >
<servlet-class>com._ABC.authenticateAdmin</servlet-class>
>> > > > > > > > > <init-param>
>> > > > > > > > > <param-name>adminPassword</param-name>
>> > > > > > > > > <param-value>xxx</param-value>
>> > > > > > > > > </init-param> </servlet> <servlet-mapping>
>> > > > > > > > > <servlet-name>loginResponse</servlet-name>
>> > > > > > > > > <url-pattern>/loginResponse.do</url-pattern>
>> > > > > > > > > </servlet-mapping>
>> > > > > > > > >
>> > > > > > >
>> > > > > >
>> > > >
>> >
>>
------------------------------------------------------------------------
-
>-
>> > > > > > > --
>> > > > > > > > > --
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > It's my first time using Tomcat, been a Resin
user
>> > > > > > > > > for years ... any ideas?
>> > > > > > > > >
>> > > > > > > > > Thanks,
>> > > > > > > > >
>> > > > > > > > > Stef
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > ----- Original Message -----
>> > > > > > > > > From: "Mark Thomas" <markt@apache.org>
>> > > > > > > > > To: "'Tomcat Users List'"
>> > > > > > > > > <tomcat-user@jakarta.apache.org>
>> > > > > > > > > Sent: Sunday, November 21, 2004 12:10 PM
>> > > > > > > > > Subject: RE: CGI Again...Servlet.service()
for
>> > > > > > > > > servlet cgi threw exception
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > > > > I'll look into this but I need a bit
more info:
>> > > > > > > > > >
>> > > > > > > > > > 1. What servlet mapping did you specify
in
>> > > > > > > > > web.xml?
>> > > > > > > > > > 2. What URL are you requesting?
>> > > > > > > > > >
>> > > > > > > > > > Mark
>> > > > > > > > > >
>> > > > > > > > > > > -----Original Message-----
>> > > > > > > > > > > From: Sergey Kamshilin
>> > > > > > > > > [mailto:skamshil@convedia.com]
>> > > > > > > > > > > Sent: Saturday, November 20, 2004
12:00 AM
>> > > > > > > > > > > To: tomcat-user@jakarta.apache.org
>> > > > > > > > > > > Subject: CGI Again...Servlet.service()
for
>> > > > > > > > > servlet cgi threw exception
>> > > > > > > > > > >
>> > > > > > > > > > > Sorry guys, I gave up digging into
it and
>> > > > > > > > > haven't seen such
>> > > > > > > > > > > problems in
>> > > > > > > > > > > archives...
>> > > > > > > > > > >
>> > > > > > > > > > > Tomcat 4.1.31 on Solaris.
>> > > > > > > > > > >
>> > > > > > > > > > > I enabled cgi scripting:
>> > > > > > > > > > > changes in web.xml:
>> > > > > > > > > > > ------
>> > > > > > > > > > >     <servlet>
>> > > > > > > > > > >         <servlet-name>cgi</servlet-name>
>> > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > >
><servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
>> > > > > > > > > > >         <init-param>
>> > > > > > > > > > >           <param-name>debug</param-name>
>> > > > > > > > > > >           <param-value>6</param-value>
>> > > > > > > > > > >         </init-param>
>> > > > > > > > > > >         <init-param>
>> > > > > > > > > > >           <param-name>cgiPathPrefix</param-name>
>> > > > > > > > > > >
>> > > > > > > > > <param-value>/WEB-INF/cgi-bin/</param-value>
>> > > > > > > > > > >         </init-param>
>> > > > > > > > > > >         <load-on-startup>5</load-on-startup>
>> > > > > > > > > > >     </servlet>
>> > > > > > > > > > > ------
>> > > > > > > > > > > renamed servlets-cgi.jar....
>> > > > > > > > > > >
>> > > > > > > > > > > The script is
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
/usr/jakarta-tomcat/webapps/ROOT/WEB-INF/cgi-bin/index.pl
>> > > > > > > > > > > (Everything is OK, Right?)
>> > > > > > > > > > > ------------
>> > > > > > > > > > > when I try to access it I got the
error:
>> > > > > > > > > > > 2004-11-19 15:53:15 cgi: findCGI:
>> > > > > > > > > path=/index.cgi,
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
/usr/jakarta-tomcat-4.1.31/webapps/ROOT//WEB-INF/cgi-bin/
>> > > > > > > > > > > 2004-11-19 15:53:15 cgi: findCGI:
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > currentLoc=/usr/jakarta-tomcat-4.1.31/webapps/ROOT/WEB-INF/cgi-bin
>> > > > > > > > > > > 2004-11-19 15:53:15 cgi: findCGI:
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > currentLoc=/usr/jakarta-tomcat-4.1.31/webapps/ROOT/WEB-INF/cgi-bin
>> > > > > > > > > > > 2004-11-19 15:53:15 cgi: findCGI:
FOUND cgi at
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > /usr/jakarta-tomcat-4.1.31/webapps/ROOT/WEB-INF/cgi-bin/index.cgi
>> > > > > > > > > > > 2004-11-19 15:53:15 StandardWrapperValve[cgi]:
>> > > > > > > > > > > Servlet.service() for servlet
>> > > > > > > > > > > cgi threw exception
>> > > > > > > > > > > java.lang.StringIndexOutOfBoundsException:
>> > > > > > > > > String index out
>> > > > > > > > > > > of range: -2
>> > > > > > > > > > >         at
>> > > > > > > > > java.lang.String.substring(String.java:1444)
>> > > > > > > > > > >         at
>> > > > > > > > > java.lang.String.substring(String.java:1411)
>> > > > > > > > > > >         at
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>org.apache.catalina.servlets.CGIServlet$CGIEnvironment.findCGI
>> > > > > > > > > > > (CGIServlet.ja
>> > > > > > > > > > > va:935)
>> > > > > > > > > > > ------------
>> > > > > > > > > > > Why the servlet makes exception????
What else I
>> > > > > > > > > need to check?
>> > > > > > > > > > >
>> > > > > > > > > > > Thank you!
>> > > > > > > > > > >
>> > > > > > > > > > > /Sergeyk
>> > > > > > > > > > >
>> > > > > > > > > > > (Lab Documentation -
>> > > > > > > > > > > "\\Lizard\rad\DraftDocs\msv\ctn\1290
Lab network
>> > > > > > > > > description")
>> > > > > > > > > > > Phone: 604 918-6360
>> > > > > > > > > > > Cell:  604 351-8966
>> > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > > > >
>> > > > > > > > >
>> > > > > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > > > > > > > > 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
>> > > > > > > > >
>> > > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > __________________________________
>> > > > > > > > Do you Yahoo!?
>> > > > > > > > Meet the all-new My Yahoo! - Try it today!
>> > > > > > > > http://my.yahoo.com
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > > > > > 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
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > > 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
>> > >
>> >
>> >
>> >
---------------------------------------------------------------------
>> > 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




This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


---------------------------------------------------------------------
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


Mime
View raw message