0

I am trying to make a page that will display a dropdown but once I add the dropdown code my system does not work. I been trying to get this working for sometime now. can someone please help me out and tell me what I am getting the error

Here is my JSP:

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>School Visit Report</TITLE>
</HEAD>
<BODY>
<H1 align=left>UFT SCHOOL VISIT REPORT</H1>
<form:form commandName="visit">

<form:select path="reporter" items="${selectableReports}" />

</form:form>
</BODY>
</HTML>

Here is my Flow:

<on-start>
<evaluate expression="flowActions.initializeSelectableReport s()" 
result="flowScope.selectableReports" />
</on-start>


<view-state id="SchoolVisitReport" view="SchoolVisitReportSmall.jsp">

<transition on="submit" to="endState" />
<transition on="cancel" to="endState" bind="false"/>
</view-state>

Here is my error:

org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.springframework.webflow.execution.FlowExecutio nException: Exception thrown in state 'SchoolVisitReport' of flow 'visit'
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
root cause

org.springframework.webflow.execution.FlowExecutio nException: Exception thrown in state 'SchoolVisitReport' of flow 'visit'
org.springframework.webflow.engine.impl.FlowExecut ionImpl.wrap(FlowExecutionImpl.java:571)
org.springframework.webflow.engine.impl.FlowExecut ionImpl.resume(FlowExecutionImpl.java:262)
org.springframework.webflow.executor.FlowExecutorI mpl.resumeExecution(FlowExecutorImpl.java:169)
org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.handle(FlowHandlerAdapter.java:183)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:923)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
root cause

java.lang.IllegalStateException: Exception occurred rendering view org.springframework.web.servlet.view.JstlView: unnamed; URL [/WEB-INF/flows/visit/SchoolVisitReportSmall.jsp]
org.springframework.webflow.mvc.view.AbstractMvcVi ew.render(AbstractMvcView.java:191)
org.springframework.webflow.engine.ViewState.rende r(ViewState.java:296)
org.springframework.webflow.engine.ViewState.refre sh(ViewState.java:243)
org.springframework.webflow.engine.ViewState.resum e(ViewState.java:221)
org.springframework.webflow.engine.Flow.resume(Flo w.java:545)
org.springframework.webflow.engine.impl.FlowExecut ionImpl.resume(FlowExecutionImpl.java:258)
org.springframework.webflow.executor.FlowExecutorI mpl.resumeExecution(FlowExecutorImpl.java:169)
org.springframework.webflow.mvc.servlet.FlowHandle rAdapter.handle(FlowHandlerAdapter.java:183)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:923)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
root cause

org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/flows/visit/SchoolVisitReportSmall.jsp at line 15

12: <H1 align=left>UFT SCHOOL VISIT REPORT</H1>
13: <form:form commandName="visit">
14: 
15: <form:select path="reporter" items="${selectableReports}" />
16: 
17: </form:form>
18: </BODY>
Johnathan Smith
  • 1,112
  • 2
  • 17
  • 34

1 Answers1

2

You probably need to include the model in your view-state declaration.

<view-state id="SchoolVisitReport" view="SchoolVisitReportSmall.jsp" model="visit">

<transition on="submit" to="endState" />
<transition on="cancel" to="endState" bind="false"/>
</view-state>

Notice the model attribute. Also you will have to ensure you declare the visit model.

Now to the why. You are missing an important error message explaining why the rendering failed. I am betting you are receiving an error message saying that the command/modelAttribute was not found in your request scope. This would be achieved with the model attribute.

John Vint
  • 39,695
  • 7
  • 78
  • 108