You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by pc3 <pe...@gmail.com> on 2007/01/22 20:04:44 UTC

Catch-All App

Hey folks,

I have a webapp at

http://www.myhost.com/foo

I'd like to configure a "catch-all" web application that will take all
requests for any context other than foo and have them handled by a single
jsp / servlet... so I can redirect them into the /foo webapp.

E.g. people who request

http://www.myhost.com/bar
http://www.myhost.com/stink
http://www.myhost.com/woohooo

... will go to a single JSP (or whatever I can use.. deployed as one webapp
hopefully).. where I can read the context off the URL and direct them
somewhere into my webapp...

Thanks! 
-- 
View this message in context: http://www.nabble.com/Catch-All-App-tf3059593.html#a8507515
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Catch-All App

Posted by pc3 <pe...@gmail.com>.
What about just configuring a "global" 404 handler to direct to my JSP... but
I can't find where to configure a server-wide 404 handler. running
geronimo/tomcat




David Woldrich wrote:
> 
> For my app, using deploy.bat, I removed the default app that ships with 
> Geronimo that squats on the context root at /.  And then in my app, I 
> set the context root set at /.  I suppose you could have a servlet that 
> just matches on * and then it would match everything at your context 
> root ...
> 
> I'm just making up the following, haven't tested it or anything, YMMV.
> 
> In your WAR, web.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="MyWebApp" version="2.4" 
> xmlns="http://java.sun.com/xml/ns/j2ee" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>     <display-name>My WebApp</display-name>
>     <servlet>
>         <description>MyServlet serves up everything!</description>
>         <display-name>MyServlet</display-name>
>         <servlet-name>MyServlet</servlet-name>
>         <servlet-class>com.woldrich.MyServlet</servlet-class>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>MyServlet</servlet-name>
>         <url-pattern>/*</url-pattern>
>     </servlet-mapping>
> </web-app>
> 
> Then in the EAR that contains the WAR, application.xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <application id="MyApp" version="1.4" 
> xmlns="http://java.sun.com/xml/ns/j2ee" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
> http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
>     <display-name>MyApp</display-name>
>     <module id="WebModule_1100120000968">
>         <web>
>             <web-uri>MyWebApp.war</web-uri>
>             <context-root>/</context-root>
>         </web>
>     </module>
> </application>
> 
> Cheers,
> Dave Woldrich
> http://cardmeeting.com
> 
> pc3 wrote:
>> Thanks.. but yeah, we have tomcat 5.5.15 running w/ gero
>>
>> Does anyone know how to do it with tc?
>> Pete
>>
>>
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Catch-All-App-tf3059593.html#a8807910
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Catch-All App

Posted by David Woldrich <da...@woldrich.com>.
For my app, using deploy.bat, I removed the default app that ships with 
Geronimo that squats on the context root at /.  And then in my app, I 
set the context root set at /.  I suppose you could have a servlet that 
just matches on * and then it would match everything at your context 
root ...

I'm just making up the following, haven't tested it or anything, YMMV.

In your WAR, web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="MyWebApp" version="2.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>My WebApp</display-name>
    <servlet>
        <description>MyServlet serves up everything!</description>
        <display-name>MyServlet</display-name>
        <servlet-name>MyServlet</servlet-name>
        <servlet-class>com.woldrich.MyServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>MyServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

Then in the EAR that contains the WAR, application.xml:

<?xml version="1.0" encoding="UTF-8"?>
<application id="MyApp" version="1.4" 
xmlns="http://java.sun.com/xml/ns/j2ee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
    <display-name>MyApp</display-name>
    <module id="WebModule_1100120000968">
        <web>
            <web-uri>MyWebApp.war</web-uri>
            <context-root>/</context-root>
        </web>
    </module>
</application>

Cheers,
Dave Woldrich
http://cardmeeting.com

pc3 wrote:
> Thanks.. but yeah, we have tomcat 5.5.15 running w/ gero
>
> Does anyone know how to do it with tc?
> Pete
>
>
>
>   


Re: Catch-All App

Posted by pc3 <pe...@gmail.com>.
Sorry I meant to reply to this branch
What about just configuring a "global" 404 handler to direct to my JSP...
but I can't find where to configure a server-wide 404 handler. running
geronimo/tomcat 



Nicholas Irving wrote:
> 
> Okay, how about this http://tuckey.org/urlrewrite/
> 
> On 23/01/07, pc3 <pe...@gmail.com> wrote:
>>
>>
>> Thanks.. but yeah, we have tomcat 5.5.15 running w/ gero
>>
>> Does anyone know how to do it with tc?
>> Pete
>>
>>
>>
>> Nicholas Irving wrote:
>> >
>> > One way is to use mod_rewrite in Apache.
>> >
>> > <IfModule mod_rewrite.c>
>> > RewriteEngine On
>> > RewriteBase /
>> > RewriteCond %{REQUEST_FILENAME} !-f
>> > RewriteCond %{REQUEST_FILENAME} !-d
>> > RewriteRule . /foo/index.jsp [L]
>> > </IfModule>
>> >
>> >
>> > Not sure so sure about how to do this with Tomcat.
>> >
>> > Nicholas Irving
>> > nirving@darkedges.com
>> >
>> > pc3 wrote:
>> >> Hey folks,
>> >>
>> >> I have a webapp at
>> >>
>> >> http://www.myhost.com/foo
>> >>
>> >> I'd like to configure a "catch-all" web application that will take all
>> >> requests for any context other than foo and have them handled by a
>> single
>> >> jsp / servlet... so I can redirect them into the /foo webapp.
>> >>
>> >> E.g. people who request
>> >>
>> >> http://www.myhost.com/bar
>> >> http://www.myhost.com/stink
>> >> http://www.myhost.com/woohooo
>> >>
>> >> ... will go to a single JSP (or whatever I can use.. deployed as one
>> >> webapp
>> >> hopefully).. where I can read the context off the URL and direct them
>> >> somewhere into my webapp...
>> >>
>> >> Thanks!
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Catch-All-App-tf3059593.html#a8513379
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Catch-All-App-tf3059593.html#a8807929
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Catch-All App

Posted by Nicholas Irving <ni...@darkedges.com>.
Okay, how about this http://tuckey.org/urlrewrite/

On 23/01/07, pc3 <pe...@gmail.com> wrote:
>
>
> Thanks.. but yeah, we have tomcat 5.5.15 running w/ gero
>
> Does anyone know how to do it with tc?
> Pete
>
>
>
> Nicholas Irving wrote:
> >
> > One way is to use mod_rewrite in Apache.
> >
> > <IfModule mod_rewrite.c>
> > RewriteEngine On
> > RewriteBase /
> > RewriteCond %{REQUEST_FILENAME} !-f
> > RewriteCond %{REQUEST_FILENAME} !-d
> > RewriteRule . /foo/index.jsp [L]
> > </IfModule>
> >
> >
> > Not sure so sure about how to do this with Tomcat.
> >
> > Nicholas Irving
> > nirving@darkedges.com
> >
> > pc3 wrote:
> >> Hey folks,
> >>
> >> I have a webapp at
> >>
> >> http://www.myhost.com/foo
> >>
> >> I'd like to configure a "catch-all" web application that will take all
> >> requests for any context other than foo and have them handled by a
> single
> >> jsp / servlet... so I can redirect them into the /foo webapp.
> >>
> >> E.g. people who request
> >>
> >> http://www.myhost.com/bar
> >> http://www.myhost.com/stink
> >> http://www.myhost.com/woohooo
> >>
> >> ... will go to a single JSP (or whatever I can use.. deployed as one
> >> webapp
> >> hopefully).. where I can read the context off the URL and direct them
> >> somewhere into my webapp...
> >>
> >> Thanks!
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Catch-All-App-tf3059593.html#a8513379
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Re: Catch-All App

Posted by pc3 <pe...@gmail.com>.
Thanks.. but yeah, we have tomcat 5.5.15 running w/ gero

Does anyone know how to do it with tc?
Pete



Nicholas Irving wrote:
> 
> One way is to use mod_rewrite in Apache.
> 
> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteBase /
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule . /foo/index.jsp [L]
> </IfModule>
> 
> 
> Not sure so sure about how to do this with Tomcat.
> 
> Nicholas Irving
> nirving@darkedges.com
> 
> pc3 wrote:
>> Hey folks,
>>
>> I have a webapp at
>>
>> http://www.myhost.com/foo
>>
>> I'd like to configure a "catch-all" web application that will take all
>> requests for any context other than foo and have them handled by a single
>> jsp / servlet... so I can redirect them into the /foo webapp.
>>
>> E.g. people who request
>>
>> http://www.myhost.com/bar
>> http://www.myhost.com/stink
>> http://www.myhost.com/woohooo
>>
>> ... will go to a single JSP (or whatever I can use.. deployed as one
>> webapp
>> hopefully).. where I can read the context off the URL and direct them
>> somewhere into my webapp...
>>
>> Thanks! 
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/Catch-All-App-tf3059593.html#a8513379
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: Catch-All App

Posted by Nicholas Irving <ni...@darkedges.com>.
One way is to use mod_rewrite in Apache.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /foo/index.jsp [L]
</IfModule>


Not sure so sure about how to do this with Tomcat.

Nicholas Irving
nirving@darkedges.com

pc3 wrote:
> Hey folks,
>
> I have a webapp at
>
> http://www.myhost.com/foo
>
> I'd like to configure a "catch-all" web application that will take all
> requests for any context other than foo and have them handled by a single
> jsp / servlet... so I can redirect them into the /foo webapp.
>
> E.g. people who request
>
> http://www.myhost.com/bar
> http://www.myhost.com/stink
> http://www.myhost.com/woohooo
>
> ... will go to a single JSP (or whatever I can use.. deployed as one webapp
> hopefully).. where I can read the context off the URL and direct them
> somewhere into my webapp...
>
> Thanks! 
>   

Re: Problem extracting Geronimo on windows:

Posted by paksegu <pa...@yahoo.com>.
i amusing the defualt extracter that comes with window xp, i will try winzip and see

Hernan Cunico <hc...@gmail.com> wrote:  I tested several downloads and cannot see any problem extracting the files. I also tried different tools for extracting.
what are you using? how old is it?

Cheers!
Hernan

paksegu wrote:
> http://www.apache.org/dyn/closer.cgi/geronimo/2.0-M2/geronimo-tomcat6-jee5-2.0-M2-bin.zip
> 
> Thanks
> 
> */Hernan Cunico /* wrote:
> 
> weird, can you post the link you are downloading it from?
> 
> Cheers!
> Hernan
> 
> paksegu wrote:
> > Hi I am having problems extracting Geronimo on windows it says
> file is
> > password protected
> >
> > */Thanks/*
> >
> > Ransford Segu-Baffoe
> >
> > paksegu@yahoo.com
> > paksegu@NoqturnalMediaSystems.com
> >
> > http://www.noqturnalmediasystems.com/
> > http://www.noqturnalmediasystems.com/Serenade/
> > https://serenade.dev.java.net/
> >
> >
> ------------------------------------------------------------------------
> > Get your own web address.
> >
> > Have a HUGE year through Yahoo! Small Business. <
> >
> http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL>
> 
> >
> 
> 
> 
> 
> Ransford Segu-Baffoe
> 
> paksegu@yahoo.com
> paksegu@NoqturnalMediaSystems.com
> 
> http://www.noqturnalmediasystems.com/
> http://www.noqturnalmediasystems.com/Serenade/
> https://serenade.dev.java.net/
> 
> ------------------------------------------------------------------------
> TV dinner still cooling?
> Check out "Tonight's Picks" 
> on Yahoo! TV.



Ransford Segu-Baffoe

paksegu@yahoo.com
paksegu@NoqturnalMediaSystems.com

http://www.noqturnalmediasystems.com/
http://www.noqturnalmediasystems.com/Serenade/
https://serenade.dev.java.net/
 
---------------------------------
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.

Re: Problem extracting Geronimo on windows:

Posted by Hernan Cunico <hc...@gmail.com>.
I tested several downloads and cannot see any problem extracting the files. I also tried different tools for extracting.
what are you using? how old is it?

Cheers!
Hernan

paksegu wrote:
> http://www.apache.org/dyn/closer.cgi/geronimo/2.0-M2/geronimo-tomcat6-jee5-2.0-M2-bin.zip
>  
> Thanks
> 
> */Hernan Cunico <hc...@gmail.com>/* wrote:
> 
>     weird, can you post the link you are downloading it from?
> 
>     Cheers!
>     Hernan
> 
>     paksegu wrote:
>      > Hi I am having problems extracting Geronimo on windows it says
>     file is
>      > password protected
>      >
>      > */Thanks/*
>      >
>      > Ransford Segu-Baffoe
>      >
>      > paksegu@yahoo.com
>      > paksegu@NoqturnalMediaSystems.com
>      >
>      > http://www.noqturnalmediasystems.com/
>      > http://www.noqturnalmediasystems.com/Serenade/
>      > https://serenade.dev.java.net/
>      >
>      >
>     ------------------------------------------------------------------------
>      > Get your own web address.
>      >
>      > Have a HUGE year through Yahoo! Small Business. <
>      >
>     http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL>
> 
>      >
> 
> 
> 
> 
> Ransford Segu-Baffoe
> 
> paksegu@yahoo.com
> paksegu@NoqturnalMediaSystems.com
> 
> http://www.noqturnalmediasystems.com/
> http://www.noqturnalmediasystems.com/Serenade/
> https://serenade.dev.java.net/
> 
> ------------------------------------------------------------------------
> TV dinner still cooling?
> Check out "Tonight's Picks" 
> <http://us.rd.yahoo.com/evt=49979/*http://tv.yahoo.com/> on Yahoo! TV.

Re: Problem extracting Geronimo on windows:

Posted by paksegu <pa...@yahoo.com>.
http://www.apache.org/dyn/closer.cgi/geronimo/2.0-M2/geronimo-tomcat6-jee5-2.0-M2-bin.zip
   
  Thanks

Hernan Cunico <hc...@gmail.com> wrote:
  weird, can you post the link you are downloading it from?

Cheers!
Hernan

paksegu wrote:
> Hi I am having problems extracting Geronimo on windows it says file is 
> password protected
> 
> */Thanks/*
> 
> Ransford Segu-Baffoe
> 
> paksegu@yahoo.com
> paksegu@NoqturnalMediaSystems.com
> 
> http://www.noqturnalmediasystems.com/
> http://www.noqturnalmediasystems.com/Serenade/
> https://serenade.dev.java.net/
> 
> ------------------------------------------------------------------------
> Get your own web address. 
> 
> Have a HUGE year through Yahoo! Small Business. < 
> http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL> 
> 



Ransford Segu-Baffoe

paksegu@yahoo.com
paksegu@NoqturnalMediaSystems.com

http://www.noqturnalmediasystems.com/
http://www.noqturnalmediasystems.com/Serenade/
https://serenade.dev.java.net/
 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.

Re: Problem extracting Geronimo on windows:

Posted by Hernan Cunico <hc...@gmail.com>.
weird, can you post the link you are downloading it from?

Cheers!
Hernan

paksegu wrote:
> Hi I am having problems extracting Geronimo on windows it says file is 
> password protected
> 
> */Thanks/*
> 
> Ransford Segu-Baffoe
> 
> paksegu@yahoo.com
> paksegu@NoqturnalMediaSystems.com
> 
> http://www.noqturnalmediasystems.com/
> http://www.noqturnalmediasystems.com/Serenade/
> https://serenade.dev.java.net/
> 
> ------------------------------------------------------------------------
> Get your own web address. 
> <http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL>
> Have a HUGE year through Yahoo! Small Business. < 
> http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL> 
> 

Problem extracting Geronimo on windows:

Posted by paksegu <pa...@yahoo.com>.
Hi I am having problems extracting Geronimo on windows it says file is password protected

Thanks

Ransford Segu-Baffoe

paksegu@yahoo.com
paksegu@NoqturnalMediaSystems.com

http://www.noqturnalmediasystems.com/
http://www.noqturnalmediasystems.com/Serenade/
https://serenade.dev.java.net/
 
---------------------------------
 Get your own web address.
 Have a HUGE year through Yahoo! Small Business.

Re: Catch-All App

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
I think the best way to do this is, as someone else noted, to replace
the "welcome" application that ships with Geronimo.  The application
assigned to "/" will receive requests to any path that a different
application doesn't cover, and you can assign a servlet to receive all
requests and redirect to or forward to your JSP.

Geronimo does something similar out of the box for the samples.  We
have the welcome application listen on the path that each sample
should be bound to (e.g. /jsp-examples/* or whatever).  If the sample
is installed and running and you go to that URL, the sample app will
receive the request.  If that sample is not installed, the welcome app
will receive the request, download and install the sample, then
redirect to the same URL which will then end up going to the newly
installed sample instead.

Thanks,
      Aaron

On 1/22/07, pc3 <pe...@gmail.com> wrote:
>
> Hey folks,
>
> I have a webapp at
>
> http://www.myhost.com/foo
>
> I'd like to configure a "catch-all" web application that will take all
> requests for any context other than foo and have them handled by a single
> jsp / servlet... so I can redirect them into the /foo webapp.
>
> E.g. people who request
>
> http://www.myhost.com/bar
> http://www.myhost.com/stink
> http://www.myhost.com/woohooo
>
> ... will go to a single JSP (or whatever I can use.. deployed as one webapp
> hopefully).. where I can read the context off the URL and direct them
> somewhere into my webapp...
>
> Thanks!
> --
> View this message in context: http://www.nabble.com/Catch-All-App-tf3059593.html#a8507515
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>