Struts 2
  1. Struts 2
  2. WW-2104

Need to create StrutsRequestWrapper objects to resolve request attributes from the value stack

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: Plugin - Portlet
    • Labels:
      None

      Description

      Since there is no wrapping of the render request when dispatching to the JSPs, request attributes will not be resolved from the value stack, and tags such as displaytag won't work unless objects are explicitly put on the request as an attribute.

        Activity

        Hide
        Nils-Helge Garli added a comment -

        I have Implemented suggested improvments to naming and configuration, so I'm setting this issue to resolved.

        Show
        Nils-Helge Garli added a comment - I have Implemented suggested improvments to naming and configuration, so I'm setting this issue to resolved.
        Hide
        Nils-Helge Garli added a comment -

        Yes, we should probably rename it in the web.xml, and even allow for a configuration in case the user wants to control the name.

        I know several portlet frameworks use servlets to render the results, so it's probably safe.

        Show
        Nils-Helge Garli added a comment - Yes, we should probably rename it in the web.xml, and even allow for a configuration in case the user wants to control the name. I know several portlet frameworks use servlets to render the results, so it's probably safe.
        Hide
        James Holmes added a comment -

        Nils-H, I'm not sure if you knew this or not, but Spring MVC is using a similar dispatcher servlet technique for handling the view for portlets. See this page:

        http://www.springframework.org/docs/reference/portlet.html

        Section 16.3. The ViewRendererServlet explains this.

        Show
        James Holmes added a comment - Nils-H, I'm not sure if you knew this or not, but Spring MVC is using a similar dispatcher servlet technique for handling the view for portlets. See this page: http://www.springframework.org/docs/reference/portlet.html Section 16.3. The ViewRendererServlet explains this.
        Hide
        James Holmes added a comment - - edited

        Many thanks for opening the ticket and putting together the initial code! I am testing it now and it is working for me using Jetspeed 2. The Displaytag library is now picking up objects on the valuestack.

        One thing I noticed though is that you have to define the DispatcherServlet in web.xml using the specific name "dispatcherServlet". I'm wondering if there is a way to make this dynamic. By that I mean that you can use any name for the servlet and the Struts 2 portlet code will automatically find the servlet. If not, I propose we make the name be something like "Struts2PortletDispatcherServlet" that is more descriptive and less likely to have any name conflict with another servlet someone might have.

        Show
        James Holmes added a comment - - edited Many thanks for opening the ticket and putting together the initial code! I am testing it now and it is working for me using Jetspeed 2. The Displaytag library is now picking up objects on the valuestack. One thing I noticed though is that you have to define the DispatcherServlet in web.xml using the specific name "dispatcherServlet". I'm wondering if there is a way to make this dynamic. By that I mean that you can use any name for the servlet and the Struts 2 portlet code will automatically find the servlet. If not, I propose we make the name be something like "Struts2PortletDispatcherServlet" that is more descriptive and less likely to have any name conflict with another servlet someone might have.

          People

          • Assignee:
            Nils-Helge Garli
            Reporter:
            Nils-Helge Garli
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development