Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 3.3.3
    • Fix Version/s: None
    • Component/s: Jawr Core
    • Labels:
      None
    • Environment:

      ServletContainer: Tomcat 6.0;
      JAWR: jawr-3.3.3;
      OS: Windows 7

      Description

      When using JAWR.loader instead of the taglib, a new http session is opened as soon as the /jawr_loader.js script is loaded from the HTML page.

      This also happens when the HTML page is explicitly set to not open a http session (e.g.: with <%@ page session="false" %>).

      The reason for this behaviour is that in ClientSideHandlerGeneratorImpl::getClientSideHandlerScript a new http session is opened when querying the rsHandler object. In fact this is really annoying when a javascript variable (or a variable from another taglib) should be used to determine the path of the bundle to retrieve.

      The question i am asking (despite of the technical facts i mentioned above) is:
      Why is a http session needed when using jawr_loader? When using the taglib no session is opened and everything works as expected.

        Activity

        Hide
        icefox added a comment -

        Hi,

        I don't understand why a new HttpSession is created.
        In ClientSideHandlerGeneratorImpl::getClientSideHandlerScript, we use "HttpServletRequest.getSession()" method to retrieve the session.
        Normally it should returns the current session, or create a new one if there is no current session.
        I don't know why your session is not retrieved.

        In fact, in Jawr we don't care about the session, the only thing which it needs is the ServletContext, which is accessible through the session.

        The fact, that you're having your session when using the taglib, is that when using the taglib, you are rendering the page in your current session, so it is available.
        When you use the Jawr_loader, a new request is created, but I don't know why you session is not used in that case.

        A solution to you issue could be to use the ServletContext to store your data.
        I hope that my answer helps you.

        Cheers,

        Show
        icefox added a comment - Hi, I don't understand why a new HttpSession is created. In ClientSideHandlerGeneratorImpl::getClientSideHandlerScript, we use "HttpServletRequest.getSession()" method to retrieve the session. Normally it should returns the current session, or create a new one if there is no current session. I don't know why your session is not retrieved. In fact, in Jawr we don't care about the session, the only thing which it needs is the ServletContext, which is accessible through the session. The fact, that you're having your session when using the taglib, is that when using the taglib, you are rendering the page in your current session, so it is available. When you use the Jawr_loader, a new request is created, but I don't know why you session is not used in that case. A solution to you issue could be to use the ServletContext to store your data. I hope that my answer helps you. Cheers,
        Hide
        niko_k added a comment -

        Hi,

        i am not sure if i understand what you mean. In fact i do not want to open a session on the jsp page at all (thats because i use <%@ page session="false" %>, i mentioned above).

        However, the ClientSideHandlerGeneratorImpl opens a session even if i don't want one to be opened.
        That's why i am asking if this is really necessary (since the jawr-taglib does not open a session)...

        Regards,
        Niko

        Show
        niko_k added a comment - Hi, i am not sure if i understand what you mean. In fact i do not want to open a session on the jsp page at all (thats because i use <%@ page session="false" %>, i mentioned above). However, the ClientSideHandlerGeneratorImpl opens a session even if i don't want one to be opened. That's why i am asking if this is really necessary (since the jawr-taglib does not open a session)... Regards, Niko
        Hide
        icefox added a comment -

        Hi,

        It seems that I've not been clear.

        Jawr don't use the session. It doesn't care about the session, all the information needed are in the ServletContext,
        which is retrieved through the session.
        The fact, that a new session is created is not an issue for Jawr.

        Jawr tries to retrieve the current session, the issue is that no session is found so a new one is created (which is not an issue for Jawr).
        I don't understand, why it is not able to find the current session.

        Cheers,

        Show
        icefox added a comment - Hi, It seems that I've not been clear. Jawr don't use the session. It doesn't care about the session, all the information needed are in the ServletContext, which is retrieved through the session. The fact, that a new session is created is not an issue for Jawr. Jawr tries to retrieve the current session, the issue is that no session is found so a new one is created (which is not an issue for Jawr). I don't understand, why it is not able to find the current session. Cheers,
        Hide
        icefox added a comment -

        Hi,

        Do you have any news about this issue.
        If not I'll close it.

        Cheers

        Show
        icefox added a comment - Hi, Do you have any news about this issue. If not I'll close it. Cheers

          People

          • Assignee:
            icefox
            Reporter:
            niko_k
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: