NanoContainer
  1. NanoContainer
  2. NANO-18

servlet support and webwork2 support

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-beta-1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      2

      Description

      I have ported the old servlet and webwork support to the new pico api and webwork2. attached are two zip files, one for servlet and one for webwork2. they just need to be unpacked into the nanocontainer cvs checkout.

      Quick usage howto:
      components are defined in components-application.xml, components-session.xml and components-request.xml.

      the format is like this:
      <?xml version='1.0'?>
      <container>
      <component classname="org.nanocontainer.MyComponent"/>
      <component classname="org.nanocontainer.MyComponent2"/>
      </container>

      and the web.xml needs listeners for session and application and a request filter:
      <filter>
      <filter-name>picorequest</filter-name>
      <filter-class>org.nanocontainer.servlet.lifecycle.RequestLifecycleFilter</filter-class>
      </filter>
      <filter-mapping>
      <filter-name>picorequest</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>

      <listener>
      <listener-class>org.nanocontainer.webwork.lifecycle.ApplicationLifecycleListener</listener-class>
      </listener>

      <listener>
      <listener-class>org.nanocontainer.servlet.lifecycle.SessionLifecycleListener</listener-class>
      </listener>

      then you can just define constructors for your actions that request the components it needs. I am using this for two weeks now and it works great. Please commit it to nano cvs

        Activity

        Hide
        Christoph Sturm added a comment -

        servlet support

        Show
        Christoph Sturm added a comment - servlet support
        Christoph Sturm made changes -
        Field Original Value New Value
        Attachment servlet.zip [ 10901 ]
        Hide
        Christoph Sturm added a comment -

        webwork2 support. this contains webwork.jar and xwork.jar because they are not in the maven repo, and i had to apply a small patch to xwork
        (see http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-343)

        Show
        Christoph Sturm added a comment - webwork2 support. this contains webwork.jar and xwork.jar because they are not in the maven repo, and i had to apply a small patch to xwork (see http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-343 )
        Christoph Sturm made changes -
        Attachment webwork2.zip [ 10902 ]
        Hide
        Christoph Sturm added a comment -

        One thing i forgot:

        the HttpServletRequest and HttpServletResponse are automatically added as pico components.

        Show
        Christoph Sturm added a comment - One thing i forgot: the HttpServletRequest and HttpServletResponse are automatically added as pico components.
        Hide
        Christoph Sturm added a comment -

        one more thing i forgot: the components-xxx.xml files need to be in WEB-INF.

        maybe i should start to put all this docs on some wiki...

        Show
        Christoph Sturm added a comment - one more thing i forgot: the components-xxx.xml files need to be in WEB-INF. maybe i should start to put all this docs on some wiki...
        Hide
        Aslak Hellesøy added a comment -

        Yup, docs should go in one (or more) of the following places:

        -Wiki
        -JavaDocs
        -xocs folder

        Show
        Aslak Hellesøy added a comment - Yup, docs should go in one (or more) of the following places: -Wiki -JavaDocs -xocs folder
        Aslak Hellesøy made changes -
        Assignee Aslak Hellesoy [ rinkrank ]
        Status Unassigned [ 1 ] Assigned [ 2 ]
        Hide
        Aslak Hellesøy added a comment -

        Excellent work!

        Show
        Aslak Hellesøy added a comment - Excellent work!
        Aslak Hellesøy made changes -
        Fix Version/s 1.0-alpha-1 [ 10146 ]
        Status Assigned [ 2 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Mathias Bogaert added a comment -
        Show
        Mathias Bogaert added a comment - For people looking for documentation: http://wiki.opensymphony.com/space/PicoContainer+Integration

          People

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

            Dates

            • Created:
              Updated:
              Resolved: