Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've fixed the issue, please find the new xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt; &lt;bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" /&gt; &lt;bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" /&gt; &lt;bean id="tempService" class="usebeans.TempServiceImpl" /&gt; &lt;bean id="tempController" class="controller.Temp"/&gt; &lt;bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt; &lt;property name="mappings"&gt; &lt;props&gt; &lt;prop key="index.htm"&gt;indexController&lt;/prop&gt; &lt;prop key="Temp.htm"&gt;tempController&lt;/prop&gt; &lt;!-- You need to mapp the url to the controller bean--&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /&gt; &lt;bean name="indexController" class="org.springframework.web.servlet.mvc.ParameterizableViewController" p:viewName="index" /&gt; &lt;/beans&gt; </code></pre> <p>Fix was related to <code>&lt;prop key="Temp.htm"&gt;tempController&lt;/prop&gt;</code>.</p> <p>For the second error change the class <code>Temp</code> as below</p> <pre><code>package controller; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController; import usebeans.TempService; import validators.ValidationForm; @SuppressWarnings("deprecation") final public class Temp extends SimpleFormController { private TempService tempService = null; public Temp() { // setCommandClass(Temp.class); // setSuccessView("Temp"); // setFormView("Temp"); setCommandClass(ValidationForm.class); // Still not working. setCommandName("validationForm"); } public void setTempService(TempService tempService) { this.tempService = tempService; } @Override protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception { ModelAndView mv = new ModelAndView(); ValidationForm validationForm = (ValidationForm) command; tempService.add(validationForm); return mv; } @Override protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception { Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;(); model.put(getCommandName(), new ValidationForm()); ModelAndView mv = new ModelAndView("Temp", model); return mv; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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