Skip to content
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

Add SpringHelper with message source access feature. #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kwon37xi
Copy link
Contributor

@kwon37xi kwon37xi commented Feb 8, 2014

I made SpringHelper for spring-jade4j.
This version only has message(Message Source) related methods. I'm going to add bind and form related methods soon.

If you set viewResolver.setExposeSpringMacroHelpers(true), SpringHelper will be injected to model object automatically as 'spring'. And when you have messageSource bean, you can use SpringHelper like the following.

p Message from message source : #{spring.message('test.message')}!
p= spring.messageWithArgs('test.format', 'format argment 1', formatArgumentFromModel)
p Default Text test #{spring.messageText('unknown.code', 'Default text can be here.')}
JadeViewResolver viewResolver = new JadeViewResolver();
viewResolver.setExposeSpringMacroHelpers(true);

viewResolver.setExposeRequestAttributes(true);
viewResolver.setExposeSessionAttributes(true);
//...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant