当前位置: 代码迷 >> Java Web开发 >> struts2关于request,session,application传值与显示的有关问题
  详细解决方案

struts2关于request,session,application传值与显示的有关问题

热度:6624   发布时间:2013-02-25 21:16:50
struts2关于request,session,application传值与显示的问题
有一个主框架. 名为main.jsp
HTML code
    </head>    <frameset rows="127,*,11" frameborder="no" border="0" framespacing="0">        <frame src="top.jsp" name="topFrame" scrolling="no"            noresize="noresize" id="topFrame" />        <frame src="center.jsp" name="mainFrame" id="mainFrame" />        <frame src="down.jsp" name="bottomFrame" scrolling="no"            noresize="noresize" id="bottomFrame" />    </frameset>    <noframes>        <body>        </body>    </noframes></html>


其中center.jsp为主要内容,但是也为一个框架,分左右两个页面
HTML code
<body>        <table width="100%" height="100%" border="0" cellspacing="0"            cellpadding="0">            <tr>                <td width="8" bgcolor="#353c44">                    &nbsp;                </td>                <td width="147" valign="top">                    <iframe height="100%" width="100%" border="0" frameborder="0"                        src="left.jsp" name="leftFrame" id="leftFrame" title="leftFrame"></iframe>                </td>                <td width="10" bgcolor="#add2da">                    &nbsp;                </td>                <td valign="top">                    <iframe height="100%" width="100%" border="0" frameborder="0"                        src="right.jsp" name="rightFrame" id="rightFrame"                        title="rightFrame"></iframe>                </td>                <td width="8" bgcolor="#353c44">                    &nbsp;                </td>            </tr>        </table>    </body>



left.jsp.主要是从request里获取到treeList进行循环
HTML code
<body>        <div style="height: 100%;">            <ul id="navigation">                <s:iterator value="#request.treeList" id="tree">                    <s:iterator value="#request.tree" id="treeName" status="tn">                        <li>                            <a class="head"><s:property value="key" /> </a>                            <ul>                                <s:iterator value="#treeName.value" id="treeNodeName"                                    var="treeNodeName">                                    <li>                                        <a href="information" target="rightFrame">${treeNodeName.functionName}                                        </a>                                    </li>                                </s:iterator>                            </ul>                        </li>                    </s:iterator>                </s:iterator>            </ul>        </div>    </body>


MUserInfoAction 实现遍历树形结构的action
Java code
HttpServletRequest request = ServletActionContext.getRequest();List treeList = functionServices.getAdminFuncListByParentId(mUserInfo                .getCompany().getAgency().getAgencyId());requestsetAttribute("treeList", treeList);
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!