Results 1 to 2 of 2

Thread: HTTP Status 404 - The requested resource () is not available.

  1. #1
    Join Date
    Aug 2008
    Posts
    2

    Question HTTP Status 404 - The requested resource () is not available. [FIXED]

    All,

    In my SimpleUrlHandlerMapping, if I set

    <property name="mappings">
    <props>
    <prop key="/*">MyController</prop>
    </props>
    </property>

    and try to access ...apps/spring/jsp/request/type1/list.jsp the control goes to MyController


    But my interest is to have different controllers configured, to start that if I define something like this

    <property name="mappings">
    <props>
    <prop key="/spring/jsp/request/type1/*">MyController</prop>
    </props>
    </property>

    I'm getting "HTTP Status 404 The requested resource () is not available."
    error.
    I'm expecting it to still go to MyController.

    I tried <prop key="/spring/jsp/request/type1/**">MyController</prop>, but that also didn't help


    Where could be the issue ?
    Any help to understand the issue is highly appreciated !

    Thanks,
    TJ



    ===========web.xml ===========
    <servlet>
    <description>MY SPRING SERVLET</description>
    <servlet-name>springServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>springServlet</servlet-name>
    <url-pattern>/spring/jsp/request/*</url-pattern>
    </servlet-mapping>



    ===========springServlet-servlet.xml===========

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/*">MyController</prop>
    </props>
    </property>
    </bean>

    <bean id="MyController" class="com.spring.flight.HomeController">
    <property name="flightService" ref="flightService" />
    </bean>

    <bean id="Type1Controller" class="com.spring.flight.Type1Controller">
    <property name="flightService" ref="flightService" />
    </bean>

    <bean id="Type2Controller" class="com.spring.flight.Type2Controller">
    <property name="flightService" ref="flightService" />
    </bean>


    <bean id="flightService" class="com.spring.flight.service.DummyFlightServic e" />
    Last edited by tjpradeep; Aug 5th, 2008 at 01:51 AM.

  2. #2
    Join Date
    Aug 2008
    Posts
    2

    Thumbs up

    I fixed it using
    <property name="alwaysUseFullPath" value="true"/>

    in my <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">

Posting Permissions

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