New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<form:label/> should have MessageSource support [SPR-2566] #7255

Closed
spring-issuemaster opened this Issue Sep 8, 2006 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented Sep 8, 2006

Rick Evans opened SPR-2566 and commented

(c.f. comment from Matt Raible on #7043)

It would be cool if this tag supported a "key" attribute so you could read directly from your messageSource. For example:

<form:label path="firstName" key="user.firstName"/>

Just a thought.

Matt


Affects: 2.0 RC3

Issue Links:

  • #8047 Provide comprehensive I18N support for the Spring form tag library. ("is depended on by")
  • #6768 Add MessageSource support to HTML taglib ("is duplicated by")

15 votes, 12 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Sep 16, 2006

Rick Evans commented

I18N support for the entire gorm tag library is going to be addressed in 2.1 RC1.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Oct 6, 2006

Jared Stehler commented

Also, it would be really cool and helpful if you could add the additional functionality found in the appFuse labelTag for linking with the commons validator to show if a field is required, and/or errors which have been reported on that field.

It does so by grabbing a ValidatorFactory from the webApplicationContext, and getting the ValidatorResources from there... I am using a slightly modified version of this tag, as I have multiple layers of validation and therefore multiple validator factory beans defined (for differing webFlows, etc), so I wanted the ability to specify the validator resources that I wanted the label tags to use. I ended up storing the string name of the particular flow's validator factory bean in the flowScope on the initial state of the webflow, and changing LabelTag.getValidatorResources() as follows:

String validatorFactoryBeanName = (String)
         pageContext.getRequest().getAttribute( WizardAction.WIZARD_VALIDATOR_RESOURCES );
if( validatorFactoryBeanName != null )
         factory = (ValidatorFactory) ctx.getBean(validatorFactoryBeanName);

Each flow defines its own WizardAction bean, injecting the name of its particular validator factory bean, which in turn is defined with its own validation.xml file.

It turns out you cant store a ValidatorResources object in flowScope, since although it claims to be serializable, after you run one validation with it, it stores references to Method objects, which are not, and you get nasty conversation errors.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment