Note that there are some explanatory texts on larger screens.

plurals
  1. POSprings dispatcher servet searching a jsp page instead of calling a controller method
    primarykey
    data
    text
    <p>Hi I am trying to authenticate the user but seems like its calling a jsp page instead of another controller mapping.</p> <p>My dispatcher servlet is</p> <p> </p> <pre><code>&lt;bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt; &lt;property name="driverClassName" value="${database.driver}" /&gt; &lt;property name="url" value="${database.url}" /&gt; &lt;property name="username" value="${database.user}" /&gt; &lt;property name="password" value="${database.password}" /&gt; &lt;/bean&gt; &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt; &lt;property name="dataSource" ref="dataSource" /&gt; &lt;property name="annotatedClasses"&gt; &lt;list&gt; &lt;value&gt;com.beingjavaguys.domain.User&lt;/value&gt; &lt;value&gt;com.beingjavaguys.domain.Chat&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; &lt;property name="hibernateProperties"&gt; &lt;props&gt; &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt; &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt; &lt;property name="sessionFactory" ref="sessionFactory" /&gt; &lt;/bean&gt; </code></pre> <p>My <code>web.xml</code> is</p> <p> dispatcher org.springframework.web.servlet.DispatcherServlet 1 </p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;url-pattern&gt;*.html&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre> <p>and my controller is</p> <pre><code>@RequestMapping(value="/authenticate",method=RequestMethod.POST) public ModelAndView getAuthenticateResult(@ModelAttribute("user") User user, BindingResult result) { if(userService.authenticate(user)) { return new ModelAndView("/userList"); } else{ return new ModelAndView("Login"); } } @RequestMapping(value="/userList", method=RequestMethod.GET) public ModelAndView getUserList() { Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;(); model.put("chat", userService.getChat()); return new ModelAndView("UserDetails", model); } </code></pre> <p>I am calling <code>authenticate.html</code> from my login file using <code>POST</code> method but my problem is this error</p> <pre><code>HTTP Status 404 - /Spring-hibernate-integration-helloworld/WEB-INF/view/userList.jsp type Status report message /Spring-hibernate-integration-helloworld/WEB-INF/view/userList.html.jsp description The requested resource is not available. </code></pre> <p>Why is it searching for the jsp file instead of redirecting it to a controller method? But if i use <code>redirect:/userList.html</code> it works then.Whats the logic behind it?</p>
    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. This table or related slice is empty.
    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