Set flow and menu item mapping
public void setLocationMaps(MenuComponent[] menuComponents) {
for (MenuComponent menuComponent: menuComponents) {
if (null == this.locationMapping.get(menuComponent.getLocation())
|| null != menuComponent.getParent()) {
this.locationMapping.put(menuComponent.getLocation(), menuComponent);
}
if (menuComponent.getMenuComponents().length > 0) {
this.setLocationMaps(menuComponent.getMenuComponents());
}
}
}
Once Request filter
public class MenuFilter extends OncePerRequestFilter {
/**
* This method looks for a "locale" request parameter. If it finds one, it sets it as the preferred locale
* and also configures it to work with JSTL.
*
* @param request the current request
* @param response the current response
* @param chain the chain
* @throws IOException when something goes wrong
* @throws ServletException when a communication failure happens
*/
@SuppressWarnings("unchecked")
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
FilterChain chain)
throws IOException, ServletException {
chain.doFilter(request, response);
// Reset thread-bound LocaleContext.
LocaleContextHolder.setLocaleContext(null);
}
}
Flow Execution listener and external context
public class MenuFlowLister extends FlowExecutionListenerAdapter {
public void requestProcessed(RequestContext context) {
String id = context.getActiveFlow().getId();
MenuRepository menus = (MenuRepository) context.getExternalContext().getApplicationMap()
.get(MenuRepository.MENU_REPOSITORY_KEY);
}
}
Get session attributes
Object mutex = RequestContextHolder.currentRequestAttributes().getSessionMutex();
RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
String test;
synchronized (mutex) {
test = (String)attributes.getAttribute("zenius", RequestAttributes.SCOPE_SESSION);
}
return test;
分享到:
相关推荐
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
Special sales department Manning publications co 20 Baldwin Road PO BoX 761 Shelter island. ny11964 Emailorders@manning.com @2016 by manning Publications Co. All rights reserved No part of this ...
3. New Features and Enhancements in Spring Framework 4.0 ............................................ 17 3.1. Improved Getting Started Experience .........................................................
Every organization or individual is fully granted for viewing its source code or modify the source codes to match his/her own special needs; commercial applications have the greatest license under ...
MCA-SIG面试预备这是Interview Preparation Special Interest Group (SIG)与Mizzou Computing Association (MCA)合作使用的资料库。 在2021年Spring学期中,每周的内容都将上载到该存储库中。内容将包括:指导,练习...
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer- sbm.com,...
See the workings of the Spring framework and use Java annotations for the configuration Master the scripting API built into the Java language and use the built-in JavaScript interpreter Understand ...
See the workings of the Spring framework and use Java annotations for the configuration Master the scripting API built into the Java language and use the built-in JavaScript interpreter Understand ...
编程技术 to develop an online flower ordering system ...JSP (JavaServer Pages), a core technology in this project, is a server-side scripting language that allows developers to embed Java code within ...
thymeleaf-core, thymeleaf-spring3, thymeleaf-extras-springsecurity3, and thymeleaf-extras-tiles2 projects already have such files. Other dialects, however, are up to the discretion of their developer...
AES-CMAC,全称是Advanced Encryption Standard - Cipher-based Message Authentication Code,是基于AES(高级加密标准)的密码消息认证码算法,按照NIST(美国国家标准和技术研究所)的规范800-38B进行定义。...
APPENDIX: ARCGIS VBA SCRIPT CODE 58 REFERENCES 106 IX LIST OF FIGURES Figure Page 1. Return Factor vs. LiDAR Scan Angle 2 2. Angle of Incidence 3 3. Wave Action Relationship to LiDAR Echo 3 4. Site ...