ICEfaces
  1. ICEfaces
  2. ICE-7941

Add parameter for configuring the base path of an application

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2, EE-1.8.2.GA_P03
    • Fix Version/s: EE-1.8.2.GA_P06
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 1.8.x
    • Assignee Priority:
      P1
    • Salesforce Case Reference:
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      Feature Request: Add ability for an application to use a relative path to the xmlhttp servlet.

      Scenario:

      Instead of rendering the page as follows:

      <script src="/app-context/xmlhttp/1332234398300/icefaces-d2d.js" type="text/javascript"></script>

      It renders the page as so:
      <script src="./app-context/xmlhttp/1332234398300/icefaces-d2d.js" type="text/javascript"></script>

      The reason being, we have two sites hosted and redirected by the front end apache servers:

      https://www.web.com/app1/app-context/MainPage.iface
      and
      https://www.web.com/app-context/MainPage.iface

      What is happening is that when the absolute path being put in the render response, we get redirected to the second instance of the app-context. When in fact I want to go to the first instance.
      1. data.xml
        0.5 kB
        Mircea Toma

        Activity

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Salesforce Case [5007000000LFjsD]
        Arran Mccullough made changes -
        Salesforce Case Reference 5007000000LFjsDAAT
        Ken Fyten made changes -
        Fix Version/s EE-1.8.2.GA_P06 [ 10470 ]
        Ken Fyten made changes -
        Assignee Mircea Toma [ mircea.toma ]
        Ken Fyten made changes -
        Assignee Priority P1 [ 10010 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #33065 Tue Jan 15 15:38:19 MST 2013 mircea.toma ICE-7941 Modified getResourceURL and getActionURL methds to use a different context path when calculating the absolute URLs. The different context path can be defined using the "com.icesoft.faces.publicContextPath" context parameter.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java
        Hide
        Mircea Toma added a comment -

        Modified D2DViewHandler.getResourceURL and D2DViewHandler.getActionURL methods to use a different context path when calculating the absolute URLs. The different context path can be defined using the "com.icesoft.faces.publicContextPath" context parameter.

        Show
        Mircea Toma added a comment - Modified D2DViewHandler.getResourceURL and D2DViewHandler.getActionURL methods to use a different context path when calculating the absolute URLs. The different context path can be defined using the "com.icesoft.faces.publicContextPath" context parameter.
        Mircea Toma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Affects Documentation (User Guide, Ref. Guide, etc.) [ 10003 ]
        Resolution Fixed [ 1 ]
        Hide
        Mircea Toma added a comment -

        In order to test this issue a reverse proxy is needed so that the browser will access the application using a different context path than the one naturally assigned by the app server (the WAR or directory name of the application).

        I used http://j2ep.sourceforge.net/ reverse proxy which can be deployed as WAR application along with the tested application.
        Once the j2ep-1.0 app is deployed its configuration will need to be changed so that the reverse proxying is done locally. See the attached data.xml file, this will need to be replaced and j2ep-1.0 app restarted to take this new configuration into effect.

        Then Tomcat will need to be configured to define the root path "/" for the JSESSIONID cookies so that when local application is accessed the cookie is set on the browser (which sees the application under a different context path) . To do that just add sessionCookiePath="/" attribute to the Context tag in $tomcat/conf/context.xml (... and restart Tomcat so that new configuration is effective).

        If normally we access the app with http://localhost:8080/component-showcase/ URL to access it through the proxy http://localhost:8080/j2ep-1.0/bla/component-showcase/ URL should be used.

        Show
        Mircea Toma added a comment - In order to test this issue a reverse proxy is needed so that the browser will access the application using a different context path than the one naturally assigned by the app server (the WAR or directory name of the application). I used http://j2ep.sourceforge.net/ reverse proxy which can be deployed as WAR application along with the tested application. Once the j2ep-1.0 app is deployed its configuration will need to be changed so that the reverse proxying is done locally. See the attached data.xml file, this will need to be replaced and j2ep-1.0 app restarted to take this new configuration into effect. Then Tomcat will need to be configured to define the root path "/" for the JSESSIONID cookies so that when local application is accessed the cookie is set on the browser (which sees the application under a different context path) . To do that just add sessionCookiePath="/" attribute to the Context tag in $tomcat/conf/context.xml (... and restart Tomcat so that new configuration is effective). If normally we access the app with http://localhost:8080/component-showcase/ URL to access it through the proxy http://localhost:8080/j2ep-1.0/bla/component-showcase/ URL should be used.
        Mircea Toma made changes -
        Attachment data.xml [ 15349 ]
        Hide
        Mircea Toma added a comment -

        Just for reference ... this issue seems to be quite old, see ICE-1558.

        Show
        Mircea Toma added a comment - Just for reference ... this issue seems to be quite old, see ICE-1558 .
        Hide
        Mircea Toma added a comment - - edited

        Carmen, you can try to change the server.xml file in Tomcat to force it to used the root path for all the cookies. This is another configuration approach for Tomcat:

        If emptySessionPath attribute on the HTTP connector in server.xml is set to true, all paths for session cookies will be set to /. This can be useful for portlet specification implementations. If not specified, this attribute is set to false.

        <Connector port="8080" protocol="HTTP/1.1"
        connectionTimeout="20000"
        redirectPort="8443" emptySessionPath="true"/>

        Show
        Mircea Toma added a comment - - edited Carmen, you can try to change the server.xml file in Tomcat to force it to used the root path for all the cookies. This is another configuration approach for Tomcat: If emptySessionPath attribute on the HTTP connector in server.xml is set to true, all paths for session cookies will be set to /. This can be useful for portlet specification implementations. If not specified, this attribute is set to false. <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" emptySessionPath="true"/>
        Hide
        Carmen Cristurean added a comment -

        Verified with ICEfaces 1.8.GA-P06 Build 1 (w/ auctionMonitor and component-showcase applications), in IE8, FF19, Chrome24.
        This worked only after adding the emptySessionPath attribute to the Connector in $tomcat/config/server.xml.

        Show
        Carmen Cristurean added a comment - Verified with ICEfaces 1.8.GA-P06 Build 1 (w/ auctionMonitor and component-showcase applications), in IE8, FF19, Chrome24. This worked only after adding the emptySessionPath attribute to the Connector in $tomcat/config/server.xml.
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: