I am using Spring 3.2.11.RELEASE with JBoss 7.1.3.Final and Java 6. I have this method in the controller
@RequestMapping(value = "/method", method = RequestMethod.GET) public String myMethod(final Model model, final HttpServletRequest request, final HttpServletResponse response, final Principal principal) ... model.addAttribute("paramName", "paramValue");
Notice how I add attributes to my model. My question is, on the JSP page on which this page works, how can I iterate over all the attributes in my model and display them as HIDDEN input fields with the name INPUT, which is the name of the attribute, and the value that I inserted into using this attribute?
Edit: In response to the provided answer, a JSP solution is displayed here. Please note that there are no model attributes in it.
<input type='hidden' name='javax.servlet.jsp.jspRequest' value='org.spring framework.web.context.support.ContextExposingHttpServletRequest@ 7a0a4c3f'> <input type='hidden' name='javax.servlet.jsp.jspPageContext' value=' org.apache.jasper.runtime.PageContextImpl@3939794a '> <input type='hidden' name='appVersion' value='???application.version???'> <input type='hidden' name='javax.servlet.jsp.jspResponse' value=' org.owasp.csrfguard.http.InterceptRedirectResponse@722033be '> <input type='hidden' name='javax.servlet.jsp.jspApplication' value=' io.undertow.servlet.spec.ServletContextImpl@14c1252c '> <input type='hidden' name='org.apache.taglibs.standard.jsp.ImplicitObjects' value=' javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects@23 c27a49'> <input type='hidden' name='javax.servlet.jsp.jspOut' value=' org.apache.jasper.runtime.JspWriterImpl@b01a1ba '> <input type='hidden' name='javax.servlet.jsp.jspPage' value=' org.apache.jsp.WEB_002dINF.views.lti.launch_jsp@1dcc48bf '> <input type='hidden' name='javax.servlet.jsp.jspConfig' value=' io.undertow.servlet.spec.ServletConfigImpl@3fd40806 '>
source share