如何去除jsp页面报错 Syntax error, insert } to complete MethodBody 10
代码如下:<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%><%@taglibprefix=...
代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%-- 分页信息 --%>
<div id=PageSelectorBar>
<div id=PageSelectorMemo>
Page: ${currentPage}/${pageCount}
Per page: ${pageSize } posts
Total records: ${recordCount }
</div>
<div id=PageSelectorSelectorArea>
<a href="javascript: gotoPage(1)" title="Front" style="cursor: hand;">
<img src="${pageContext.request.contextPath}/style/blue/images/pageSelector/firstPage.png"/>
</a>
<%-- 页码列表 --%>
<s:iterator begin="%{beginPageIndex}" end="%{endPageIndex}" var="num">
<s:if test=" #num != currentPage "><%-- 非当前页,有链接 --%>
<span class="PageSelectorNum" style="cursor: hand;" onClick="gotoPage(${num});">${num} </span>
</s:if>
<s:else><%-- 当前页,没有链接 --%>
<span class="PageSelectorNum PageSelectorSelected">${num}</span>
</s:else>
</s:iterator>
<a href="javascript: gotoPage(${pageCount})" title="End" style="cursor: hand;">
<img src="${pageContext.request.contextPath}/style/blue/images/pageSelector/lastPage.png"/>
</a>
Turn to page:
<select id="pn" onchange="gotoPage( this.value )">
<s:iterator begin="1" end="%{pageCount}" var="num">
<option value="${num}">${num}</option>
</s:iterator>
</select>
<%-- 让select默认选中当前页 --%>
<script type="text/javascript">
$("#pn").val( "${currentPage}" );
</script>
</div>
</div>
<script type="text/javascript">
/**
* 转到指定的页码
* @param {Object} pageNum
*/
function gotoPage(pageNum)
{
window.location.href = "forum_show.do?id=${id}&pageNum=" + pageNum ;
}
</script>
PS:页面能正常运行,当把递归代码段去掉错误消息就去除了。。 展开
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%-- 分页信息 --%>
<div id=PageSelectorBar>
<div id=PageSelectorMemo>
Page: ${currentPage}/${pageCount}
Per page: ${pageSize } posts
Total records: ${recordCount }
</div>
<div id=PageSelectorSelectorArea>
<a href="javascript: gotoPage(1)" title="Front" style="cursor: hand;">
<img src="${pageContext.request.contextPath}/style/blue/images/pageSelector/firstPage.png"/>
</a>
<%-- 页码列表 --%>
<s:iterator begin="%{beginPageIndex}" end="%{endPageIndex}" var="num">
<s:if test=" #num != currentPage "><%-- 非当前页,有链接 --%>
<span class="PageSelectorNum" style="cursor: hand;" onClick="gotoPage(${num});">${num} </span>
</s:if>
<s:else><%-- 当前页,没有链接 --%>
<span class="PageSelectorNum PageSelectorSelected">${num}</span>
</s:else>
</s:iterator>
<a href="javascript: gotoPage(${pageCount})" title="End" style="cursor: hand;">
<img src="${pageContext.request.contextPath}/style/blue/images/pageSelector/lastPage.png"/>
</a>
Turn to page:
<select id="pn" onchange="gotoPage( this.value )">
<s:iterator begin="1" end="%{pageCount}" var="num">
<option value="${num}">${num}</option>
</s:iterator>
</select>
<%-- 让select默认选中当前页 --%>
<script type="text/javascript">
$("#pn").val( "${currentPage}" );
</script>
</div>
</div>
<script type="text/javascript">
/**
* 转到指定的页码
* @param {Object} pageNum
*/
function gotoPage(pageNum)
{
window.location.href = "forum_show.do?id=${id}&pageNum=" + pageNum ;
}
</script>
PS:页面能正常运行,当把递归代码段去掉错误消息就去除了。。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询