网页定位问题

问题:一个网页显示了10道题,我看到第8道,发现它有错误,通过修改按钮进行修改,修改完后跳回刚才的显示页面,它会跳到页面顶端,我想让它跳回后显示在第8题的位置.

解决:用锚实现
[code]显示题目列表的文件
<c:forEach items="${questionSearchResult}" var="question" varStatus="current">
<tr>
[color=red] <a id="${question.questionId}"></a>[/color] <td>${question.questionId}</td>
<td>${question.questionName}</td>
<td>${question.quesOptions}</td>
<td>${question.rightKey}</td>
<td>${question.questionType}</td>
<td>${question.stateTag}</td>
<td>${question.schoolName}</td>
<td>${question.subjectName}</td>
<td>${question.quesMakeDate}</td>
<c:if test="${question.stateTag=='可用'}">
<td><A href="modifyQuestion.do?action=changeState&questionId=${question.questionId}&order=${question.questionId}">置为不可用</A></td>
</c:if>
<c:if test="${question.stateTag=='不可用'}">
<td><A href="modifyQuestion.do?action=changeState&questionId=${question.questionId}&order=${question.questionId}">置为可用</A></td>
</c:if>
<td><A href="modifyQuestion.do?action=getQuestion&questionId=${question.questionId}&[color=red]order=${question.questionId}">[/color]修改题目</A></td>
</tr>
</c:forEach>
修改的页面
<tr>
<td align="center"><input type="submit" name="Submit" value="修改"><[color=red]input type="hidden" name="order" value=[/color]"[color=blue]${param.order}[/color]"></td>从URL参数中获得值
</tr>
修改的action
[color=red]String order=request.getParameter("order");[/color]
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String toPage=basePath+"jsp/topManager/questionManage/queryQuestionResults.jsp[color=red]#"+order[/color];
return new ModelAndView(new RedirectView(toPage));
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值