RE: method="post" but doGet() called -> external redirects

2004-03-24 Thread Liviu Ionescu
> I am assuming you have a servlet at /mycontext-app/ ?

that's correct.

> Can't you just map the servlet instead to /mycontext ?

as far as I know I can't, the servlet for mycontext-app belongs to a
separate webapp/context, while /mycontext in the root context.

if we would have an "allowInternalRedirects=true" in the context definition
to avoid issuing the 302 Redirect response and replace it with forwarding,
this would have been solved in a very elegant way.

> Or am I missing something?

?? or maybe I am missing something?

> Alternatively, is it possible to change your clients to add 
> that extra / so: /mycontext/?x=a

nope, embedded devices.


regards,

Liviu


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: method="post" but doGet() called -> external redirects

2004-03-24 Thread Adam Fowler
I am assuming you have a servlet at /mycontext-app/ ?

Can't you just map the servlet instead to /mycontext ?

Or am I missing something?

Alternatively, is it possible to change your clients to add that extra / so:
/mycontext/?x=a

Adam.

-Original Message-
From: Liviu Ionescu [mailto:[EMAIL PROTECTED]
Sent: 24 March 2004 11:51
To: 'Tomcat Users List'
Subject: RE: method="post" but doGet() called -> external redirects


> When Tomcat sees a request for 
> 'http://localhost:8080/mycontext' it sends back a response to 
> redirect to 'http://localhost:8080/mycontext/'.  This is so 
> that relative links to things like images and stylesheets 
> work correctly. If the browser conformed to the HTTP/1.1 RFC, 
> it would re-request the new URL with a POST, but I don't know 
> of any browsers that do this.

would it be possible to add a configuration parameter to certain contexts so
that the external redirects are replaced by internal forwardings?

I have a m2m application where the clients are not browsers, but simple
dedicated devices that do not implement redirects, and their standard way of
accessing the server is .../mycontext?x=a, so without a trailing '/'.

Since I could not find a url rewrite mechanism, like in Apache, I had to use
a dirty trick, I renamed my context to mycontext-app and I wrote a servlet
in the root context to forward requests from "/mycontext" to
"/mycontext-app/" (beware that .forward() is usually called in the current
context, if another context is needed it should be retrieved first)

having the rewrite done directly by Tomcat (is the DefaultServlet handling
this?) would be a more appropriate solution, imho.

regards,

Liviu


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_

This email and any files attached is intended for the addressee only and may contain 
information that is confidential and/or legally privileged. Unauthorised use is 
strictly prohibited and may be unlawful. If you are not the addressee, you should not 
read, copy, disclose or otherwise use this message, including any attachment, except 
for the purpose of delivery to the addressee.

We make every effort to keep our network free from viruses. However, you do need to 
verify this e-mail and any attachments to it to be virus free as we can take no 
responsibility for any computer virus which might be transferred by way of this e-mail.

Scanning of this message and addition of this footer is performed by SurfControl 
E-mail Filter software in conjunction with virus detection software.





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: method="post" but doGet() called -> external redirects

2004-03-24 Thread Liviu Ionescu
> When Tomcat sees a request for 
> 'http://localhost:8080/mycontext' it sends back a response to 
> redirect to 'http://localhost:8080/mycontext/'.  This is so 
> that relative links to things like images and stylesheets 
> work correctly. If the browser conformed to the HTTP/1.1 RFC, 
> it would re-request the new URL with a POST, but I don't know 
> of any browsers that do this.

would it be possible to add a configuration parameter to certain contexts so
that the external redirects are replaced by internal forwardings?

I have a m2m application where the clients are not browsers, but simple
dedicated devices that do not implement redirects, and their standard way of
accessing the server is .../mycontext?x=a, so without a trailing '/'.

Since I could not find a url rewrite mechanism, like in Apache, I had to use
a dirty trick, I renamed my context to mycontext-app and I wrote a servlet
in the root context to forward requests from "/mycontext" to
"/mycontext-app/" (beware that .forward() is usually called in the current
context, if another context is needed it should be retrieved first)

having the rewrite done directly by Tomcat (is the DefaultServlet handling
this?) would be a more appropriate solution, imho.

regards,

Liviu


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SV: method="post" but doGet() called

2004-03-22 Thread Uwe Kubosch
> When Tomcat sees a request for 'http://localhost:8080/mycontext' it sends
> back a response to redirect to
> 'http://localhost:8080/mycontext/'.  This is
> so that relative links to things like images and stylesheets work
> correctly.
> If the browser conformed to the HTTP/1.1 RFC, it would re-request the new
> URL with a POST, but I don't know of any browsers that do this.

Thank's a million.  So I shouldn't spend more time trying to fix it?  Rather
I should add the trailing "/" myself to avoid the redirect?


donV


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: method="post" but doGet() called

2004-03-21 Thread Bill Barker
When Tomcat sees a request for 'http://localhost:8080/mycontext' it sends
back a response to redirect to 'http://localhost:8080/mycontext/'.  This is
so that relative links to things like images and stylesheets work correctly.
If the browser conformed to the HTTP/1.1 RFC, it would re-request the new
URL with a POST, but I don't know of any browsers that do this.

"Uwe Kubosch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all!
>
> I have a form (included below) where I set method="post", but for for a
> specific action URL, it  arrived in the doGet method instead of the doPost
> method.
>
> I have a seervlet-mapping that pics up _all_ resquests to the context:
>
> /
>
> The unexpected behaviour comes when there is nothing after the context in
> the action URL:
>
> http://localhost:8080/mycontext
>
> This arrives in doGet.
>
> Putting something after the context works:
>
> http://localhost:8080/mycontext/stuff
>
> This arrives in doPost.
>
> Is this correct behaviour?  I am using Opera as browser.  Should this make
a
> difference?
>
>
> 
> 
> Access Denied
> 
> 
> Access denied!
> 
>
>
>
> 
> 
> 
> 
> Login
> 
>
> 
>  action="http://localhost:8080/espresso";>
> 
> 
> 
> 
> Login type="text" name="EspressoUID" value="root" size="10">
> Password type="password" name="EspressoPWD" value="" size="10"
> nonChange='document.loginForm.submit()'>
>  type="submit" name="cmd" value="Login">
> 
> if
> (document.loginForm.EspressoUID.value.length == 0)
> {document.loginForm.EspressoUID.focus();} else
> {document.loginForm.EspressoPWD.focus();}
> 
> 
> 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



method="post" but doGet() called

2004-03-21 Thread Uwe Kubosch
Hi all!

I have a form (included below) where I set method="post", but for for a
specific action URL, it  arrived in the doGet method instead of the doPost
method.

I have a seervlet-mapping that pics up _all_ resquests to the context:

/

The unexpected behaviour comes when there is nothing after the context in
the action URL:

http://localhost:8080/mycontext

This arrives in doGet.

Putting something after the context works:

http://localhost:8080/mycontext/stuff

This arrives in doPost.

Is this correct behaviour?  I am using Opera as browser.  Should this make a
difference?




Access Denied


Access denied!








Login



http://localhost:8080/espresso";>




Login
Password


if
(document.loginForm.EspressoUID.value.length == 0)
{document.loginForm.EspressoUID.focus();} else
{document.loginForm.EspressoPWD.focus();}





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]