Results 1 to 4 of 4
- 08-15-2012, 10:22 PM #1
Member
- Join Date
- Aug 2012
- Posts
- 6
- Rep Power
- 0
No mapping found for HTTP request with URI - Why won't my page load?
Hi, I am new to Spring and I can't get the configuration right so that my page comes up. I bet that it is a simple configuration problem but I have exhausted myself with internet searches, reading through and trying examples, reading and rereading the 2 Spring books that I have and still no luck. I am hoping that someone can point out my configuration problem.
Thank you, here is my code:
I appreciate it if someone can suggest what is wrong with my configuration.Java Code:My URL is: http://localhost:8080/DVDTracker5-0/searchMainView.htm web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" 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_3_0.xsd"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <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>*.htm</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> dispatcher-servlet.xml: <?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:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd "> <tx:annotation-driven /> <context:component-scan base-package="com.home.dvdtracker.controller" /> <context:component-scan base-package="com.home.dvdtracker.service" /> <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /> <!-- My Beans --> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/index.htm">indexController</prop> <prop key="/mainPage.htm">mainPageController</prop> </props> </property> </bean> <bean name="indexController" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="index" /> </bean> <bean name="mainPageController" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="mainPageView" /> </bean> </beans> Controller: package com.home.dvdtracker.controller; import com.home.dvdtracker.service.SearchDvdServiceInt; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.support.SessionStatus; @RequestMapping("/searchMainView.htm") @Controller public class SearchMainController { @Autowired private SearchDvdServiceInt searchDvdService; @RequestMapping(method = RequestMethod.GET) public String setupForm(ModelMap uiModelMap) { return "searchMainView"; } @RequestMapping(method = RequestMethod.POST) public String processSubmit(BindingResult result, SessionStatus status) { return "searchMainView"; } } The JSP is /WEB-INF/jsp/searchMainView.jsp The index and main page come up fine, but when I click on the link to go to this search page I get a 404 not found. Specifically: No mapping found for HTTP request with URI [/DVDTracker5-0/searchMain.htm] in DispatcherServlet with name 'dispatcher'|#]
Thanks,
Ray
- 08-16-2012, 09:35 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: No mapping found for HTTP request with URI - Why won't my page load?
Your mapping appears to be for searchMainView.htm, not searchMain.htm.No mapping found for HTTP request with URI [/DVDTracker5-0/searchMain.htm]Please do not ask for code as refusal often offends.
- 08-16-2012, 05:40 PM #3
Member
- Join Date
- Aug 2012
- Posts
- 6
- Rep Power
- 0
- 08-18-2012, 04:54 AM #4
Member
- Join Date
- Aug 2012
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
HTTP request method associated with an URL
By Sonal R N in forum NetworkingReplies: 0Last Post: 02-21-2011, 08:35 AM -
http request
By nobleman_james in forum Java AppletsReplies: 14Last Post: 12-17-2010, 07:23 PM -
Http request via applet
By hoda in forum Java AppletsReplies: 0Last Post: 11-20-2010, 10:07 AM -
Http request
By arthik_babu in forum Advanced JavaReplies: 2Last Post: 06-29-2009, 12:27 PM -
[SOLVED] http request
By Eranga in forum Advanced JavaReplies: 30Last Post: 11-27-2008, 04:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks