在jsp中出现:Syntax error, insert "Finally" to complete TryStatement错误
怎么办?

解决方案 »

  1.   

    页面如下:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>主题列表</title>
        <%@ include file="/WEB-INF/pages/public/commons.jspf" %></head>
    <body><!--===================主题列表==================-->
    <div class="area_articlelist">
        <%--主题列表分页信息--%>
        <%@ include file="/WEB-INF/pages/public/pageview.jspf" %>
        <ul>
            <%--本页主题列表--%>
            <c:forEach items="${request_pageView.recordList}" var="topic">
                <li class="${topic.type }">◆ <span style="color:#8a2be2"><html:link
                        action="/topic?method=show&id=${topic.id}&pageNum=1"
                        target="right">【${topic.type}】<c:out value="${topic.title}"/></html:link></span>
                    (${topic.replyCount}回复)
                </li>
            </c:forEach>
        </ul>
        <%--主题列表分页信息--%>
        <%@ include file="/WEB-INF/pages/public/pageview.jspf" %>
    </div>
    </body>
    </html>
      

  2.   

    在倒数第三行:<%@ include file="/WEB-INF/pages/public/pageview.jspf" %>
    报错:Syntax error, insert "Finally" to complete TryStatement
    如果去掉head中的<%@ include file="/WEB-INF/pages/public/commons.jspf" %>
    怎没有错了。
      

  3.   

    报:Syntax error, insert "Finally" to complete TryStatement
      

  4.   

    <%@ include file="/WEB-INF/pages/public/pageview.jspf" %>
    说明你这个文件里面有错误。把代码贴出来
      

  5.   

    你的try-catch-finally没写全
    估计只有try一个光杆司令或者是你的jsp包含很乱。少了花括号之类
      

  6.   


    <%@ include file="/WEB-INF/pages/public/pageview.jspf" %>
    说明你这个文件里面有错误。把代码贴出来
      

  7.   

    pageview.jspf如下:<%@ page pageEncoding="utf-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><c:if test="${request_pageView.totalPage gt 1}">
    <div class="pageview">分页:
        <%--页码列表--%>
        <a href="javascript:gotoPage(1)">[首页]</a>
        <c:forEach begin="${request_pageView.startPageIndex}" end="${request_pageView.endPageIndex}" var="pageNum">
            <c:if test="${request_pageView.currentPage ne pageNum}">
                <a href="javascript:gotoPage(${pageNum})">[${pageNum}]</a>
            </c:if>
            <c:if test="${request_pageView.currentPage eq pageNum}">
                <span class="currentpage">[${pageNum}]</span>
            </c:if>
        </c:forEach>
        <a href="javascript:gotoPage(${request_pageView.totalPage})">[尾页]</a>
        <%--快速选择页码--%>
        <select name="pageNum" onchange="gotoPage(this.value)">
            <c:forEach begin="1" end="${request_pageView.totalPage}" var="pageNum">
                <option value="${pageNum}" ${request_pageView.currentPage eq pageNum ? 'selected=\\"selected\\"' : ''}>${pageNum}</option>
            </c:forEach>
        </select>
    </div><script type="text/javascript">
        function gotoPage(pageNum) {
            if (isNaN(pageNum)) {
                alert("请输入正确的页码");
                document.getElementById('txtPageNum').focus();
                return;
            }
            if (pageNum < 1 || pageNum > ${request_pageView.totalPage}) {
                alert("请输入正确的页码,页码范围为 1-11");
                document.getElementById('txtPageNum').focus();
                return;
            }
            document.location.href = getPageViewUrl(pageNum);
        }
    </script>
    </c:if>
      

  8.   


    看看生成好的JAVA文件是啥样的..
      

  9.   

    我觉的跟pageview.jspf没有关系,
    因为我把它里面的代码注释掉了,还是报这个错误。
    问题是否在原页面呢?
      

  10.   

    为什么在原页面中去掉head中的<%@ include file="/WEB-INF/pages/public/commons.jspf" %>
    就没有错了呢?
      

  11.   

    我感到奇怪的是:我写了两个
    <%@ include file="/WEB-INF/pages/public/pageview.jspf" %>
    第一个没问题,为什么第二个会报错呢?