Apache Tiles - How to get HTTPServlet Request object in execute method of ViewPreparer

限于喜欢 提交于 2019-12-12 03:03:10

问题


Am using Spring MVC with tiles configuration and loading the Menus using ViewPreparer to load the menus into the application. I want HTTPServlet request object in the execute method of ViewPreparer for getting globalid set in HTTP Headers.

Please suggest how to get request object ...

Thanks in advance :)


回答1:


Here you go.

public class MenuPreparer implements ViewPreparer {


public void execute(TilesRequestContext tilesContext, 
                  AttributeContext attributeContext) throws PreparerException {

    HttpServletRequest request = (HttpServletRequest) tilesContext.getRequest();
}


来源:https://stackoverflow.com/questions/15779374/apache-tiles-how-to-get-httpservlet-request-object-in-execute-method-of-viewpr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!