PicoContainer
  1. PicoContainer
  2. PICO-73

picoextras-servlet - Alternative approach?

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-beta-5
    • Fix Version/s: None
    • Component/s: PicoContainer (Java)
    • Labels:
      None
    • Number of attachments :
      2

      Description

      hi, here it is finally my approach in bringing picocontainer to the web. As discussed in the mailing list i see several drawbacks in the way it is currently done by picoextras-servlet and i'd like everyone to take a look and comment on my way.

      Note: i didn't supply a test-case cause i don't know how to write tests for a HttpServletRequest. mocking wont help me here i think.

      Another Note: there's not a lot of documentation included cause its 5am over here and I'm tired. I hope you understand it without it.

        Activity

        Hide
        Thomas Heller added a comment -

        drop this into you favorite servlet container.

        NOTE: it was compiled against tomcat5 (jsp2/servlet2.4) i have no idea if it runs under anything else but it should.

        point your browser to http://yourhost:8080/pico/index.jsp afterwards and start hitting reload

        Show
        Thomas Heller added a comment - drop this into you favorite servlet container. NOTE: it was compiled against tomcat5 (jsp2/servlet2.4) i have no idea if it runs under anything else but it should. point your browser to http://yourhost:8080/pico/index.jsp afterwards and start hitting reload
        Thomas Heller made changes -
        Field Original Value New Value
        Attachment pico.war [ 11085 ]
        Hide
        Thomas Heller added a comment -

        the sources.

        Show
        Thomas Heller added a comment - the sources.
        Thomas Heller made changes -
        Attachment picoextras-servlet-source.zip [ 11086 ]
        Hide
        Thomas Heller added a comment -

        oh, first look at the index.jsp source.

        after that at

        org.picoextras.servlet.sample.SampleContainerAssembler

        after that at

        org.picoextras.servlet.PicoContextFilter.

        That should get you started and make you understand the whole thing. I've chosen hardcoded deployment since no assembler supports my deployment way.

        Show
        Thomas Heller added a comment - oh, first look at the index.jsp source. after that at org.picoextras.servlet.sample.SampleContainerAssembler after that at org.picoextras.servlet.PicoContextFilter. That should get you started and make you understand the whole thing. I've chosen hardcoded deployment since no assembler supports my deployment way.
        Hide
        Fran?ois Beauregard added a comment -

        How does this differs from picoextras-servlet (that depends on picoextras-integrationkit) currently found in nano?

        We are currently trying to use WebWork2 with picocontainer with mitigated success using what is currently in nano's cvs (picoextras-webwork2, picoextras-servlet, picoextras-integrationkit).

        Anyone done this with success?

        Show
        Fran?ois Beauregard added a comment - How does this differs from picoextras-servlet (that depends on picoextras-integrationkit) currently found in nano? We are currently trying to use WebWork2 with picocontainer with mitigated success using what is currently in nano's cvs (picoextras-webwork2, picoextras-servlet, picoextras-integrationkit). Anyone done this with success?
        Aslak Hellesøy made changes -
        Assignee Joe Walnes [ jwalnes1 ]
        Hide
        Mathias Bogaert added a comment -

        One advantage of this approach is that is exposes the HttpSession and HttpServletRequest to your actions. Didn't test is yet though...

        Show
        Mathias Bogaert added a comment - One advantage of this approach is that is exposes the HttpSession and HttpServletRequest to your actions. Didn't test is yet though...
        Aslak Hellesøy made changes -
        Assignee Joe Walnes [ jwalnes1 ] Aslak Hellesoy [ rinkrank ]
        Aslak Hellesøy made changes -
        Fix Version/s 2.0 [ 10411 ]
        Hide
        Thomas Heller added a comment -

        please ignore close&won't fix this issue. It doesn't work when you have more than one filter and want to use pico (which is initialized in PicoFilter) in one of these. Also it has too many statics and no testcases. It works with some fixes tho and I'm using it in a project but will rework it soon.

        Show
        Thomas Heller added a comment - please ignore close&won't fix this issue. It doesn't work when you have more than one filter and want to use pico (which is initialized in PicoFilter) in one of these. Also it has too many statics and no testcases. It works with some fixes tho and I'm using it in a project but will rework it soon.
        Aslak Hellesøy made changes -
        Fix Version/s 2.0 [ 10411 ]
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]

          People

          • Assignee:
            Aslak Hellesøy
            Reporter:
            Thomas Heller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: