Topic
  • 5 replies
  • Latest Post - ‏2013-05-30T12:47:06Z by TuukkaIlomäki
SystemAdmin
SystemAdmin
6195 Posts

Pinned topic URLs in design-time templates altered after migration from RBD 7.5 -> 8.5

‏2012-08-24T07:52:58Z |
I recently tested how our codebase (which is currently being developed on RBD v7.5.1.7) would work on the newest RBD version (which is v8.5).

On the 8.5, it seems the design-time template renderer is altering my URLs. I have the following line in my template.jtpl:


<a href=
"foo.jsp">bar</a>


And this is how it will be rendered in the JSP file:


<a href=
"foo.faces">bar</a>


This seems to be related to contents of the web.xml file - if I remove the following lines from web.xml (we are not using this URL pattern anyway):


<servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping>


The URL in JSP file changes to this:


<a href=
"/web/faces/foo.jsp">bar</a>


Which would be okay - though, the problem is that our code will get deployed on different context paths, not just "web" - causing this URL to fail on every other context path than "web".

So I'd rather not have my URLs altered - can I disable this behaviour somehow? I could not find anything from RBD's preferences or project's properties. We're using JSF 1.1, Dynamic Web Module 2.3 and Tomcat 5.5.
Updated on 2012-10-09T14:53:56Z at 2012-10-09T14:53:56Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: URLs in design-time templates altered after migration from RBD 7.5 -&gt; 8.5

    ‏2012-09-21T09:47:01Z  
    Hi MikaViinamäki,

    I tried your scenario, but can't reproduce and saw the different behavior. Please refer to the following:

    I created an EGL web project, as well as a JSP template (Design-time template), changed nothing in web.xml.
    On RBD 7.5.1.7:
    1) When the line in template.jtpl is:
    
    <a href=
    "foo.jsp">bar</a>
    
    , then got exception when clicking the hyper link from another web page. The url is rendered to "http://locahost:8008/Test/foo.jsp".
    2) When changing the line into
    
    <a href=
    "foo.faces">bar</a>
    
    or
    
    <a href=
    "faces/foo.jsp">bar</a>
    
    , everything works fine. The url is rendered to "http://locahost:8008/Test/foo.faces" or "http://locahost:8008/Test/faces/foo.jsp".
    3) When delete the following servlet-mapping entry, everything works fine, the url is rendered to "http://locahost:8008/Test/faces/foo.jsp".
    
    <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping>
    


    Then Migrated to RBD 8.5:
    Section 1) and 2) is the same as RBD 7.5.1.7, but section 3) is defferent
    3) When delete the following servlet-mapping entry, still got the exception, the url is rendered to "http://locahost:8008/Test/foo.jsp". (Different behavior)
    
    <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping>
    


    So not sure if you have modified the servlet-mapping in web.xml. Appreciated if you can provide a project sample. Anyway, I think it's RAD problem because the template feature is shipped with RAD, I also tried in RAD 7553 and RAD85 and got the same behavior.

    Thanks.
  • Ravi_Hariharan
    Ravi_Hariharan
    77 Posts

    Re: URLs in design-time templates altered after migration from RBD 7.5 -&gt; 8.5

    ‏2012-09-27T18:02:51Z  
    Hi MikaViinamäki,

    I tried your scenario, but can't reproduce and saw the different behavior. Please refer to the following:

    I created an EGL web project, as well as a JSP template (Design-time template), changed nothing in web.xml.
    On RBD 7.5.1.7:
    1) When the line in template.jtpl is: <pre class="jive-pre"> <a href= "foo.jsp">bar</a> </pre> , then got exception when clicking the hyper link from another web page. The url is rendered to "http://locahost:8008/Test/foo.jsp".
    2) When changing the line into <pre class="jive-pre"> <a href= "foo.faces">bar</a> </pre> or <pre class="jive-pre"> <a href= "faces/foo.jsp">bar</a> </pre> , everything works fine. The url is rendered to "http://locahost:8008/Test/foo.faces" or "http://locahost:8008/Test/faces/foo.jsp".
    3) When delete the following servlet-mapping entry, everything works fine, the url is rendered to "http://locahost:8008/Test/faces/foo.jsp".
    <pre class="jive-pre"> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> </pre>

    Then Migrated to RBD 8.5:
    Section 1) and 2) is the same as RBD 7.5.1.7, but section 3) is defferent
    3) When delete the following servlet-mapping entry, still got the exception, the url is rendered to "http://locahost:8008/Test/foo.jsp". (Different behavior)
    <pre class="jive-pre"> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> </pre>

    So not sure if you have modified the servlet-mapping in web.xml. Appreciated if you can provide a project sample. Anyway, I think it's RAD problem because the template feature is shipped with RAD, I also tried in RAD 7553 and RAD85 and got the same behavior.

    Thanks.
    I had seen similar issue when we migrated to RBD 8. we had this issue in the JTPL template.

    we used <hx:outputLinkEx> in place of
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: URLs in design-time templates altered after migration from RBD 7.5 -&gt; 8.5

    ‏2012-09-28T13:26:34Z  
    Hi MikaViinamäki,

    I tried your scenario, but can't reproduce and saw the different behavior. Please refer to the following:

    I created an EGL web project, as well as a JSP template (Design-time template), changed nothing in web.xml.
    On RBD 7.5.1.7:
    1) When the line in template.jtpl is: <pre class="jive-pre"> <a href= "foo.jsp">bar</a> </pre> , then got exception when clicking the hyper link from another web page. The url is rendered to "http://locahost:8008/Test/foo.jsp".
    2) When changing the line into <pre class="jive-pre"> <a href= "foo.faces">bar</a> </pre> or <pre class="jive-pre"> <a href= "faces/foo.jsp">bar</a> </pre> , everything works fine. The url is rendered to "http://locahost:8008/Test/foo.faces" or "http://locahost:8008/Test/faces/foo.jsp".
    3) When delete the following servlet-mapping entry, everything works fine, the url is rendered to "http://locahost:8008/Test/faces/foo.jsp".
    <pre class="jive-pre"> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> </pre>

    Then Migrated to RBD 8.5:
    Section 1) and 2) is the same as RBD 7.5.1.7, but section 3) is defferent
    3) When delete the following servlet-mapping entry, still got the exception, the url is rendered to "http://locahost:8008/Test/foo.jsp". (Different behavior)
    <pre class="jive-pre"> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.faces</url-pattern> </servlet-mapping> </pre>

    So not sure if you have modified the servlet-mapping in web.xml. Appreciated if you can provide a project sample. Anyway, I think it's RAD problem because the template feature is shipped with RAD, I also tried in RAD 7553 and RAD85 and got the same behavior.

    Thanks.
    Hello, I am replying on behalf of Mika Viinamäki.

    First, in our web application the URL format is always faces/pagename.jsp. We do not use URL format pagename.faces. However, both formats were configured in web.xml but in RBD 7.5.1.7 link pagename.jsp in template was rendered as pagename.jsp in the page. We were able to solve this by removing *.faces from web.xml. Still, the question remains why this is different from RBD 7.5.1.7 and how can we control it.

    Secondly, the real issue does not concern those formats. The problem is that the context is automatically inserted into the generated links. In RBD 7.5.1.7 URL pagename.jsp in template is rendered as pagename.jsp in the JSP-page. However, in RBD 8.5 URL pagename.jsp in template is rendered as WebApplicationContext/pagename.jsp in the JSP-page with the prefix WebApplicationContext added without asking and differently from RBD 7.5.1.7. As our web application is published with several different contexts, this automatic conversion of links to one particular context renders RBD 8.5 useless for us.

    Thus, we have seen two different behaviors of RBD 8.5 and neither of them is acceptable to us. The starting point is link pagename.jsp in page template. It is either rendered as pagename.faces or WebApplicationContext/pagename.jsp but we cannot use either. We want pagename.jsp in template to be rendered as pagename.jsp.

    We cannot post our project here, but we can open a PMR and attach the project to it.
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: URLs in design-time templates altered after migration from RBD 7.5 -&gt; 8.5

    ‏2012-10-09T14:53:56Z  
    Hello, I am replying on behalf of Mika Viinamäki.

    First, in our web application the URL format is always faces/pagename.jsp. We do not use URL format pagename.faces. However, both formats were configured in web.xml but in RBD 7.5.1.7 link pagename.jsp in template was rendered as pagename.jsp in the page. We were able to solve this by removing *.faces from web.xml. Still, the question remains why this is different from RBD 7.5.1.7 and how can we control it.

    Secondly, the real issue does not concern those formats. The problem is that the context is automatically inserted into the generated links. In RBD 7.5.1.7 URL pagename.jsp in template is rendered as pagename.jsp in the JSP-page. However, in RBD 8.5 URL pagename.jsp in template is rendered as WebApplicationContext/pagename.jsp in the JSP-page with the prefix WebApplicationContext added without asking and differently from RBD 7.5.1.7. As our web application is published with several different contexts, this automatic conversion of links to one particular context renders RBD 8.5 useless for us.

    Thus, we have seen two different behaviors of RBD 8.5 and neither of them is acceptable to us. The starting point is link pagename.jsp in page template. It is either rendered as pagename.faces or WebApplicationContext/pagename.jsp but we cannot use either. We want pagename.jsp in template to be rendered as pagename.jsp.

    We cannot post our project here, but we can open a PMR and attach the project to it.
    PMR# 09843,999,702
  • TuukkaIlomäki
    TuukkaIlomäki
    68 Posts

    Re: URLs in design-time templates altered after migration from RBD 7.5 -&gt; 8.5

    ‏2013-05-30T12:47:06Z  
    PMR# 09843,999,702

    Fix PM79444+PM85674 provides a new option "The same as template's links (unchanged)" that keeps links in tempate unmodified.