Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004720 [Resin] minor always 08-18-11 13:02 08-25-11 15:47
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.6
Summary 0004720: match web-app for /*/appname
Description (rep by Sachidanand Shukla)


Problem Description
Our application is configured to a web-app id="/app". All request with <domainName>/app/* are reaching the app and everything works great.
Now, we have a new brand which needed the URL to be <domainName>/<brandName>/app/*.

We tried various options ( details given below), but finally we had to configure two different webapps with different IDs, one with /app and one with /brandName but pointing to the same deployment directory ( via sym links).
With big down side of this solution was that the application now starts twice, once with /app context and then fro /brandName content, although it is the same app.

What we need?
Basically, all we need is to send all request with */app to the same app, and the URL should not change when it is received by the app, so that we can parse and take the brand name from the URL.
We have the configuration defined as;
      <web-app id="/app" document-directory="_ear_deployer/webapps/hi">
        <session-config cookie-domain=".foo.com">
          <enable-url-rewriting>false</enable-url-rewriting>
        </session-config>
      </web-app>
 <web-app id="/app" document-directory="_ear_deployer/webapps/cp"> // this directory is nothing but a symbolic link to /hi mentioned above.
        <session-config cookie-domain=".foo.com">
          <enable-url-rewriting>false</enable-url-rewriting>
        </session-config>
      </web-app>

We need to run some thing like:
   <web-app id=" * /app" document-directory="_ear_deployer/webapps/hi">

What we have tried so far?

We have tried two options which seemed to solve the problem and have one application support both cases, but both did not resolve the issue.

Approach 1: Used <web-app url-regexp= **>
We tried to use this option with configuring the app and using the regexp to configure the web app based on */app to go to same deployment directory.
Downside:
When specified by url-regexp, the application will be initialized at the first request. This is a big problem.

Approach 2: Used rewrite-dispatch
We used the rewrite-dispatch in resin.conf and it worked close to what we thought.

      <web-app id="/app" document-directory="deploy/hi">
        <session-config cookie-domain=".foo.com">
          <enable-url-rewriting>false</enable-url-rewriting>
        </session-config>
      </web-app>
<rewrite-dispatch>
<forward regexp="^/foo" target="/"/>
</rewrite-dispatch>

Problem with this approach when the request reached the app the portion before /app is removed. The browser still shows the URL as /foo/app but the application does not receive the /foo portion which is much needed to render the specific brand.

We need your help to make some suggestion so that we can run the same app and support both /app and /foo/app with one single instance of the application rendered from same deployment directory.

Additional Information
Attached Files

- Relationships

- Notes
(0005467)
ferg
08-25-11 15:47

server/1hb1
 

- Issue History
Date Modified Username Field Change
08-18-11 13:02 ferg New Issue
08-25-11 15:47 ferg Note Added: 0005467
08-25-11 15:47 ferg Assigned To  => ferg
08-25-11 15:47 ferg Status new => closed
08-25-11 15:47 ferg Resolution open => fixed
08-25-11 15:47 ferg Fixed in Version  => 4.0.22


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker