Mantis - Resin
Viewing Issue Advanced Details
1445 minor always 11-07-06 08:53 05-30-07 12:15
ferg  
ferg  
normal  
closed  
fixed  
none    
none 3.1.2  
0001445: proxy servlet enhancements
(rep by Daniel Lopez)

In fact, it is nothing too fancy, it basically does the same that the
Caucho Proxy Servlet does but it allows you to specify a list of init
parameters that, working in pairs, allow you to specify a recognition
regexp pattern and a replacement pattern. Something like that:
----
   <filter>
     <filter-name>ProxyFilter</filter-name>
     <filter-class>org.leaf.filters.ProxyFilter</filter-class>
     <init-param>
       <param-name>MATCHING_URL_APP_1</param-name>
       <param-value>/ca/app/(.*).html</param-value>
     </init-param>
     <init-param>
       <param-name>REPLACEMENT_URL_APP_1</param-name>
<param-value>http://internal.com:9080/html/$1.html</param-value> [^]
     </init-param>
     <init-param>
       <param-name>MATCHING_URL_APP_2</param-name>
       <param-value>/ca/app/(.*)</param-value>
     </init-param>
     <init-param>
       <param-name>REPLACEMENT_URL_APP_2</param-name>
       <param-value>http://internal.com:9080/app/$1</param-value> [^]
     </init-param>
     ...
   </filter>
----
You only need to make sure the mapping of the filter matches all the
requests you want, and the ones that match no criteria from the init
parameters simply pass through the filter untouched.

Not sure how useful it will be to others, but in our case it works
pretty well as it gets SiteMesh to believe that some remote pages are
local resources, so they get "decorated" appropriately. It is an
intermediate step before we migrate to a real portal solution, but time
and resources forced us to get something done before schedule.

Barring some implementation problems when we perform the stress tests,
it is working great for us.

Notes
(0001972)
ferg   
05-30-07 12:15   
server/1kl0, server/1kl1