Stripes

Pass ActionBeanContext or ActionBean to TypeConverterFactory getInstance method

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5.1
  • Fix Version/s: None
  • Component/s: Validation
  • Labels:
    None
  • Environment:
    All

Description

It would be extremely helpful to have access to the context or the ActionBean in TypeConverters. This would allow converters to access session-level properties, which could allow developers to extend TypeConverters to domain-level objects that require authentication. Currently all this logic has to be in the ActionBean, which leads to a lot of code duplication.

The converters are passed the locale which already comes straight from the actionBean.actionBeanContext (net.sourceforge.stripes.controller.DefaultActionBeanPropertyBinder, line 755).

As it stands the developer has to extend both the DefaultActionBeanPropertyBinder and the DefaultTypeConverterFactory (not the end of the world, certainly, but does go against the Stripes "it-just-works" way of doing things).

Activity

Hide
Anthony DePalma added a comment - 18/Aug/11 10:41 AM

I agree, this would be very helpful

Show
Anthony DePalma added a comment - 18/Aug/11 10:41 AM I agree, this would be very helpful
Hide
John Newman added a comment - 18/Aug/11 10:53 AM

probably not necessary to fix this anymore as a coincidental change in 1.6 will solve the problem.

see http://old.nabble.com/forum/ViewPost.jtp?post=31918174&framed=y

Show
John Newman added a comment - 18/Aug/11 10:53 AM probably not necessary to fix this anymore as a coincidental change in 1.6 will solve the problem. see http://old.nabble.com/forum/ViewPost.jtp?post=31918174&framed=y

People

Vote (1)
Watch (1)

Dates

  • Created:
    10/Aug/09 2:41 PM
    Updated:
    18/Aug/11 10:53 AM