You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Remigiusz Andrzejak <re...@yahoo.com> on 2008/10/29 12:43:43 UTC

Fw: Problem with form processing using doGet




----- Forwarded Message ----
From: Remigiusz Andrzejak <re...@yahoo.com>
To: users@tomcat.apache.org
Sent: Wednesday, October 29, 2008 12:33:37 PM
Subject: Problem with form processing using doGet


Hello,

I developed a simple web application using Eclipse.

Having it unit tested I created war using command: jar -cf MyApp.war *

I deployed the war file on Tomcat 5.5.20 on the PC where I developed the application. Still, everything worked fine.

However, when I moved the war file to a different PC (I tried two different ones) with analogical set-up,

some of my servlets no longer work. I noticed the problematic ones are those using doGet.

What is strange is that Tomcat doesn't give me exception: resource not found.

Instead nor doGet, nor doPost seem to be called for those servlets.

What might be the source of the problem is the way servlets are invoked.

Here is an example of what I have in HTML page to get a picture served by my servlet:

<img src="/Wedding/imageGetter?source=images&id=cal.gif" width="16" height="16" border="0" alt="Wybierz datÄ™">

Any help will be appreciated.

Regards,
Remik


      

Re: Fw: Problem with form processing using doGet

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remigiusz,

Remigiusz Andrzejak wrote:
> What is strange is that Tomcat doesn't give me exception: resource not found.

Could you provide a stack trace for that error?

> Instead nor doGet, nor doPost seem to be called for those servlets.
> 
> What might be the source of the problem is the way servlets are invoked.
> 
> Here is an example of what I have in HTML page to get a picture served by my servlet:
> 
> <img src="/Wedding/imageGetter?source=images&id=cal.gif" width="16" height="16" border="0" alt="Wybierz datÄ™">

You might want to check to see that the context name is the same between
machines. You are going to want to change all your links to point to
something like this:

<img src="<%= request.getContextPath() %>/Wedding/imageGetter?..." />

This allows you to relocate your webapp without having to change your
URLs all the time.

While you're at it, you should add a call to request.encodeURL() in
there so that non-cookie-using clients will work, too. ;)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkQyvkACgkQ9CaO5/Lv0PCb+ACfTxbBihOrkzdQIj+NJ4ePmYhq
08EAn0omOotVRK30C1VeNEIzwx+dUHKE
=s5VX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org