Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用带有磁贴配置的 Spring MVC 并使用 ViewPreparer 加载菜单以将菜单加载到应用程序中。我希望 ViewPreparer 的执行方法中的 HTTPServlet 请求对象用于在 HTTP 标头中设置 globalid。
请建议如何获取请求对象...
提前致谢 :)
干得好。
public class MenuPreparer implements ViewPreparer { public void execute(TilesRequestContext tilesContext, AttributeContext attributeContext) throws PreparerException { HttpServletRequest request = (HttpServletRequest) tilesContext.getRequest(); }