You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov> on 2011/08/24 16:56:47 UTC

Is there a way to bake in URL parameters to a URL path?

Hey Guys,

I had a question regarding Tomcat configuration. I see over and over folks building 
web apps that write custom code responsible for baking in URL parameters to some 
path. For example, let's say I have a web service located at:

http://myhost/books

that by default returns a listing of books in my book store in JSON format (format not 
important, but I just picked one to illustrate). The web service is just backed by a 
Java Servlet, and I know how to use Tomcat's web.xml file, or a context.xml file for 
example to configure the url path to my servlet and to my web application to set up 
the above situation. 

However, what I don't know how to do in Tomcat is to solve (by configuration), the 
following scenario. Let's say in the above example, my books have categories, like 
"fiction", "drama", "programming", "science", etc., and that the way I get my JSON 
listings from the web service in the above example is to pass a special request parameter
called "category", and set its value equal to the requested category, like:

http://myhost/books?category=fiction

To get fiction books, for illustration. What I would like to be able to do is to set up, via 
configuration, the ability to map a new URL, say:

http://myhost/fictionbooks 

To 

http://myhost/books?category=fiction

In effect, creating a default URI mapping. Is there a way in Tomcat to do this via 
configuration, and if not, I'm interested in contributing it, and any recommendations 
on the best places to look to do so would be sincerely appreciated.

Thank you.

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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


Re: Is there a way to bake in URL parameters to a URL path?

Posted by Pid <pi...@pidster.com>.
On 24/08/2011 21:21, Mattmann, Chris A (388J) wrote:
> Thanks Chris for the advice.

Or people use an MVC framework of some sort to map URLs to methods.


p



> Cheers,
> Chris
> 
> On Aug 24, 2011, at 11:26 AM, Christopher Schultz wrote:
> 
> Chris,
> 
> On 8/24/2011 10:56 AM, Mattmann, Chris A (388J) wrote:
>>>> For example, let's say I have a web service located at:
>>>>
>>>> http://myhost/books
> 
> Your REST guys are a fun bunch :)
> 
>>>> The web service is just backed by a Java Servlet
> 
> Okay.
> 
>>>> I get my JSON listings from the web service in the above example is
>>>> to pass a special request parameter called "category", and set
>>>> its value equal to the requested category, like:
>>>>
>>>> http://myhost/books?category=fiction
> 
> That's pretty standard.
> 
>>>> What I would like to be able to do is to set up, via configuration,
>>>> the ability to map a new URL, say:
>>>>
>>>> http://myhost/fictionbooks
>>>>
>>>> To
>>>>
>>>> http://myhost/books?category=fiction
>>>>
>>>> In effect, creating a default URI mapping. Is there a way in Tomcat
>>>> to do this via configuration, and if not, I'm interested in 
>>>> contributing it, and any recommendations on the best places to
>>>> look to do so would be sincerely appreciated.
> 
> As Chuck points out, this is (somewhat) easily done using Tuckey's
> urlrewrite, but you may find that you are writing /lots and lots/ of
> mappings.
> 
> I think the real question is this: would you rather use query-string
> semantics in your URLs, or would you rather use "path-info" (so-called
> because it uses the "path info" of the request) semantics to
> communicate with your server? I guess you could support both, but
> people usually tend to pick one and stick with it.
> 
> If you want to completely change to path-info, a code-based solution
> is probably better (either modifying your servlet(s) or writing a
> Filter to make it look like everything is in the query string -- we
> can help you with either of these techniques). If you just want to
> pretend that you support path-info, then you are probably better off
> using lots and lots of url-rewrite rules.
> 
> Hope that helps,
> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Chris Mattmann, Ph.D.
> Senior Computer Scientist
> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 171-266B, Mailstop: 171-246
> Email: chris.a.mattmann@nasa.gov
> WWW:   http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Adjunct Assistant Professor, Computer Science Department
> University of Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



Re: Is there a way to bake in URL parameters to a URL path?

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Thanks Chris for the advice.

Cheers,
Chris

On Aug 24, 2011, at 11:26 AM, Christopher Schultz wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Chris,
> 
> On 8/24/2011 10:56 AM, Mattmann, Chris A (388J) wrote:
>> For example, let's say I have a web service located at:
>> 
>> http://myhost/books
> 
> Your REST guys are a fun bunch :)
> 
>> The web service is just backed by a Java Servlet
> 
> Okay.
> 
>> I get my JSON listings from the web service in the above example is
>> to pass a special request parameter called "category", and set
>> its value equal to the requested category, like:
>> 
>> http://myhost/books?category=fiction
> 
> That's pretty standard.
> 
>> What I would like to be able to do is to set up, via configuration,
>> the ability to map a new URL, say:
>> 
>> http://myhost/fictionbooks
>> 
>> To
>> 
>> http://myhost/books?category=fiction
>> 
>> In effect, creating a default URI mapping. Is there a way in Tomcat
>> to do this via configuration, and if not, I'm interested in 
>> contributing it, and any recommendations on the best places to
>> look to do so would be sincerely appreciated.
> 
> As Chuck points out, this is (somewhat) easily done using Tuckey's
> urlrewrite, but you may find that you are writing /lots and lots/ of
> mappings.
> 
> I think the real question is this: would you rather use query-string
> semantics in your URLs, or would you rather use "path-info" (so-called
> because it uses the "path info" of the request) semantics to
> communicate with your server? I guess you could support both, but
> people usually tend to pick one and stick with it.
> 
> If you want to completely change to path-info, a code-based solution
> is probably better (either modifying your servlet(s) or writing a
> Filter to make it look like everything is in the query string -- we
> can help you with either of these techniques). If you just want to
> pretend that you support path-info, then you are probably better off
> using lots and lots of url-rewrite rules.
> 
> Hope that helps,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk5VQmMACgkQ9CaO5/Lv0PBlngCdFMWCM3Kcf0lnO71ENwJgSHta
> ID4AoJQIfqopMAgGK05Wc2CHs6QwUD8d
> =Ezh3
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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


Re: Is there a way to bake in URL parameters to a URL path?

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

Chris,

On 8/24/2011 10:56 AM, Mattmann, Chris A (388J) wrote:
> For example, let's say I have a web service located at:
> 
> http://myhost/books

Your REST guys are a fun bunch :)

> The web service is just backed by a Java Servlet

Okay.

> I get my JSON listings from the web service in the above example is
>  to pass a special request parameter called "category", and set
> its value equal to the requested category, like:
> 
> http://myhost/books?category=fiction

That's pretty standard.

> What I would like to be able to do is to set up, via configuration,
> the ability to map a new URL, say:
> 
> http://myhost/fictionbooks
> 
> To
> 
> http://myhost/books?category=fiction
> 
> In effect, creating a default URI mapping. Is there a way in Tomcat
>  to do this via configuration, and if not, I'm interested in 
> contributing it, and any recommendations on the best places to
> look to do so would be sincerely appreciated.

As Chuck points out, this is (somewhat) easily done using Tuckey's
urlrewrite, but you may find that you are writing /lots and lots/ of
mappings.

I think the real question is this: would you rather use query-string
semantics in your URLs, or would you rather use "path-info" (so-called
because it uses the "path info" of the request) semantics to
communicate with your server? I guess you could support both, but
people usually tend to pick one and stick with it.

If you want to completely change to path-info, a code-based solution
is probably better (either modifying your servlet(s) or writing a
Filter to make it look like everything is in the query string -- we
can help you with either of these techniques). If you just want to
pretend that you support path-info, then you are probably better off
using lots and lots of url-rewrite rules.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5VQmMACgkQ9CaO5/Lv0PBlngCdFMWCM3Kcf0lnO71ENwJgSHta
ID4AoJQIfqopMAgGK05Wc2CHs6QwUD8d
=Ezh3
-----END PGP SIGNATURE-----

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


Re: Is there a way to bake in URL parameters to a URL path?

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Thanks Terrence!

Cheers,
Chris

On Aug 24, 2011, at 11:27 AM, Terence M. Bandoian wrote:

>  On 1:59 PM, Mattmann, Chris A (388J) wrote:
>> Thanks for your reply Chuck.
>> 
>> It looks like you can do what I'm suggesting, but it's pretty complex. I'm also
>> wondering why this isn't part of Tomcat proper. It would seem to be a very
>> useful tool to include.
>> 
>> An ALv2 licensed type of filter that does things like the URLRewrite Filter.
>> Another thing too is that this filter seems to do a huge superset of what
>> I'm actually looking for. I'm really just looking for something simple, with a
>> limited config, something like:
>> 
>> <url path=fictionbooks"
>>         origPath=books">
>>    <param name=ategory" value="fiction"/>
>>    <param name=omething else" value="${env.SOMEPROPERTY}"/>
>> </url>
>> ....
>> 
>> I might just write a plugin that does that and contribute it back to the
>> Apache Tomcat community. Would folks here find that useful?
>> 
>> Cheers,
>> Chris
>> 
>> On Aug 24, 2011, at 8:03 AM, Caldarale, Charles R wrote:
>> 
>>>> From: Mattmann, Chris A (388J) [mailto:chris.a.mattmann@jpl.nasa.gov]
>>>> Subject: Is there a way to bake in URL parameters to a URL path?
>>>> What I would like to be able to do is to set up, via
>>>> configuration, the ability to map a new URL, say:
>>>> 
>>>> http://myhost/fictionbooks
>>>> 
>>>> To
>>>> 
>>>> http://myhost/books?category=ction
>>> The usual way to do this is with a filter, and the usual filter is the one here:
>>> http://www.tuckey.org/urlrewrite/
>>> 
>>> - Chuck
>>> 
>>> 
>>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>> 
>> 
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> Chris Mattmann, Ph.D.
>> Senior Computer Scientist
>> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
>> Office: 171-266B, Mailstop: 171-246
>> Email: chris.a.mattmann@nasa.gov
>> WWW:   http://sunset.usc.edu/~mattmann/
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> Adjunct Assistant Professor, Computer Science Department
>> University of Southern California, Los Angeles, CA 90089 USA
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> Hi, Chris-
> 
> You might also consider using, for example:
> 
>     http://myhost/books/fiction
> 
> And then map your servlet as:
> 
> <servlet-mapping>
> <servlet-name>your_books_servlet</servlet-name>
> <url-pattern>/books/*</url-pattern>
> </servlet-mapping>
> 
> Somewhere, possibly in your books servlet, you'd have to extract the 
> category (fiction, in this case) from the path info.
> 
> -Terence Bandoian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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


Re: Is there a way to bake in URL parameters to a URL path?

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
  On 1:59 PM, Mattmann, Chris A (388J) wrote:
> Thanks for your reply Chuck.
>
> It looks like you can do what I'm suggesting, but it's pretty complex. I'm also
> wondering why this isn't part of Tomcat proper. It would seem to be a very
> useful tool to include.
>
> An ALv2 licensed type of filter that does things like the URLRewrite Filter.
> Another thing too is that this filter seems to do a huge superset of what
> I'm actually looking for. I'm really just looking for something simple, with a
> limited config, something like:
>
> <url path=fictionbooks"
>          origPath=books">
>     <param name=ategory" value="fiction"/>
>     <param name=omething else" value="${env.SOMEPROPERTY}"/>
> </url>
> ....
>
> I might just write a plugin that does that and contribute it back to the
> Apache Tomcat community. Would folks here find that useful?
>
> Cheers,
> Chris
>
> On Aug 24, 2011, at 8:03 AM, Caldarale, Charles R wrote:
>
>>> From: Mattmann, Chris A (388J) [mailto:chris.a.mattmann@jpl.nasa.gov]
>>> Subject: Is there a way to bake in URL parameters to a URL path?
>>> What I would like to be able to do is to set up, via
>>> configuration, the ability to map a new URL, say:
>>>
>>> http://myhost/fictionbooks
>>>
>>> To
>>>
>>> http://myhost/books?category=ction
>> The usual way to do this is with a filter, and the usual filter is the one here:
>> http://www.tuckey.org/urlrewrite/
>>
>> - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Chris Mattmann, Ph.D.
> Senior Computer Scientist
> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 171-266B, Mailstop: 171-246
> Email: chris.a.mattmann@nasa.gov
> WWW:   http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Adjunct Assistant Professor, Computer Science Department
> University of Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Hi, Chris-

You might also consider using, for example:

     http://myhost/books/fiction

And then map your servlet as:

<servlet-mapping>
<servlet-name>your_books_servlet</servlet-name>
<url-pattern>/books/*</url-pattern>
</servlet-mapping>

Somewhere, possibly in your books servlet, you'd have to extract the 
category (fiction, in this case) from the path info.

-Terence Bandoian


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


Re: Is there a way to bake in URL parameters to a URL path?

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
On Aug 24, 2011, at 11:32 AM, Christopher Schultz wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Chris,
> 
> On 8/24/2011 12:09 PM, Mattmann, Chris A (388J) wrote:
>> [O]n the other end of the spectrum, if you scare away people who
>> are simply trying to do what I'm trying to do with all of the
>> flexibility (and complexity) from a full-featured URL rewriter,
>> it's also probably not a great thing.
> 
> Don't be afraid of the extra features, they won't hurt you :)
> 
> Seriously, I haven't used url-rewrite myself but it appears to have a
> relatively small footprint (small code size) and your mappings only
> need to be as complex as your needs.

Okey dok, thanks.

> 
>> Anyhoo, I'll wait to see what others think and if I get the time to
>> make such a filter.
> 
> You are free to include such a Filter on the Tomcat Wiki. That's
> probably the best place for contributed code that is unlikely to make
> it into Tomcat itself.

Based on the conversation so far, it appears that it is fine for downstream 
projects to have that functionality. 

What spawned this whole discussion was looking at e.g., Solr, and looking 
at e.g., CXF and seeing this type of capability, but in the downstream project, 
written in different ways. I thought it might be a good candidate to bubble 
upstream to the app server, but it doesn't seem to have a lot of support 
so I'll drop it.

> 
>> Are there plans to include the URL filter at 
>> http://www.tuckey.org/urlrewrite/ in Tomcat proper at the ASF?
> 
> Probably not. This same question has been asked in the past and
> generally rejected because url-rewrite is such a good tool already
> that there's no reason to re-invent the wheel. Also, the servlet spec
> does not mandate this type of capability, so it's obviously not
> required from that standpoint. Most of the non-servlet-spec-defined
> utilities in Tomcat are provided because they are almost a requirement
> of having a web server -- things like access logging -- or are very
> useful security tools -- like the CsrfPreventionFilter.
> 
> That's not to say that this kind of thing would never be considered...
> it's just that there's not much motivation to babybsit another tool
> that is already freely-available and quite mature.

Sure, but that tool is BSD licensed, not ALv2 licensed and it would 
be nice to have an ALv2 licensed one is all I was saying.

Thanks,
Chris


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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


Re: Is there a way to bake in URL parameters to a URL path?

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

Chris,

On 8/24/2011 12:09 PM, Mattmann, Chris A (388J) wrote:
> [O]n the other end of the spectrum, if you scare away people who
> are simply trying to do what I'm trying to do with all of the
> flexibility (and complexity) from a full-featured URL rewriter,
> it's also probably not a great thing.

Don't be afraid of the extra features, they won't hurt you :)

Seriously, I haven't used url-rewrite myself but it appears to have a
relatively small footprint (small code size) and your mappings only
need to be as complex as your needs.

> Anyhoo, I'll wait to see what others think and if I get the time to
> make such a filter.

You are free to include such a Filter on the Tomcat Wiki. That's
probably the best place for contributed code that is unlikely to make
it into Tomcat itself.

> Are there plans to include the URL filter at 
> http://www.tuckey.org/urlrewrite/ in Tomcat proper at the ASF?

Probably not. This same question has been asked in the past and
generally rejected because url-rewrite is such a good tool already
that there's no reason to re-invent the wheel. Also, the servlet spec
does not mandate this type of capability, so it's obviously not
required from that standpoint. Most of the non-servlet-spec-defined
utilities in Tomcat are provided because they are almost a requirement
of having a web server -- things like access logging -- or are very
useful security tools -- like the CsrfPreventionFilter.

That's not to say that this kind of thing would never be considered...
it's just that there's not much motivation to babybsit another tool
that is already freely-available and quite mature.

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

iEYEARECAAYFAk5VQ9QACgkQ9CaO5/Lv0PDDugCfbJTxvDC+TY9bhLk5K7ibsjRj
rocAnAse07qm+1JJwZ4yb3FL1HHDXlrF
=NleM
-----END PGP SIGNATURE-----

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


Re: Is there a way to bake in URL parameters to a URL path?

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hi Tim,

On Aug 24, 2011, at 8:55 AM, Tim Funk wrote:

> While useful ... I would conjecture that things like this eventually undergo
> feature creep and over time would turn into
> http://www.tuckey.org/urlrewrite/

Thanks. That's entirely possible, but on the other end of the spectrum, if you 
scare away people who are simply trying to do what I'm trying to do with all 
of the flexibility (and complexity) from a full-featured URL rewriter, it's 
also probably not a great thing. 

Anyhoo, I'll wait to see what others think and if I get the time to make such 
a filter. 

Are there plans to include the URL filter at 
http://www.tuckey.org/urlrewrite/ in Tomcat proper at the ASF? 
As a consumer of ASF software (and Tomcat), I think it would 
make a ton of sense to have this type of functionality inside of 
the core. Looking at the documentation on the Tomcat site, which 
I did for a half hour, as well as some Google searches, didn't yield 
much that would have pointed me in this direction. And so, 
that's what led me here. 

Thanks very much.

Cheers,
Chris

> 
> 
> -Tim
> 
> On Wed, Aug 24, 2011 at 11:14 AM, Mattmann, Chris A (388J) <
> chris.a.mattmann@jpl.nasa.gov> wrote:
> 
>> Thanks for your reply Chuck.
>> 
>> It looks like you can do what I'm suggesting, but it's pretty complex. I'm
>> also
>> wondering why this isn't part of Tomcat proper. It would seem to be a very
>> useful tool to include.
>> 
>> An ALv2 licensed type of filter that does things like the URLRewrite
>> Filter.
>> Another thing too is that this filter seems to do a huge superset of what
>> I'm actually looking for. I'm really just looking for something simple,
>> with a
>> limited config, something like:
>> 
>> <url path="/fictionbooks"
>>       origPath="/books">
>>  <param name="category" value="fiction"/>
>>  <param name="something else" value="${env.SOMEPROPERTY}"/>
>> </url>
>> ....
>> 
>> I might just write a plugin that does that and contribute it back to the
>> Apache Tomcat community. Would folks here find that useful?
>> 
>> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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


Re: Is there a way to bake in URL parameters to a URL path?

Posted by Tim Funk <fu...@apache.org>.
While useful ... I would conjecture that things like this eventually undergo
feature creep and over time would turn into
http://www.tuckey.org/urlrewrite/


-Tim

On Wed, Aug 24, 2011 at 11:14 AM, Mattmann, Chris A (388J) <
chris.a.mattmann@jpl.nasa.gov> wrote:

> Thanks for your reply Chuck.
>
> It looks like you can do what I'm suggesting, but it's pretty complex. I'm
> also
> wondering why this isn't part of Tomcat proper. It would seem to be a very
> useful tool to include.
>
> An ALv2 licensed type of filter that does things like the URLRewrite
> Filter.
> Another thing too is that this filter seems to do a huge superset of what
> I'm actually looking for. I'm really just looking for something simple,
> with a
> limited config, something like:
>
> <url path="/fictionbooks"
>        origPath="/books">
>   <param name="category" value="fiction"/>
>   <param name="something else" value="${env.SOMEPROPERTY}"/>
> </url>
> ....
>
> I might just write a plugin that does that and contribute it back to the
> Apache Tomcat community. Would folks here find that useful?
>
>

Re: Is there a way to bake in URL parameters to a URL path?

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Thanks for your reply Chuck.

It looks like you can do what I'm suggesting, but it's pretty complex. I'm also 
wondering why this isn't part of Tomcat proper. It would seem to be a very 
useful tool to include.

An ALv2 licensed type of filter that does things like the URLRewrite Filter. 
Another thing too is that this filter seems to do a huge superset of what 
I'm actually looking for. I'm really just looking for something simple, with a 
limited config, something like:

<url path="/fictionbooks"
        origPath="/books">
   <param name="category" value="fiction"/>
   <param name="something else" value="${env.SOMEPROPERTY}"/>
</url>
....

I might just write a plugin that does that and contribute it back to the 
Apache Tomcat community. Would folks here find that useful?

Cheers,
Chris

On Aug 24, 2011, at 8:03 AM, Caldarale, Charles R wrote:

>> From: Mattmann, Chris A (388J) [mailto:chris.a.mattmann@jpl.nasa.gov] 
>> Subject: Is there a way to bake in URL parameters to a URL path?
> 
>> What I would like to be able to do is to set up, via 
>> configuration, the ability to map a new URL, say:
>> 
>> http://myhost/fictionbooks 
>> 
>> To 
>> 
>> http://myhost/books?category=fiction
> 
> The usual way to do this is with a filter, and the usual filter is the one here:
> http://www.tuckey.org/urlrewrite/
> 
> - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


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


RE: Is there a way to bake in URL parameters to a URL path?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mattmann, Chris A (388J) [mailto:chris.a.mattmann@jpl.nasa.gov] 
> Subject: Is there a way to bake in URL parameters to a URL path?

> What I would like to be able to do is to set up, via 
> configuration, the ability to map a new URL, say:
>
> http://myhost/fictionbooks 
>
> To 
>
> http://myhost/books?category=fiction

The usual way to do this is with a filter, and the usual filter is the one here:
http://www.tuckey.org/urlrewrite/

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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