2016-03-24 17 views
0

Bu soruyu çok gördüm ama yine de sorunumu gideremiyorum. Umarım bana rehberlik edebileceksiniz. benim süper basit yay web uygulaması çalıştırmayı denediğinizderg.springframework.web.servlet.PageNotFound noHandlerFound.

aşağıdaki özel durum alıyorum Mar 24, 2016 09:17:31 org.springframework.web.servlet.PageNotFound noHandlerFound UYARI: HTTP isteği bulunamadı haritalama ile DispatcherServlet içinde URI [/ 51SpringWebMaven /] ile adı 'teklifler'

bulabilirsiniz benim kod temeli

OffersController Sınıf

package com.sharat.web.controller; 

import org.springframework.stereotype.Controller; 
import org.springframework.web.bind.annotation.RequestMapping; 

@Controller 
public class OffersController { 
    @RequestMapping("/") 
    public String showHome(){ 
     return "home"; 
    } 
} 
altında

teklifler-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:context="http://www.springframework.org/schema/context" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd"> 


    <context:component-scan base-package="com.sharat.web.controller"></context:component-scan> 
    <mvc:annotation-driven></mvc:annotation-driven> 
    <bean id="jspViewResolver" 
     class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
    <property name="prefix" value="/WEB-INF/jsps/"></property> 
    <property name="suffix" value=".jsp"></property> 
    </bean> 
</beans> 

Web.xml

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> 
    <display-name>50SpringBasicWeb</display-name> 
    <welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
    <welcome-file>index.htm</welcome-file> 
    <welcome-file>index.jsp</welcome-file> 
    <welcome-file>default.html</welcome-file> 
    <welcome-file>default.htm</welcome-file> 
    <welcome-file>default.jsp</welcome-file> 
    </welcome-file-list> 
    <servlet> 
    <description></description> 
    <display-name>offers</display-name> 
    <servlet-name>offers</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
    <servlet-name>offers</servlet-name> 
    <url-pattern>/</url-pattern> 
    </servlet-mapping> 
</web-app> 

home.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
    pageEncoding="ISO-8859-1"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<title>JSP Page</title> 
</head> 
<body> 
First JSP Home Page 
</body> 
</html> 

Lütfen bana yol bu konuda geçmiş olsun. Neyin yanlış olduğunu anlayamıyorum.

sayesinde Sharat

cevap

0

Bu beni bir süre sonra hiçbir şey değiştirmeden çalıştı. Bu güvenilmez neden bazı en iyi uygulama :(

var mı anlamıyorum?

Teşekkür, Sharat