spring security mvc application noHandler found -
hi new spring mvc security , getting following error whenever access page.and images js , css files not load.
mar 25, 2014 11:34:14 org.springframework.web.servlet.dispatcherservlet nohandlerfound warning: no mapping found http request uri [/sam/img/hagal_logo.png] in dispatcherservlet name 'mvc-dispatcher' mar 25, 2014 11:34 org.springframework.web.servlet.dispatcherservlet nohandlerfound warning: no mapping found http request uri [/sam/bootstrap/js/bootstrap.min.js] in dispatcherservlet name 'mvc-dispatcher' mar 25, 2014 11:34:14 org.springframework.web.servlet.dispatcherservlet nohandlerfound warning: no mapping found http request uri [/sam/js/jquery.actual.min.js] in dispatcherservlet name 'mvc-dispatcher' mar 25, 2014 11:34:14 org.springframework.web.servlet.dispatcherservlet nohandlerfound warning: no mapping found http request uri [/sam/js/jquery.min.js] in dispatcherservlet name 'mvc-dispatcher' mar 25, 2014 11:34:14 org.springframework.web.servlet.dispatcherservlet nohandlerfound warning: no mapping found http request uri [/sam/js/lib/jquery-validation/jquery.validate.js] in dispatcherservlet name 'mvc-dispatcher' <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>some</display-name> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class> org.springframework.web.servlet.dispatcherservlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc-dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/mvc-dispatcher-servlet.xml, classpath:spring-security.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.contextloaderlistener </listener-class> </listener> <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> , here dispatcher-servlet
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-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/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <context:component-scan base-package="com.quad.controller" /> <context:component-scan base-package="com.quad.dao" /> <context:component-scan base-package="com.quad.entity" /> <context:component-scan base-package="com.quad.service" /> <context:property-placeholder location="classpath:database.properties" /> <tx:annotation-driven transaction-manager="transactionmanager"/> <bean id="transactionmanager" class="org.springframework.orm.hibernate3.hibernatetransactionmanager"> <property name="sessionfactory" ref="sessionfactory" /> </bean> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix"> <value>/jsp/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="${database.driver}" /> <property name="url" value="${database.url}" /> <property name="username" value="${database.user}" /> <property name="password" value="${database.password}" /> </bean> <bean id="sessionfactory" class="org.springframework.orm.hibernate3.annotation.annotationsessionfactorybean"> <property name="datasource" ref="datasource" /> <property name="hibernateproperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> </props> </property> </bean> and spring-security.xml
<?xml version="1.0" encoding="utf-8"?> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
<http auto-config="true"> <intercept-url pattern="/**" access="is_authenticated_anonymously" /> <intercept-url pattern="/welcome" access="role_user" /> <intercept-url pattern="/admin/*" access="role_admin" /> <form-login login-page="/login.html" default-target-url="/login-success.html" authentication-failure-url="/login-error.html" /> <logout logout-success-url="/index.html" /> </http> <authentication-manager> <authentication-provider user-service-ref="customuserdetailsservice"> <password-encoder hash="plaintext" /> </authentication-provider> </authentication-manager>
please add mvc namespace.
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:tx="http://www.springframework.org/schema/tx" 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/context http://www.springframework.org/schema/context/spring-context-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/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <mvc:resources mapping="/js/**" location="/js/**" /> //whatever ur path of js , images is. <mvc:annotation-driven />
Comments
Post a Comment