日期:2014-05-16  浏览次数:20346 次

jsf中怎样动态改变include的src地址
我想根据一个bean里的url,动态改变include中的src,试了几次都不行。
java 代码
?
  1. <body?style="margin:0;"?bgcolor="#f4f4ea">??
  2. ??
  3. <f:view>??
  4. <h:form?id="form">??
  5. ????????<div?>??
  6. ????????<e:include?id="moduleTree"?src="system/module_tree.jsp"/>??
  7. ??????</div>??
  8. ??????
  9. ??????
  10. ??????<div?>??
  11. ????????<e:include?id="mainPane"?src="#{controlBean.mainPanePath}"/>??
  12. ??????</div>??
  13. ?????
  14. </h:form>??
  15. </f:view>??
java 代码
?
  1. public?class?ControlBean?{??
  2. ????private?String?mainPanePath="org_manager/context.jsp";??
  3. ??
  4. ????/**?
  5. ?????*?@return?the?mainPanePath?
  6. ?????*/??
  7. ????public?String?getMainPanePath()?{??
  8. ????????return?mainPanePath;??
  9. ????}??
  10. ??
  11. ????/**?
  12. ?????*?@param?mainPanePath?the?mainPanePath?to?set?
  13. ?????*/??
  14. ????ghter">
    ?
    1. <e:tree?id="tree-basic"?model="#{moduleTreeModelBean.treeModel}"???
    2. ????????????rootExpanded="false"??
    3. ????????????onselection="#{controlBean.setPath}"??
    4. ????????????cellStyle="normalTreeCell"??
    5. ????????????hoverStyle="blueTreeCell"??
    6. ????????????selectedStyle="whiteTreeCell"?preloadDepth="1">??
    7. ??
    8. ???????
    9. ????????<e:treecell?value="#{NODE.name}"??
    10. ????????????????????styleClass=