Velocity Tools
  1. Velocity Tools
  2. VELTOOLS-94

Document standard use cases with J2EE filters


    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Documentation
    • Labels:
    • Environment:


      (yet another docs reminder...)

      There are some use cases concerning J2EE filters that I'd like to address/document before releasing 2.0 final:

      1. sharing the VelocityView with filters - made very easy in 2.x, using:

      view = (VelocityView)servletContext.getAttribute(VelocityView.class.getName())

      but the loat-a-startup flag must be set on the servlets for the view to be initialized at the time the filter is called.

      [BTW, the VelocityView(ServletContext) exists but is not yet fully coded - init is not yet called. We should either comment it for now or refactor VV.init/configure to work either with a ServletConfig or ServletContext. Personally I don't need it at all.]

      2. having a filter add objects in the context: very easy, objects should be put in targeted scopes using request/session/application attributes.

      3. having a filter add a tools property (that will be added to newly created request/session tools using bean setters or configure): I'm not really sure about this one. With the current codebase, it is necessary to subclass both the VV and the ToolboxFactory to circumvent protected accesses to be able to do sthing like this:


      I'd vote for having those two methods made public.

      [BTW, subclassing of the VV also requires for now the subclassing of the VVS... maybe ServletUtils.getVelocityView could check a configuration property like "" containing the classname of the VelocityView subclass to be used]


        No work has yet been logged on this issue.


          • Assignee:
            Claude Brisson
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: