I have a java class
LayoutManager.java, which I pass as a Sprean Bean into my jsp page using
<custom:useSpringBean var="layoutManager" bean="LayoutManager"/>
How do I call methods from LayoutManager.java inside my jsp using the spring bean?
I feel like I would use some form of servlets <% %>, but not sure about the syntax
I want to call the method
public Iterable<Layouts> getSpecificLayout(String subjectName)
The only spring code I have right now is
public class UseSpringBean extends SimpleTagSupport
{
public void doTag() throws JspException, IOExceptionP
PageContext pageContext = (PageContext)getJspContext();
WebApplicationContext springContext = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());
pageContext.setAttribute(var, springContext.getBean(bean), PageContxt.PAGE_SCOPE);
}
If you really want the list of
Layoutsto be used in the jsp page then from the spring controller you need to add this list in theModelMapso that its visible in the jsp page.Something like:
in jsp:
(This is not a tested code just a sample. Sorry somehow the code editing is not working, I mean I am not able to see the inline editor).