av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Struts2里用strutsmenu須注意的地方

Struts1.0中的struts menu

menu-config.xml為菜單配置文件!

在struts1.2的struts-config.xml文件中加入如下代碼:

參數(shù)是:menuConfig 對(duì)應(yīng)值是:菜單配置文件path!

Struts2.0中的struts menu

menu-config.xml文件中

注意添加條目時(shí),一定要修改Item name屬性,不能重復(fù)哦,否則無(wú)法正常顯示!

Struts3.0中的struts menu

struts2中配置struts-menu

以前在struts1.x中需要在struts-config.xml中配置 來(lái)引入struts-menu,現(xiàn)在在只需要在web.xml中配置一個(gè)監(jiān)聽就可以了

     
     

net.sf.navigator.menu.MenuContextListener


----MenuContextListener.java部分源代碼:--------

public class MenuContextListener implements ServletContextListener {
private static Log log = LogFactory.getLog(MenuContextListener.class);
private ServletContext ctx;


private String menuConfig = "/WEB-INF/menu-config.xml";


public void contextInitialized(ServletContextEvent sce) {
ctx = sce.getServletContext();

if (log.isDebugEnabled()) {
log.debug("Starting struts-menu initialization");
}

// check for menuConfigLocation context-param
String override =
sce.getServletContext().getInitParameter("menuConfigLocation");
if (override != null) {
if (log.isDebugEnabled()) {
log.debug("using menuConfigLocation: " + override);
}
this.menuConfig = override;
}

MenuRepository repository = new MenuRepository();
repository.setLoadParam(menuConfig);

......
對(duì)比struts1中的插件加載方式,這個(gè)舒心多了,但是struts2中菜單配置文件一定是:menu-config.xml,
struts1中則可以自己命名!


名稱欄目:Struts2里用strutsmenu須注意的地方
本文地址:http://uogjgqi.cn/article/cdihhdi.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流