File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes SimpleUrlHandlerMapping is not Working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "SimpleUrlHandlerMapping is not Working" Watch "SimpleUrlHandlerMapping is not Working" New topic

SimpleUrlHandlerMapping is not Working

abhi jitnag

Joined: Oct 17, 2010
Posts: 13
I have used org.springframework.web.servlet.handler.SimpleUrlHandlerMapping

In dispatcher-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="" xmlns:xsi="" xmlns:p="" xsi:schemaLocation="">

<!-- ************************************ SimpleUrlHandlerMapping **************************************** -->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"/>

<!-- ************************************ CONTROLLER MAPPINGS **************************************** -->
<bean name="LoadEmployeeDetails" class="">
<property name="employeeService" ref="employeeService"></property>
<property name="applicationContextTest" ref="applicationContextTest"></property>

In jsp page


In Web.xml


This is not working.
First time I am using this. Could anyone help me please.

Gireesh Mulage
Ranch Hand

Joined: Mar 08, 2010
Posts: 44
You can include following tag in your urlMapping tag :
<property name="mappings">
<prop key="/load.html">LoadEmployeeDetails</prop>

And make id="LoadEmployeeDetails" instead of name="LoadEmployeeDetails"

And in your jsp make redirect path to 'load.html'

I hope it should work .
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 662

abhi jitnag wrote:
This is not working.

You need to tell us the details. what does not work. How you ran this application?. What you get when you run this application?. Any exception or error?
Regarding the topic, you are telling your server to redirect all *.html requests to spring dispatcher servlet and redirecting to LoadEmployeeDetails. First, this request would not be handled by spring, you need to redirect to some .html, then in dispatcher-servlet.xml you can use what gireesh has suggested..

If you have error/exceptions after trying these, please post them here, we will try our best to help you..
I agree. Here's the link:
subject: SimpleUrlHandlerMapping is not Working
It's not a secret anymore!