3 Replies Latest reply on Jun 22, 2012 10:05 AM by jaikiran pai

    getRequestURL doesn't return expected result

    Kelly Dolan Newbie

      Help!  I'm currently trying to upgrade an application from JBoss 4.0.1sp1 to 7.1.1 Final and am experiencing an issue for which I can find no solution.  I found what might be a related issue (https://issues.jboss.org/browse/JBAS-6570) but it was recorded against AS 6, closed because of that understandibly but not re-recorded for AS 7. 



      I have an application MyEar.ear configured to use JAAS security that contains MyWar.war configured to redirect protected requests to a FORM login page.


      I have a login page - MyEar.ear/MyWar.war/WEB-INF/login.jsp. 


      I have 2 conceptual sites - a user and admin site.  The user site is accessed as http://server:port/MyEar/user and the admin site is accessed as http://server:port/MyEar/admin.  The login page calls request.getRequestURL() to determine which site is being accessed and generates the content of the login page differently based on which site is being accessed among other things.


      In JBoss 4, request.getRequestURL() returns

      * returns http://server:port/MyEar/user when http://server:port/MyEar/user is entered

      * returns http://server:port/MyEar/admin when http://server:port/MyEar/admin is entered

      * if params are entered on the URL, they are not part of the string returned by getRequestURL() but that's okay for me


      In JBoss 7, request.getRequestURL() returns http://server:port/MyEar/WEB-INF/login.jsp.


      This is a HUGE problem for me.  Is there an alternate way to get the information I need OR is this a bug in JBoss 7.1.1 for which I need to open a JIRA issue?


      Many thanks for quick responses,