1
I’m getting the bug
Error 404-Not Found: The server has not found Anything matching the Request-URI
when trying to access any url
of my application, the strange thing is that the page index.jsp
works normally, including loading Resources that define in springmv-servlet.xml
.
Project structure:
+ siebelutilities
+-- WebContent/
+-- META-INF/
+-- resources/
+-- WEB-INF/
+-- jsp/
+-- lib/
+-- springmvc-servlet.xml
+-- tiles.xml
+-- web.xml
+-- weblogic.xml
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>siebelutilities</display-name>
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.apache.tiles.extras.complete.CompleteAutoloadTilesListener</listener-class>
</listener>
<servlet>
<servlet-name>Tiles Dispatch Servlet</servlet-name>
<servlet-class>org.apache.tiles.web.util.TilesDispatchServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Tiles Dispatch Servlet</servlet-name>
<url-pattern>*.tiles</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
springmvc-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:context="http://www.springframework.org/schema/context"
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.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">
<context:component-scan base-package="com.eduardo.siebutil.service" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<mvc:resources mapping="/resources/**" location="/resources/" cache-period="31556926" />
<mvc:annotation-driven />
</beans>
I’m the @RequestMapping
thus:
@RequestMapping(value = "/account/create")
public ModelAndView create() {
ModelAndView model = new ModelAndView("/account/create");
return model;
}
Putting a debug in the line of the model Modelandview comes to pass or not? My question is whether you are not able to find the JSP file or the method, because by the error you are implying that it is not finding a file. The server did not find anything with the URL that was passed. I believe that inside the constructor of Modelandview you need to pass the corresponding file.
– Giancarlo Abel Giulian
@Giancarlogiulian he doesn’t even capture the breakpoint, I use this setting of Spring for other projects and works normally.
– Eduardo Silva