I'm designing help/hint system for my webpage, I'd like to incoroporate jQuery based contextual help.
My idea is that I would post request on event and show given repsonse in special div or so.
I would like to get similiar behaviour as <spring:message> tag, post message code and get String representation on localized message. It would be great if it would use same resources.
Is there a way to call this tag from Controller? (there is Java code behind this tag) Or what's best way to mimick this tag controller-side?
With the help of Teja Kantamneni I come with this Controller
@Controller
public class HelpController {
protected Log log = LogFactory.getLog(getClass());
@Autowired
private MessageSource messageSource;
@RequestMapping(value = "ajax/gethelp")
public @ResponseBody String handleGetHelp(Locale loc, String code) {
return messageSource.getMessage(code, null, loc);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With