Simple URL Handling not working with Spring MVC

K

Kannan

Hi,
I am trying to configure a simple application in spring. The following
is the entry in my web.xml, servletname is "iwspring"
....
<servlet-mapping>
<servlet-name>iwspring</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

My iwspring-servlet.xml (for spring config) looks as follows
<beans>
<bean name="homeController" class="a.b.HomeController"/>
<bean id="viewResolver" .....>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>

<bean id="simpleUrlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/iwweb/home.html">homeController</prop>
</props>
</property>
</bean>
</beans>

I deploy the application and there are no build errors. Somehow when i
access the application through the url
http://localhost:8080/iwweb/home.html it isnot able to find the
resource and the system log prints

12:47:46,618 WARN [PageNotFound] No mapping for [/iwweb/home.html] in
DispatcherServlet with name 'iwspring'.
The mapping is clearly defined in the iwsprin-servlet.xml ?
 
K

Kannan

Figured it out had to do something with the context root. should not
have given the 'iwweb'.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top