Results 1 to 1 of 1
Thread: Url Handling Problem
- 09-12-2010, 05:13 PM #1
Url Handling Problem
Hello to everyone,
I'm taking URL handling problem as I wrote. I'm newbee at Spring, so I'm waiting ur helps and patients, thanx in advance.
When I try to launch http://localhost:8090/local/jsp/firstPage.htm or http://localhost:8090/local/firstPage.htm I can't launch my "firstPage.jsp" file which is under the "jsp" folder in the "WEB-INF" folder.
Here's my web.xml file :
And this is my webmvc-servlet.xml definition : (webmvc is my dispatcher servlet's name)Java Code:<?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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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>local</display-name> <servlet> <servlet-name>webmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- maps the sample dispatcher to *.htm --> <servlet-mapping> <servlet-name>webmvc</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <!-- Set timeout to 120 minutes --> <session-config> <session-timeout>30</session-timeout> </session-config> <filter> <filter-name>encoding-filter</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encoding-filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>jsp/index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>jsp/default.jsp</welcome-file> <welcome-file>login.html</welcome-file> <welcome-file>login.htm</welcome-file> <welcome-file>jsp/login.jsp</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/404.jsp</location> </error-page> <error-page> <exception-type>java.lang.Exception</exception-type> <location>/error.jsp</location> </error-page> </web-app>
Java Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/*.htm">localController</prop> <prop key="/*.html">localController</prop> <prop key="/*.jsp">localController</prop> <prop key="/*.ajax">localController</prop> <prop key="/jsp/*.htm">localController</prop> <prop key="/jsp/*.html">localController</prop> <prop key="/jsp/*.jsp">localController</prop> <prop key="/jsp/*.ajax">localController</prop> </props> </property> </bean> <bean id="localControllerMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.InternalPathMethodNameResolver"> <property name="prefix" value="hnd_"/> </bean> <bean name="localController" class="view.LocalVIEW"> <property name="methodNameResolver"> <ref local="localControllerMethodNameResolver"/> </property> </bean> <bean name="localBUS" class="bus.LocalBUS"> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"> <value>org.springframework.web.servlet.view.JstlView</value> </property> <property name="prefix"> <value>/WEB-INF/jsp/</value> </property> <property name="suffix"> <value>".jsp"</value> </property> </bean> </beans>
Similar Threads
-
Exception handling problem
By computerbum in forum New To JavaReplies: 2Last Post: 04-17-2010, 03:15 PM -
file handling problem
By gcampton in forum EclipseReplies: 19Last Post: 01-05-2010, 01:18 PM -
Problem with JSP exception handling page
By sidster in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 06-19-2008, 07:28 PM -
Problem in File Handling in Java
By getbiplab in forum New To JavaReplies: 6Last Post: 03-31-2008, 12:02 PM -
problem with event handling!!!
By ahdus in forum Java AppletsReplies: 1Last Post: 11-17-2007, 06:24 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks