How would you port this front-end logic from erb to jsp/jstl?
<%= error_messages_for :foo %>
Is there any Java library that does something similar?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Maintain them in a
Map<String, String>in the business code, put it in the request scope like so:Then you can access it in JSP the usual EL way by
${messages.key}or${messages['key']}:EL is builtin in JSP since ages. You don’t need to install it. Only the
fn:escapeXml(which is mandatory to prevent XSS) is part of JSTL which may need to be installed separately at certain servletcontainers.