This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes org.springframework.web.servlet.DispatcherServlet noHandlerFound error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "org.springframework.web.servlet.DispatcherServlet noHandlerFound error" Watch "org.springframework.web.servlet.DispatcherServlet noHandlerFound error" New topic
Author

org.springframework.web.servlet.DispatcherServlet noHandlerFound error

shakti rath
Greenhorn

Joined: Dec 22, 2011
Posts: 8
web.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>SpringDwr</display-name>
<welcome-file-list>
<welcome-file>/jsp/Home.jsp</welcome-file>
</welcome-file-list>


<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>



</web-app>


dispatcher-servlet.xml is :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd">

<bean id="datasource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"></property>
<property name="url" value="jdbcracle:thin:@localhost:1521:XE"></property>
<property name="username" value="vechile"></property>
<property name="password" value="vechile"></property>
</bean>

<!-- Business Layer Configuration -->
<bean id="loginbusiness" class="com.vechile.business.businessimpl.LoginBusinessImpl">
<property name="logindata" ref="logindata"></property>
</bean>

<bean id="routeBusiness" class="com.vechile.business.businessimpl.RouteBusinessImpl">
<property name="routeData" ref="routeData"></property>
</bean>

<bean id="timeBusiness" class="com.vechile.business.businessimpl.TimeBusinessImpl">
<property name="timeData" ref="timeData"></property>
</bean>
<bean id="employeeBusiness" class="com.vechile.business.businessimpl.EmployeeBusinessImpl">
<property name="employeeData" ref="employeeData"></property>
</bean>
<!-- Business Layer Configuration -->

<!-- Data Layer Configuration -->
<bean id="logindata" class="com.vechile.data.dataimpl.LoginDataImpl">
<property name="dataSource" ref="datasource"></property>
</bean>

<bean id="routeData" class="com.vechile.data.dataimpl.RouteDataImpl">
<property name="dataSource" ref="datasource"></property>
</bean>

<bean id="timeData" class="com.vechile.data.dataimpl.TimeDataImpl">
<property name="dataSource" ref="datasource"></property>
</bean>

<bean id="employeeData" class="com.vechile.data.dataimpl.EmployeeDataImpl">
<property name="dataSource" ref="datasource"></property>
</bean>
<!-- Data Layer Configuration -->


<!-- <dwr:controller id="dwrController" debug="true"></dwr:controller> -->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="alwaysUseFullPath" value="true"></property>
<property name="mappings">
<props>
<!-- <prop key="/dwr/**/*">dwrController</prop> -->
<prop key="/login.html">logincont</prop>
<prop key="/route.html">routecont</prop>
<prop key="/time.html">timecont</prop>
<prop key="/employee.html">employeecont</prop>
<prop key="/register.html">registercont</prop>
</props>
</property>
</bean>


<!-- Controller Layer Configuration -->
<bean id="logincont" class="com.vechile.controller.LoginController">
<property name="commandClass" value="com.vechile.bean.LoginBean"></property>
<property name="commandName" value="lgb"></property>
<property name="successView" value="AdminHome"></property>
<property name="loginbusiness" ref="loginbusiness"></property>
</bean>

<bean id="routecont" class="com.vechile.controller.RouteController">
<property name="commandClass" value="com.vechile.bean.RouteBean"></property>
<property name="commandName" value="RB"></property>
<property name="successView" value="AdminHome"></property>
<property name="routeBusiness" ref="routeBusiness"></property>
</bean>

<bean id="timecont" class="com.vechile.controller.TimeController">
<property name="commandClass" value="com.vechile.bean.TimeBean"></property>
<property name="commandName" value="TB"></property>
<property name="successView" value="AdminHome"></property>
<property name="timeBusiness" ref="timeBusiness"></property>
</bean>

<bean id="employeecont" class="com.vechile.controller.EmployeeController">
<property name="commandClass" value="com.vechile.bean.EmployeeBean"></property>
<property name="commandName" value="EB"></property>
<property name="successView" value="AdminHome"></property>
<property name="employeeBusiness" ref="employeeBusiness"></property>
</bean>

<bean id="registercont" class="com.vechile.controller.RegisterController">
<property name="commandClass" value="com.vechile.bean.RegisterBean"></property>
<property name="commandName" value="RGB"></property>
<property name="successView" value="Home"></property>
</bean>
<!-- Controller Layer Configuration -->

<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>


</beans>


jsp page is :

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="<%=request.getContextPath()%>/css/style.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript"
src="<%=request.getContextPath()%>/js/Register.js"></script>
</head>
<body>
<form action="register.html" method="post" name="registerform">
<fieldset>
<legend>Registration form</legend>
<table>
<tr>
<td>Name :</td>
<td><input type="text" name="name" />
</td>
</tr>
<tr>
<td>Address :</td>
<td><textarea rows="10" cols="20" name="address"></textarea>
</td>
</tr>
<tr>
<td>Email :</td>
<td><input type="text" name="email" />
</td>
</tr>
<tr>
<td>Username :</td>
<td><input type="text" name="username" />
</td>
</tr>
<tr>
<td>Password :</td>
<td><input type="password" name="password" />
</td>
</tr>
<tr>
<td>Confirm Password :</td>
<td><input type="password" name="confirmpassword" />
</td>
</tr>
<tr>
<td id="web-buttons-idmb27q"><a href="#" title="Register" onclick="registerClick();"
style="background-image: url(<%=request.getContextPath()%>/images/Registerbutton.png); width: 83px; height: 34px; display: block;"><br />
</a></td>
</tr>
</table>
</fieldset>
</form>
</body>
</html>

js file is:

function registerClick(){
document.registerform.submit();
}

error on clicking on this button is :

Mar 29, 2012 12:33:29 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/Vechile/jsp/register.html] in DispatcherServlet with name 'dispatcher'
shakti rath
Greenhorn

Joined: Dec 22, 2011
Posts: 8
i hope i will get any answer from any one
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
Please change the following line


to

.
shakti rath
Greenhorn

Joined: Dec 22, 2011
Posts: 8
i have tried this way. It is still not working
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
i have tried this way. It is still not working


Are you getting the same error as below after the changes I suggested?

Mar 29, 2012 12:33:29 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
WARNING: No mapping found for HTTP request with URI [/Vechile/jsp/register.html] in DispatcherServlet with name 'dispatcher'


Can you post the new error message that you see now.

shakti rath
Greenhorn

Joined: Dec 22, 2011
Posts: 8
yes
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
I guess, your changes were not picked up by the web server . otherwise it should have given you either a different error or fixed your problem.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.springframework.web.servlet.DispatcherServlet noHandlerFound error
 
Similar Threads
Neither BindingResult nor plain target object for bean name 'vids2m1' available as request attribute
exceptions in spring configuration file.
how to get session from spring-config.xml
AbstractWizardFormController: java.lang.NullPointerException at processFinish(...)
org.springframework.beans.NotReadablePropertyException