<%@ page contentType="text/html;charset=gbk" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<html>
<head>
<title>
<s:text name="index.title"/>
</title>
<link rel="stylesheet" type="text/css" href="css/style2.css"/>
<link rel="stylesheet" type="text/css" href="css/style1.css"/>
<script type="text/javascript" src="script/trim.js"></script>
<script type="text/javascript">
function checkRevert(){
var rcontent = document.all.nr.value.trim();
if(rcontent==""){
alert("回答内容不得为空");
return false;
}
if(rcontent.length<8){
alert("回答问题内容长度不得小于8");
return false;
}
document.all.button.disabled = true;
return true;
}
function setTitle(title){
document.all.bt.value=title;
}
</script>
</head>
<body>
<s:include value="top.jsp"></s:include>
<div id="nav">
<table>
<tr>
<td>
<a href="IndexAction.action?actionStr=all"><s:text name="msg.nav"/></a> »
<a href="TTLAction.action?tgid=<s:property value="gid"/>">
<s:property value="gName"/>
</a> »
<s:property value="title"/>
</td>
<td align="right">
<s:if test="#session.uid!=null">
<input type="button" id="button3" value="我要提问" onclick="window.location.href='GMCAction.action'"/>
<input type="button" id="button3" value="我要回答"
onclick="window.location.href='#1';document.all.nr.focus();"/>
</s:if>
</td>
</tr>
</table>
</div>
<s:iterator value="content" status="st">
<div>
<s:if test="#st.first">
<h1><s:property value="title"/></h1>
</s:if>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="author" height="200">
<span> <s:property value="uname"/></span>
<div class="tx">
<img src="<s:property value="tx"/>" border="0" width="150" height="200"/>
</div>
<p><em><s:property value="tag"/></em></p>
<p>注册时间 <s:property value="zcsj"/></p>
<p>最后登陆 <s:property value="zhdl"/></p>
</td>
<td class="nr">
<span>
<em>
<s:if test="#st.first">
楼主
</s:if>
<s:else>
<s:property value="#st.index"/>楼
</s:else>
</em>
发表于 <s:property value="fbsj"/>
</span>
<h2><s:property value="title"/></h2>
<h3><s:property value="content"/></h3>
</td>
</tr>
<tr>
<td class="author"></td>
<td>
<div class="operate">
<span style="valign=middle;">
<p><a href="#" onclick="scroll(0,0)">TOP</a></p>
<s:if test="!#session.uname.equals(uname)"><!-- 该回复是自己回复的时候 -->
<p><a href="#1" onclick="setTitle('回答 <s:property value="uname"/>')">回复</a></p>
</s:if>
</span>
</div>
</td>
</tr>
</table>
</div>
</s:iterator>
<!-- 分页导航条 -->
<s:url id="target" value="TTDAction" includeParams="none"/>
<s:include value="nav.jsp">
</s:include>
<!-- 回复帖子的表单 -->
<div class="hf">
<h4><a name="#1"></a>回复本主题</h4>
<div class="notice">
回帖注意事项:
<p>1.不得谩骂他人</p>
<p>2.不要恶意灌水</p>
<p>3.不得发表带政治色彩内容</p>
<p>4.回答问题字数不得少于8</p>
<p>5.不要回复与本问题无关的东西</p>
</div>
<s:form action="EAction" theme="simple" onsubmit="return checkRevert()">
<table>
<tr>
<td>标题:</td>
<td><s:textfield name="bt" cssClass="htbt"/></td>
</tr>
<tr>
<td>内容:</td>
<td><s:textarea name="nr" rows="8" cols="80" cssClass="textarea" /></td>
</tr>
<tr>
<td>
<s:hidden name="actionStr" value="hftz"/>
<s:hidden name="tid"/>
</td>
<td>
<s:submit id="button" value="参与讨论"/>
</td>
</tr>
</table>
</s:form>
</div>
<img src="images/bottom.jpg" border="0" width="100%" height="60"/>
</body>
</html>中包含了一个页面:nav.jsp 下面是nav.jsp的内容:
<%@ page contentType="text/html; charset=GBK" language="java"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<table width="98%" border="0" align="center" style="margin:4px 0px;">
<tr align="right">
<td align="left" style="font-size:13px;">
共${total}页|第${curPage}页
</td>
<s:form action="%{target}" theme="simple">
<td width="65%"><font size="2">选择分页跨度:</font>
<s:select
name="span"
list="#{'1':'每页1个','2':'每页2个','5':'每页5个','10':'每页10个','15':'每页15个','20':'每页20个'}"
listKey="key"
listValue="value"
onchange="this.form.submit();"
/>
</td>
</s:form>
<td width="7%">
<s:if test="curPage!=1">
<a href="?curPage=<s:property value="curPage-1"/>">
<h3>上一页</h3>
<img src="images/pre.gif" alt="上一页" border="0">
</a>
</s:if>
</td>
<s:form action="%{target}" theme="simple">
<td width="7%">
<s:select
name="curPage"
list="pageList"
listKey="key"
listValue="value"
onchange="this.form.submit();"
/>
</td>
</s:form>
<td width="7%">
<s:if test="curPage<total">
<a href="?curPage=<s:property value="curPage+1"/>">
<img src="images/next.gif" alt="下一页" border="0">
</a>
</s:if>
</td>
</tr>
</table>现在的问题是:<a href="?curPage=<s:property value="curPage-1"/>">
这个链接是怎么自动拼接成的?点这个链接就会自动变成一个参数?像TopicDetailAction?curPage=1 这样!
<%@ taglib uri="/struts-tags" prefix="s" %>
<html>
<head>
<title>
<s:text name="index.title"/>
</title>
<link rel="stylesheet" type="text/css" href="css/style2.css"/>
<link rel="stylesheet" type="text/css" href="css/style1.css"/>
<script type="text/javascript" src="script/trim.js"></script>
<script type="text/javascript">
function checkRevert(){
var rcontent = document.all.nr.value.trim();
if(rcontent==""){
alert("回答内容不得为空");
return false;
}
if(rcontent.length<8){
alert("回答问题内容长度不得小于8");
return false;
}
document.all.button.disabled = true;
return true;
}
function setTitle(title){
document.all.bt.value=title;
}
</script>
</head>
<body>
<s:include value="top.jsp"></s:include>
<div id="nav">
<table>
<tr>
<td>
<a href="IndexAction.action?actionStr=all"><s:text name="msg.nav"/></a> »
<a href="TTLAction.action?tgid=<s:property value="gid"/>">
<s:property value="gName"/>
</a> »
<s:property value="title"/>
</td>
<td align="right">
<s:if test="#session.uid!=null">
<input type="button" id="button3" value="我要提问" onclick="window.location.href='GMCAction.action'"/>
<input type="button" id="button3" value="我要回答"
onclick="window.location.href='#1';document.all.nr.focus();"/>
</s:if>
</td>
</tr>
</table>
</div>
<s:iterator value="content" status="st">
<div>
<s:if test="#st.first">
<h1><s:property value="title"/></h1>
</s:if>
<table cellpadding="0" cellspacing="0">
<tr>
<td class="author" height="200">
<span> <s:property value="uname"/></span>
<div class="tx">
<img src="<s:property value="tx"/>" border="0" width="150" height="200"/>
</div>
<p><em><s:property value="tag"/></em></p>
<p>注册时间 <s:property value="zcsj"/></p>
<p>最后登陆 <s:property value="zhdl"/></p>
</td>
<td class="nr">
<span>
<em>
<s:if test="#st.first">
楼主
</s:if>
<s:else>
<s:property value="#st.index"/>楼
</s:else>
</em>
发表于 <s:property value="fbsj"/>
</span>
<h2><s:property value="title"/></h2>
<h3><s:property value="content"/></h3>
</td>
</tr>
<tr>
<td class="author"></td>
<td>
<div class="operate">
<span style="valign=middle;">
<p><a href="#" onclick="scroll(0,0)">TOP</a></p>
<s:if test="!#session.uname.equals(uname)"><!-- 该回复是自己回复的时候 -->
<p><a href="#1" onclick="setTitle('回答 <s:property value="uname"/>')">回复</a></p>
</s:if>
</span>
</div>
</td>
</tr>
</table>
</div>
</s:iterator>
<!-- 分页导航条 -->
<s:url id="target" value="TTDAction" includeParams="none"/>
<s:include value="nav.jsp">
</s:include>
<!-- 回复帖子的表单 -->
<div class="hf">
<h4><a name="#1"></a>回复本主题</h4>
<div class="notice">
回帖注意事项:
<p>1.不得谩骂他人</p>
<p>2.不要恶意灌水</p>
<p>3.不得发表带政治色彩内容</p>
<p>4.回答问题字数不得少于8</p>
<p>5.不要回复与本问题无关的东西</p>
</div>
<s:form action="EAction" theme="simple" onsubmit="return checkRevert()">
<table>
<tr>
<td>标题:</td>
<td><s:textfield name="bt" cssClass="htbt"/></td>
</tr>
<tr>
<td>内容:</td>
<td><s:textarea name="nr" rows="8" cols="80" cssClass="textarea" /></td>
</tr>
<tr>
<td>
<s:hidden name="actionStr" value="hftz"/>
<s:hidden name="tid"/>
</td>
<td>
<s:submit id="button" value="参与讨论"/>
</td>
</tr>
</table>
</s:form>
</div>
<img src="images/bottom.jpg" border="0" width="100%" height="60"/>
</body>
</html>中包含了一个页面:nav.jsp 下面是nav.jsp的内容:
<%@ page contentType="text/html; charset=GBK" language="java"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<table width="98%" border="0" align="center" style="margin:4px 0px;">
<tr align="right">
<td align="left" style="font-size:13px;">
共${total}页|第${curPage}页
</td>
<s:form action="%{target}" theme="simple">
<td width="65%"><font size="2">选择分页跨度:</font>
<s:select
name="span"
list="#{'1':'每页1个','2':'每页2个','5':'每页5个','10':'每页10个','15':'每页15个','20':'每页20个'}"
listKey="key"
listValue="value"
onchange="this.form.submit();"
/>
</td>
</s:form>
<td width="7%">
<s:if test="curPage!=1">
<a href="?curPage=<s:property value="curPage-1"/>">
<h3>上一页</h3>
<img src="images/pre.gif" alt="上一页" border="0">
</a>
</s:if>
</td>
<s:form action="%{target}" theme="simple">
<td width="7%">
<s:select
name="curPage"
list="pageList"
listKey="key"
listValue="value"
onchange="this.form.submit();"
/>
</td>
</s:form>
<td width="7%">
<s:if test="curPage<total">
<a href="?curPage=<s:property value="curPage+1"/>">
<img src="images/next.gif" alt="下一页" border="0">
</a>
</s:if>
</td>
</tr>
</table>现在的问题是:<a href="?curPage=<s:property value="curPage-1"/>">
这个链接是怎么自动拼接成的?点这个链接就会自动变成一个参数?像TopicDetailAction?curPage=1 这样!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货