You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Marcel Schepers <ma...@gmail.com> on 2006/03/18 11:44:38 UTC
how to deal with case sensitivity
Hello,
I have a Tapestry 3.0.3 application running on Windows 2003 Server. The
application has a bookmarkable page 'ShowVacancy' which requires a String
parameter. I have pasted such an URL as an example.
http://www.jobstoday.nl/app?service=external/ShowVacancy&sp=Sd315d5a00a02bfd0010a090644fb0014
Now the site is being spidered by a fairly strange spider. It has all the
information that is required, including a valid vacancy identifier, however
for some reason it uses only URL's consisting of lower case characters, the
url used by this spider is:
http://www.jobstoday.nl/app?service=external/showvacancy&sp=sd315d5a00a02bfd0010a090644fb0014
('showvacancy' instead of 'ShowVacancy' and 'sd....' instead of 'Sd...')
I do not know why the spider converts valid mixed case URLs to lower case
only URLs, but I looking for a strategy to handle this. At the moment the
application's exception page is shown. But I am not satisfied with the
Exception page. There is no exception, a 404 would be better, won't it? What
is the correct way to handle this?
Have a nice day,
Marcel
Re: how to deal with case sensitivity
Posted by Marcel Schepers <ma...@gmail.com>.
I have chosen for another solution.
The application already required a derived BaseEngine. I've overridden the
'activateExceptionPage'. In case a non-existing page is requested the
message of the incoming ApplicationRuntimeException ends with 'not found in
application namespace.'. The trick is to check for this message ending and
if so, send a 404 response code. In all other cases the
activateExceptionPage of the super class is called. Not so elegant, but it
does the trick.
While looking for a way to handle this, I also found a solution when using
T4:
http://thread.gmane.org/gmane.comp.java.tapestry.user/24228
Have a nice day,
Marcel
On 3/18/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> Hi,
>
> im not 100% sure on this, but it might work to send a return "404", where
> 404.html is a error page with a 404.page containing the necessary things
> as
> well as the 404.java should use renderPage() to set response.setHeader
> ("code
> 404") or sth like that... i personally dont know a solution either. This
> construct above is similar to what you do when you output sth. other than
> normal html
>
> and for the wrong ones on /App etc. - you need to specify this 404 page as
> an code404 error page for tomcat,too
>
> Regards
>
>
> PS: please let me know if this works - i'm going to have that same need
> sooner or later
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Marcel Schepers [mailto:marcel.schepers@gmail.com]
> > Gesendet: Samstag, 18. März 2006 12:47
> > An: Tapestry users
> > Betreff: Re: how to deal with case sensitivity
> >
> > Yes, that is exactly what I am planning to do. Now the trick
> > seems to be to send a 404 if the page does not exist. The
> > PageSpecificationResolver throws a generic
> > ApplicationRuntimeException if it can not find the page. How
> > to send a 404 without modifying the Tapestry core library.
> >
> > Marcel
> >
> > On 3/18/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> > >
> > > Hi,
> > >
> > > the correct way to handel this is a code 404 - if you ever
> > go on any
> > > static unix/ linux webserver and misstype the case, youll get a 404.
> > >
> > > And if the programmer of the spider is not keen enough of this its
> > > just his problem.
> > >
> > > BTW: Even google itself for example handles it this way:
> > >
> > > valid: http://www.google.de/imghp?hl=de&tab=wi&q=
> > > non valid (404): http://www.google.de/Imghp?hl=de&tab=wi&q=
> > >
> > > Regards,
> > >
> > > Korbinian
> > >
> > > PS: the spider-programmer soon will see that he gets loads
> > and loads
> > > of 404s this way and eventually see that he may have a bug in his
> > > spider
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: Marcel Schepers [mailto:marcel.schepers@gmail.com]
> > > > Gesendet: Samstag, 18. März 2006 11:45
> > > > An: Tapestry users
> > > > Betreff: how to deal with case sensitivity
> > > >
> > > > Hello,
> > > >
> > > > I have a Tapestry 3.0.3 application running on Windows
> > 2003 Server.
> > > > The application has a bookmarkable page 'ShowVacancy'
> > > > which requires a String parameter. I have pasted such an
> > URL as an
> > > > example.
> > > >
> > > > http://www.jobstoday.nl/app?service=external/ShowVacancy&sp=Sd
> > > 315d5a00a02bfd0010a090644fb0014
> > > >
> > > > Now the site is being spidered by a fairly strange spider. It has
> > > > all the information that is required, including a valid vacancy
> > > > identifier, however for some reason it uses only URL's
> > consisting of
> > > > lower case characters, the url used by this spider is:
> > > >
> > > > http://www.jobstoday.nl/app?service=external/showvacancy&sp=sd
> > > 315d5a00a02bfd0010a090644fb0014
> > > > ('showvacancy' instead of 'ShowVacancy' and 'sd....' instead of
> > > > 'Sd...')
> > > >
> > > > I do not know why the spider converts valid mixed case
> > URLs to lower
> > > > case only URLs, but I looking for a strategy to handle
> > this. At the
> > > > moment the application's exception page is shown. But I am not
> > > > satisfied with the Exception page.
> > > > There is no exception, a 404 would be better, won't it?
> > What is the
> > > > correct way to handle this?
> > > >
> > > > Have a nice day,
> > > > Marcel
> > > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
AW: how to deal with case sensitivity
Posted by Korbinian Bachl <ko...@whiskyworld.de>.
Hi,
im not 100% sure on this, but it might work to send a return "404", where
404.html is a error page with a 404.page containing the necessary things as
well as the 404.java should use renderPage() to set response.setHeader("code
404") or sth like that... i personally dont know a solution either. This
construct above is similar to what you do when you output sth. other than
normal html
and for the wrong ones on /App etc. - you need to specify this 404 page as
an code404 error page for tomcat,too
Regards
PS: please let me know if this works - i'm going to have that same need
sooner or later
> -----Ursprüngliche Nachricht-----
> Von: Marcel Schepers [mailto:marcel.schepers@gmail.com]
> Gesendet: Samstag, 18. März 2006 12:47
> An: Tapestry users
> Betreff: Re: how to deal with case sensitivity
>
> Yes, that is exactly what I am planning to do. Now the trick
> seems to be to send a 404 if the page does not exist. The
> PageSpecificationResolver throws a generic
> ApplicationRuntimeException if it can not find the page. How
> to send a 404 without modifying the Tapestry core library.
>
> Marcel
>
> On 3/18/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
> >
> > Hi,
> >
> > the correct way to handel this is a code 404 - if you ever
> go on any
> > static unix/ linux webserver and misstype the case, youll get a 404.
> >
> > And if the programmer of the spider is not keen enough of this its
> > just his problem.
> >
> > BTW: Even google itself for example handles it this way:
> >
> > valid: http://www.google.de/imghp?hl=de&tab=wi&q=
> > non valid (404): http://www.google.de/Imghp?hl=de&tab=wi&q=
> >
> > Regards,
> >
> > Korbinian
> >
> > PS: the spider-programmer soon will see that he gets loads
> and loads
> > of 404s this way and eventually see that he may have a bug in his
> > spider
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Marcel Schepers [mailto:marcel.schepers@gmail.com]
> > > Gesendet: Samstag, 18. März 2006 11:45
> > > An: Tapestry users
> > > Betreff: how to deal with case sensitivity
> > >
> > > Hello,
> > >
> > > I have a Tapestry 3.0.3 application running on Windows
> 2003 Server.
> > > The application has a bookmarkable page 'ShowVacancy'
> > > which requires a String parameter. I have pasted such an
> URL as an
> > > example.
> > >
> > > http://www.jobstoday.nl/app?service=external/ShowVacancy&sp=Sd
> > 315d5a00a02bfd0010a090644fb0014
> > >
> > > Now the site is being spidered by a fairly strange spider. It has
> > > all the information that is required, including a valid vacancy
> > > identifier, however for some reason it uses only URL's
> consisting of
> > > lower case characters, the url used by this spider is:
> > >
> > > http://www.jobstoday.nl/app?service=external/showvacancy&sp=sd
> > 315d5a00a02bfd0010a090644fb0014
> > > ('showvacancy' instead of 'ShowVacancy' and 'sd....' instead of
> > > 'Sd...')
> > >
> > > I do not know why the spider converts valid mixed case
> URLs to lower
> > > case only URLs, but I looking for a strategy to handle
> this. At the
> > > moment the application's exception page is shown. But I am not
> > > satisfied with the Exception page.
> > > There is no exception, a 404 would be better, won't it?
> What is the
> > > correct way to handle this?
> > >
> > > Have a nice day,
> > > Marcel
> > >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to deal with case sensitivity
Posted by Marcel Schepers <ma...@gmail.com>.
Yes, that is exactly what I am planning to do. Now the trick seems to be to
send a 404 if the page does not exist. The PageSpecificationResolver throws
a generic ApplicationRuntimeException if it can not find the page. How to
send a 404 without modifying the Tapestry core library.
Marcel
On 3/18/06, Korbinian Bachl <ko...@whiskyworld.de> wrote:
>
> Hi,
>
> the correct way to handel this is a code 404 - if you ever go on any
> static
> unix/ linux webserver and misstype the case, youll get a 404.
>
> And if the programmer of the spider is not keen enough of this its just
> his
> problem.
>
> BTW: Even google itself for example handles it this way:
>
> valid: http://www.google.de/imghp?hl=de&tab=wi&q=
> non valid (404): http://www.google.de/Imghp?hl=de&tab=wi&q=
>
> Regards,
>
> Korbinian
>
> PS: the spider-programmer soon will see that he gets loads and loads of
> 404s
> this way and eventually see that he may have a bug in his spider
>
> > -----Ursprüngliche Nachricht-----
> > Von: Marcel Schepers [mailto:marcel.schepers@gmail.com]
> > Gesendet: Samstag, 18. März 2006 11:45
> > An: Tapestry users
> > Betreff: how to deal with case sensitivity
> >
> > Hello,
> >
> > I have a Tapestry 3.0.3 application running on Windows 2003
> > Server. The application has a bookmarkable page 'ShowVacancy'
> > which requires a String parameter. I have pasted such an URL
> > as an example.
> >
> > http://www.jobstoday.nl/app?service=external/ShowVacancy&sp=Sd
> 315d5a00a02bfd0010a090644fb0014
> >
> > Now the site is being spidered by a fairly strange spider. It
> > has all the information that is required, including a valid
> > vacancy identifier, however for some reason it uses only
> > URL's consisting of lower case characters, the url used by
> > this spider is:
> >
> > http://www.jobstoday.nl/app?service=external/showvacancy&sp=sd
> 315d5a00a02bfd0010a090644fb0014
> > ('showvacancy' instead of 'ShowVacancy' and 'sd....' instead
> > of 'Sd...')
> >
> > I do not know why the spider converts valid mixed case URLs
> > to lower case only URLs, but I looking for a strategy to
> > handle this. At the moment the application's exception page
> > is shown. But I am not satisfied with the Exception page.
> > There is no exception, a 404 would be better, won't it? What
> > is the correct way to handle this?
> >
> > Have a nice day,
> > Marcel
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
AW: how to deal with case sensitivity
Posted by Korbinian Bachl <ko...@whiskyworld.de>.
Hi,
the correct way to handel this is a code 404 - if you ever go on any static
unix/ linux webserver and misstype the case, youll get a 404.
And if the programmer of the spider is not keen enough of this its just his
problem.
BTW: Even google itself for example handles it this way:
valid: http://www.google.de/imghp?hl=de&tab=wi&q=
non valid (404): http://www.google.de/Imghp?hl=de&tab=wi&q=
Regards,
Korbinian
PS: the spider-programmer soon will see that he gets loads and loads of 404s
this way and eventually see that he may have a bug in his spider
> -----Ursprüngliche Nachricht-----
> Von: Marcel Schepers [mailto:marcel.schepers@gmail.com]
> Gesendet: Samstag, 18. März 2006 11:45
> An: Tapestry users
> Betreff: how to deal with case sensitivity
>
> Hello,
>
> I have a Tapestry 3.0.3 application running on Windows 2003
> Server. The application has a bookmarkable page 'ShowVacancy'
> which requires a String parameter. I have pasted such an URL
> as an example.
>
> http://www.jobstoday.nl/app?service=external/ShowVacancy&sp=Sd
315d5a00a02bfd0010a090644fb0014
>
> Now the site is being spidered by a fairly strange spider. It
> has all the information that is required, including a valid
> vacancy identifier, however for some reason it uses only
> URL's consisting of lower case characters, the url used by
> this spider is:
>
> http://www.jobstoday.nl/app?service=external/showvacancy&sp=sd
315d5a00a02bfd0010a090644fb0014
> ('showvacancy' instead of 'ShowVacancy' and 'sd....' instead
> of 'Sd...')
>
> I do not know why the spider converts valid mixed case URLs
> to lower case only URLs, but I looking for a strategy to
> handle this. At the moment the application's exception page
> is shown. But I am not satisfied with the Exception page.
> There is no exception, a 404 would be better, won't it? What
> is the correct way to handle this?
>
> Have a nice day,
> Marcel
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org