Cross-domain images

23 views
Skip to first unread message

Mikel

unread,
Dec 14, 2011, 11:55:53 AM12/14/11
to UrlRewrite
Hi there!

First of all i gotta say that UrlRewrite is pretty nice! Bad news for
me is im having some problems with it. First of all, Im running a
Glassfish 3.1.1 server and i want to use it as "proxy" to get some
images that are stored in another computer. From what I read in the
documentation i need to use the "proxy" type in the "to" clause... but
I am not getting the images at all ;/

<rule>
<from>^/images/\d\d\d\d/(0[1-9]|[1-2][0-9]|3[0-1])/(0[1-9]|
1[012])/[012][0-9]/[0-5][0-9]/[0-5][0-9]\.\d$</from>
<to type="proxy">http://192.168.0.38/servlets/?
sTableName=tsi_sample&amp;dtUTC=$1-$2-$3+$4:$5:$6</to>
</rule>

There's the rule. In the "from" clause its supposed to take a date
like this:

/images/year/month/day/hour/minute/second.0 (this ".0" in the end is
added by the database, no biggie)

as you can see in the "to" clause, im redirecting the request to
another computer in the network. Thing is, this URL, given the right
parameters (supposedly above) gives back the desired image. Here's the
web.xml part:

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-
class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-
class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/images/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

any ideas are welcome!

Thank you!

Mikel

unread,
Dec 19, 2011, 6:19:42 AM12/19/11
to UrlRewrite
Fixed! was an issue with the regex :p
Reply all
Reply to author
Forward
0 new messages