Results 1 to 3 of 3

Thread: Signon with BeanNameUrlHandlerMapping newbie problem

  1. #1
    Join Date
    Jan 2005
    Posts
    17

    Default Signon with BeanNameUrlHandlerMapping newbie problem

    Im completle new to Spring and wanted to write a sample application from scratch. Now I want to make a signon similar to the petstore example.

    I have got a public Controller Access:

    Code:
    <bean id="defaultHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
    	
    	<bean name="login.html" class="at.newsagg.web.LoginFormController"> 
    		<property name="commandName">
    			<value>login</value>
    		</property> 
    		<property name="commandClass"> 
    			<value>at.newsagg.model.User</value> 
    		</property> 
    		<property name="formView">
    			<value>login</value>
    		</property> 
    		<property name="successView">
    			<value>main.html</value>
    		</property> 
    		<property name="userManager">
    			<ref bean="userManager"/>
    		</property> 		
    	</bean>
    and protected entries that require authentification ... which is currently empty:
    Code:
    	<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 
    		<property name="interceptors">
    			<list>
    				<ref bean="loginInterceptor"/>
    			</list>
    		</property>
    		<property name="mappings"> 
    			<props> 
    				<!-- <prop key="/login.html">loginFormController</prop>  -->
    		 	</props> 
    		</property> 
    	</bean>
    		
    	<bean id="loginInterceptor" class="at.newsagg.web.LoginInterceptor"/>
    I have got an Interceptor doing almost the same thing like in the example.

    My problem is that I get following error message when I submit the form with the userdata to "login.html".

    form tag in the jsp:
    Code:
    <form method="post" action="<c&#58;url value="login.html"/>">
    Error Message:
    Code:
    WARN - DispatcherServlet.doService&#40;465&#41; | No mapping for &#91;/equinox/login.html&#93; in DispatcherServlet with name 'action'

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    It seems that you have missed out the leading slash in the bean name for the LoginFormController. You should change it from login.html to /login.html or whatever is needed to make it correspond to the undefined mapping shown in the error message. Without seeing the full configuration I can't give you exact values, but essentially you need the path to the resource without the servlet context path.

    Rob

  3. #3
    Join Date
    Jan 2005
    Posts
    17

    Default

    oops ... I missed that slash :shock:

    thank you

Similar Threads

  1. pagination and continuation problem in SWF
    By yfmoan in forum Web Flow
    Replies: 6
    Last Post: Jun 29th, 2005, 03:42 AM
  2. Spring newbie problem
    By 3dot14 in forum Web
    Replies: 0
    Last Post: Mar 2nd, 2005, 10:55 AM
  3. Replies: 1
    Last Post: Dec 20th, 2004, 04:43 AM
  4. Newbie problem
    By tomhay in forum SpringSource Tool Suite
    Replies: 2
    Last Post: Sep 21st, 2004, 03:22 PM
  5. Newbie problem - NotWritablePropertyException
    By hay7777 in forum Container
    Replies: 2
    Last Post: Aug 31st, 2004, 05:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •