我想在总界面中main.jsp,传参数给左边的那个页面参数index=1。在main.jsp代码中这么写的<frame src="<%= request.getContextPath() %>/left.jsp?index=1" name="leftFrame" scrolling="NO" noresize>可是不好用在left。jsp这个界面好像得不到这个参数的值
<s:if test='%{index=="1"}'>
不知道这个怎么解决还有就是我能不能做到给main.jsp?index=1。给这个页面传参数,让left。jsp能读取到传给main.jsp的参数呢?main.jsp代码<html>
<head>
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head><frameset rows="*" cols="200,*" frameborder="NO" border="0" framespacing="0">
<frame src="<%= request.getContextPath() %>/left.jsp" name="leftFrame" scrolling="NO" noresize>
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="<%= request.getContextPath() %>/top.jsp" name="topFrame" scrolling="NO" noresize>
<frame src="<%= request.getContextPath() %>/right.jsp" name="mainFrame">
</frameset>
<noframes></noframes>
</html>
<s:if test='%{index=="1"}'>
不知道这个怎么解决还有就是我能不能做到给main.jsp?index=1。给这个页面传参数,让left。jsp能读取到传给main.jsp的参数呢?main.jsp代码<html>
<head>
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head><frameset rows="*" cols="200,*" frameborder="NO" border="0" framespacing="0">
<frame src="<%= request.getContextPath() %>/left.jsp" name="leftFrame" scrolling="NO" noresize>
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="<%= request.getContextPath() %>/top.jsp" name="topFrame" scrolling="NO" noresize>
<frame src="<%= request.getContextPath() %>/right.jsp" name="mainFrame">
</frameset>
<noframes></noframes>
</html>
改成
<s:if test="%{parameters.index[0]=='1'}">
试试看
改成这样
<s:if test="%{#request.index=='1'}">
这样就从request Context中查找
都是没有不对
楼主的main.jsp引入struts2的标签库了吗 <%@ taglib prefix="s"....
</s:if>
</s:if>
<body>
top
<%=request.getParameter("id") %>
</body>
</html>index.jsp<frameset rows="*" cols="200,*" frameborder="NO" border="0" framespacing="0">
<frame src="<%= request.getContextPath() %>/left.jsp" name="leftFrame" scrolling="NO" noresize>
<frameset rows="80,*" frameborder="NO" border="0" framespacing="0">
<frame src="<%= request.getContextPath() %>/top.jsp?id=33234" name="topFrame" scrolling="NO" noresize>
<frame src="<%= request.getContextPath() %>/right.jsp" name="mainFrame">
</frameset>