Question about permission labels of spring security3 pages

Source: Internet
Author: User

This article excerpt, reproduced need to indicate the source of http://blog.csdn.net/shadowsick/article/details/8868863

When we customize the filter chain of spring security3, we find that the page permission control label <sec: authorize and other items are no longer valid, because we lack a required instance.

You can find the source code and see that you need a defaultwebinvocationprivilegeevaluator decision maker instance. Configure an instance directly and inject it into the filtersecurityinterceptor instance.

<! -- Page tag permission function dependency --> <bean id = "webinvocationfilter" class = "org. springframework. security. web. access. defaultwebinvocationprivilegeevaluator "> <constructor-Arg ref =" filtersecurityinterceptor "/> </bean>

In this way, we can continue to use the security tag on the page.

<% @ Page Language = "Java" pageencoding = "UTF-8" %> <% @ taglib prefix = 'sec 'uri = 'HTTP: // www.springframework.org/security/tags' %> <% string Path = request. getcontextpath (); string basepath = request. getscheme () + ": //" + request. getservername () + ":" + request. getserverport () + path + "/"; %> <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en"> <HTML> 

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.