Processor Mapper in SSM-SPRINGMVC-07:SPRINGMVC

Source: Internet
Author: User

------------I do not have him, but the hand is ripe, humble and foolish, and eager to be hungry-------------

Beannameurlhandlermapping and Simpleurlhandlermapping

Beannameurlhandlermapping belongs to the SPRINGMVC default processor mapper, which is not worthy of this

Because it has been configured in the SPRINGMVC configuration file

You can also configure the beannameurlhandlermapping, but it is useless in your own XML configuration file:

    <!--processor Mapper, write not write all line, this default value is this--and    class="  Org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean>

Simpleurlhandlermapping Processor Mapper Configuration:

In your own XML configuration file:

<?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:mvc="Http://www.springframework.org/schema/mvc"xsi:schemalocation="Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/MVC http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!--Configuring Bean processors--<bean id="Second" class="Cn.dawn.day03simpleUrlHandlerMapping.FirstController"></bean> <!--View Resolver-<beanclass="Org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix"Value="/"></property> <property name="suffix"Value=". JSP"></property> </bean> <!--processor Mapper-<beanclass="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <!--the first way--<!--<property Name="UrlMap"> <map> <entry key="/hello"> <value>second</value> </entry> </map> &lt ;/property>--> <!--second Way--<property name="Mappings"> <props> <!--value is the id--> <prop of the above mapper key="/hello">second</prop> </props> </property> </bean></beans>

Then I can access the second processor through/hello.

Processor Mapper in SSM-SPRINGMVC-07:SPRINGMVC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.