[
http://www.stripesframework.org/jira/browse/STS-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11620#action_11620
]
Evgeny Shepelyuk commented on STS-297:
--------------------------------------
It also can be useful to make TypeConverters aware of action bean or actino
bean context or any class that can provide access to request/response/servlet
context.
For example i need to convert some string to integer depeding on user settings
(e.g. from cookies), user input can be inches/foots/millimetres/metres etc.
And having access to servlet context from custom type converter can be very
helpful in this case.
> A mechanism to pass parameters to TypeConverters
> ------------------------------------------------
>
> Key: STS-297
> URL: http://www.stripesframework.org/jira/browse/STS-297
> Project: Stripes
> Issue Type: New Feature
> Components: Validation
> Reporter: Andy
>
> The canonical example is the ability to have a BigDecimal type converter that
> will automatically truncate the number down to the required scale. For
> example, you might want to be able to write something like:
> @Validate(converterpara...@param(name="scale" value="2") BigDecimal
> dollarAmount;
> @Validate(converterpara...@param(name="scale" value="0") BigDecimal
> liraAmount;
> I don't particularly like the syntax that I've written above, but it would
> need to be something flexible since each converter make take a different set
> of parameters. Also, might need to deal with type issues - the parameter
> above is obviously a number but the value is expressed as a string. Perhaps
> it could work with:
> @Param(name="foo", [numValue=N|stringValue="N"|etc.]?
> Also would need to figure out how to make the type converter aware of these
> parameters. Do we try to inject them using setters? Or just pass across a
> map of key/value pairs?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development