I have this particular query regarding BeanNameUrlHandlerMapping in Spring. Part of my dispatcher-servlet.xml looks like below -
<bean id="beanNameUrl" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean name="/start.htm" class="controller.StartController"/>
<bean name="/login.htm" class="controller.LoginController"/>
<bean name="/company.htm" class="controller.CompanyController"/>
<bean name="/client.htm" class="controller.ClientController"/>
<bean name="/paginate.htm" class="controller.PaginateController"/>
<bean name="/detail_view.htm" class="controller.DetailViewController"/>
<bean name="/edit_view.htm" class="controller.EditViewController"/>
<bean name="/create_view.htm" class="controller.CreateViewController"/>
<bean name="/building.htm" class="controller.BuildingController"/>
<bean name="/tower.htm" class="controller.TowerController"/>
<bean name="/floor.htm" class="controller.FloorController"/>
<bean name="/space.开发者_开发知识库htm" class="controller.SpaceController"/>
<bean name="/contract.htm" class="controller.ContractController"/>
<bean name="/space_package.htm" class="controller.SpacePackageController"/>
<bean name="/charge_head.htm" class="controller.ChargeHeadController"/>
<bean name="/search_view.htm" class="controller.SearchViewController"/>
Now, what happens is, whenever am trying to get to the space_package.htm, it always ends up in space.htm and to top it all, whatever I type in place of the * in http://host:port/app_name/space*.htm
, it always end up in space.htm !!
Please advise how should I resolve this and where am I going worng.
Appreciate your help...:)
The URLs are named incorrectly. According to web standard, An URL can not contain special character (like "_"), so that /space_package.html
is invalid. You may want to try /spacePackage.html
instead.
For further understanding, you can refer the document in this link.
精彩评论