Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MVC IllegalStateException Error
    text
    copied!<p>I'm trying to create a simple test website using spring MVC and I cannot seem to get past the most simple case. I have a jsp website that is a "login" that has 2 inputs and a submit button, but it will not display anything except an error message. Using Spring 3.0.2 and Tomcat 6.0.29 Stand-alone.</p> <p>IndexController.java:</p> <pre><code>@Controller @RequestMapping("login.htm*") public class IndexController { @RequestMapping(method=RequestMethod.GET) public String getLoginPage(Map model){ UserAccess user = new UserAccess(); model.put("user", user); return "login"; } </code></pre> <p>login.jsp:</p> <pre><code>&lt;%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %&gt; &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt; &lt;/head&gt; &lt;body&gt; &lt;form:form action="login.htm" commandName="user"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;Enter Username:&lt;/td&gt; &lt;td&gt;&lt;form:input path="username" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Enter Password:&lt;/td&gt; &lt;td&gt;&lt;form:password path="password" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="submit" value="Submit"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form:form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>My UserAccess class is nothing more then a username, password and a bunch of getter/setters, just like any bean should be. Enclosed it a picture of the error I get upon build, please let me know if you need any more information to help me. <img src="https://i.stack.imgur.com/NTOOn.png" alt="Error Picture"></p> <p>My servlet.xml </p> <pre><code>&lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt; &lt;property name="prefix" value="" /&gt; &lt;property name="suffix" value=".jsp" /&gt; &lt;/bean&gt; </code></pre> <p>As well as my project's web.xml</p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;servlet&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;login.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload