jeudi 26 février 2015

Spring: No mapping found for HTTP request with URI [] in DispatcherServlet with name 'dispatcher'

I am trying to implement login to my web app using spring security. Eventhough the user is logged in successfully I am getting the above warning message. The same configurations are working for other app but not working for this one.Please help


my web.xml file:



<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://ift.tt/HeF78r" >

<web-app id="WebApp_ID" version="2.4"
xmlns="http://ift.tt/qzwahU" xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/qzwahU
http://ift.tt/16hRdKA">

<display-name>Archetype Created Web Application</display-name>

<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>/</url-pattern>
</servlet-mapping>


<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/dispatcher-servlet.xml
/WEB-INF/security-config.xml
/WEB-INF/mongo-config.xml
</param-value>
</context-param>

<welcome-file-list>
<welcome-file></welcome-file>
</welcome-file-list>

<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>


<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>



</web-app>


security-config file:



<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://ift.tt/1c8inpe"
xmlns:xsi="http://ift.tt/ra1lAU" xmlns:context="http://ift.tt/GArMu7"
xmlns:tx="http://ift.tt/OGfeU2" xmlns:p="http://ift.tt/1jdM0fE"
xmlns:beans="http://ift.tt/GArMu6"
xmlns:security="http://ift.tt/1c8inpe"
xsi:schemaLocation="
http://ift.tt/1c8inpe
http://ift.tt/18sW2ay
http://ift.tt/GArMu6
http://ift.tt/QEDs1e
http://ift.tt/OGfeU2
http://ift.tt/1cQrvTl
http://ift.tt/GArMu7
http://ift.tt/QEDs1k">

<!-- enable use-expressions -->
<security:http auto-config="true" use-expressions="true" access-denied-page="/denied">
<security:intercept-url pattern="/login" access="permitAll"/>
<security:intercept-url pattern="/register" access="permitAll"/>
<security:intercept-url pattern="/addUser" access="permitAll"/>
<security:intercept-url pattern="/home" access="hasRole('ROLE_USER')"/>
<security:form-login
login-page="/login"
authentication-failure-url="/login?error=true"
default-target-url="/home"/>

<security:logout
invalidate-session="true"
logout-success-url="/login"
logout-url="/logoutServlet"/>
</security:http>

<security:authentication-manager>
<security:authentication-provider user-service-ref="customUserDetailsService">
<security:password-encoder ref="passwordEncoder"/>
</security:authentication-provider>
</security:authentication-manager>

<!-- Use a Md5 encoder since the user's passwords are stored as Md5 in the database -->
<beans:bean class="org.springframework.security.authentication.encoding.Md5PasswordEncoder" id="passwordEncoder">
</beans:bean>

<!-- A custom service where Spring will retrieve users and their corresponding access levels -->
<beans:bean id="customUserDetailsService" class="service.CustomUserDetailsService">
</beans:bean>

</beans:beans>


dispatcher-servlet file



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU" xmlns:mvc="http://ift.tt/1bHqwjR"
xmlns:context="http://ift.tt/GArMu7"
xsi:schemaLocation="http://ift.tt/1bHqwjR http://ift.tt/1bVJL9q
http://ift.tt/GArMu6 http://ift.tt/QEDs1e
http://ift.tt/GArMu7 http://ift.tt/QEDs1k">

<mvc:resources mapping="/css/**" location="/css/" />
<mvc:resources mapping="/fonts/**" location="/fonts/" />
<mvc:resources mapping="/javascript/**" location="/javascript/" />
<mvc:annotation-driven />

<context:component-scan base-package="controller" />
<!-- <context:component-scan base-package="services" /> -->

<context:annotation-config />
<bean id="imapService" class="service.ImapServiceImpl"></bean>
<bean id="userService" class="service.UserServiceImpl"></bean>

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

<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="10000000" />
</bean>
</beans>


Warning shown: WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/Webclient/home] in DispatcherServlet with name 'dispatcher'


Aucun commentaire:

Enregistrer un commentaire