Jasper Exception无法解决

时间:2016-01-15 06:38:34

标签: java jsp

我正在使用亚马逊ec2实例,我上传了所有代码。 我已经成功安装了Tomcat6和mysql服务器,现在我正试图点击服务器,但是有一个jasper异常来了:

org.apache.jasper.JasperException: /header-inner.jsp(30,9) The function equals must be used with a prefix when a default namespace is not specified
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
    org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1528)
    org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:131)
    org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:206)
    org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:248)
    org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:56)
    org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:206)
    org.apache.jasper.compiler.Validator$ValidateVisitor.validateFunctions(Validator.java:1553)
    org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1326)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1176)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:859)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:519)
    org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:656)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:859)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:859)
    org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:519)
    org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:656)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
    org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
    org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
    org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
    org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1785)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:321)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    ac.filters.HomeFilter.doFilter(HomeFilter.java:49)

我无法弄清楚错误。请帮我解决一下这个。 这是我的标题内码:

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.List"%>

<%
String source="";
String path = "";
if( session.getAttribute("admin") != null &&  (Boolean)session.getAttribute("admin")){
    source = "admin";
}else if(session.getAttribute("userId") !=null ){
    source="user";
    path = (String)session.getAttribute("path");

    }else if( session.getAttribute("advisorId") !=null){
        source="advisor";
        path = (String)session.getAttribute("path");

    } 
String pageurl = request.getRequestURL().toString();
pageContext.setAttribute("pageurl", pageurl);
pageContext.setAttribute("source", source);


%>
     <div class="div-container-navbar">
                <nav class="navbar navbar-default">
                      <div class="container-fluid">
                        <div class="navbar-header">
                        <fmt:bundle basename="ac.resources.Path" prefix="path.">
                        <c:if test="${source.equals('user') }">

                             <a class="navbar-brand hidden-xs" href="userdashboard" onclick="ga('send', 'event', 'Dashboard', 'click', '${pageurl}');"><img src="assets/img/horizontal_logo.png" class="" style="max-width:187px;"></a>
                                      </c:if>
                                       <c:if test="${source.equals('advisor') }">
                             <a class="navbar-brand hidden-xs" href="advisordashboard" onclick="ga('send', 'event', 'Dashboard', 'click', '${pageurl}');"><img src="assets/img/horizontal_logo.png" class="" style="max-width:187px;"></a>
                                      </c:if>

                        </fmt:bundle>

                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                         <ul class="nav navbar-nav first-ul">

                            <li><a href="advisors?category=all" onclick="ga('send', 'event', 'AdvisorsPage', 'click', '${pageurl}');">Advisors <span class="sr-only">(current)</span></a></li>
                            <li><a href="questions" onclick="ga('send', 'event', 'QuestionsPage', 'click', '${pageurl}');">Q&A</a></li>
                            <!-- <li><a href="becomeanadvisor">Be an Advisor</a></li>
                             <li><a href="howitworks">How it Works</a></li> -->
                              <li><a href="logout" onclick="ga('send', 'event', 'Logout', 'click', '${pageurl}');">Sign Out</a></li>

                                <li><form class="search-form" action="Search"><input  class="form-control search-box-i" type="text" placeholder="Search" onkeyup="FindSuggestions(this)" name="word" autocomplete="off">
                                <div id="headersuggestions" class="dropdown sugg">

                                </div></form><span class="make-search-small">X</span></li>
                                <li><div><ul class="nav navbar-nav navbar-right " >
                                     <li class="dropdown">
                                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="background-image: none !important" onclick="ga('send', 'event', 'Notifications', 'click', '${pageurl}');"><img src="assets/img/header_notification.svg" style="width:24px;"><span class="badge" id="notification_count"></span></a>
                                      <ul id="notifications" class="dropdown-menu notify-div-dropdown scrollable-content" style="min-width: 273px;padding: 0px;border: 0px;max-height: 250px;overflow-y: scroll;">

                                      </ul></div>
                                    </li>
                                      <li>
                                      <c:if test="${source.equals('user') }">

                                       <a href="userdashboard" style="background-image: none !important" onclick="ga('send', 'event', 'Dashboard', 'click', '${pageurl}');"><img src="<%=path %>" style="width: 32px;height: 32px;border-radius: 50%;"></a>
                                      </c:if>
                                       <c:if test="${source.equals('advisor') }">
                                       <a href="advisordashboard" style="background-image: none !important" onclick="ga('send', 'event', 'Dashboard', 'click', '${pageurl}');"><img src="<%=path %>" style="width: 32px;height: 32px;border-radius: 50%;"></a>
                                      </c:if>
                                      </li>
                                </ul>

                          </ul>
                        </div><!-- /.navbar-collapse -->
                      </div><!-- /.container-fluid -->
                    </nav>
                </div>
                <!-- Sidebar -->
                            <nav class="navbar navbar-inverse navbar-fixed-top" id="sidebar-wrapper" role="navigation">
                                <ul class="nav sidebar-nav">
                                    <li>
                                      <c:if test="${source.equals('user') }">
                                       <a href="userdashboard" onclick="ga('send', 'event', 'Dashboard', 'click', '${pageurl}');"><img src="<%=path %>" style="width: 55px;height: 55px;border-radius: 50%;border: 2px solid white;"></a>
                                      </c:if>
                                       <c:if test="${source.equals('advisor') }">
                                       <a href="advisordashboard" onclick="ga('send', 'event', 'Dashboard', 'click', '${pageurl}');"><img src="<%=path %>" style="width: 32px;height: 32px;border-radius: 50%;border: 2px solid white;"></a>
                                      </c:if>
                                      </li>
                                    <li>
                                        <a href="advisors?category=all" onclick="ga('send', 'event', 'AdvisorsPage', 'click', '${pageurl}');">Advisors</a>
                                    </li>
                                    <li>
                                        <a href="questions" onclick="ga('send', 'event', 'QuestionsPage', 'click', '${pageurl}');">Q&A</a>
                                    </li>
                                    <li>
                                        <a href="becomeanadvisor" onclick="ga('send', 'event', 'BeAnAdvisor', 'click', '${pageurl}');">Be an Advisor</a>
                                    </li>
                                    <li>
                                        <a href="howitworks" onclick="ga('send', 'event', 'HowItWorks', 'click', '${pageurl}');">How it Works</a>
                                    </li>
                                    <li>
                                       <a href="logout" onclick="ga('send', 'event', 'Logout', 'click', '${pageurl}');">Sign Out</a>
                                    </li>

                                </ul>
                            </nav>
                            <!-- /#sidebar-wrapper -->

                             <button type="button" class="hamburger is-closed visible-xs" data-toggle="offcanvas">
                                    <span class="hamb-top"></span>
                                    <span class="hamb-middle"></span>
                                    <span class="hamb-bottom"></span>
                                </button>
                           <div class="visible-xs" style="position: absolute;top: -17px;left: 1%;"><ul class="nav navbar-nav navbar-right " style="border-top: 0px;">
                                     <li class="dropdown">
                                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="background-image: none !important;margin-left: 63px;" onclick="ga('send', 'event', 'Notifications', 'click', '${pageurl}');"><img src="assets/img/header_notification.svg" style="width:15px;"><span class="badge" id="notification_count_mob"></span></a>
                                      <ul id="notifications-mob" class="dropdown-menu notify-div-dropdown scrollable-content" style="min-width: 319px;padding: 0px;border: 0px;max-height: 250px;overflow-y: scroll;margin-top: 12px;">

                                      </ul></div>
                             <form class="search-form" action="Search" method="get" style="position: absolute;top: 4px;right: 11%;"><input  class="form-control search-box-xs visible-xs" type="text"  placeholder="Search" name="word">
                             <div id="headersuggestionsmob" class="dropdown suggmob">

                                </div></form>




    <script>
    $(document).ready(function () {
  var trigger = $('.hamburger'),
      overlay = $('.overlay'),
     isClosed = false;

    trigger.click(function () {
      hamburger_cross();      
    });

    function hamburger_cross() {

      if (isClosed == true) {          
        overlay.hide();
        trigger.removeClass('is-open');
        trigger.addClass('is-closed');
        isClosed = false;
      } else {   
        overlay.show();
        trigger.removeClass('is-closed');
        trigger.addClass('is-open');
        isClosed = true;
      }
  }

  $('[data-toggle="offcanvas"]').click(function () {
        $('#wrapper').toggleClass('toggled');
  });  


    });
    </script>
    <script type="text/javascript">
    function FindSuggestions(s) {
        var len = s.value.length;
        if(len>=3){
         $('.black-screen').show();
            $.ajax({
                url : 'GetSuggestions', // Your Servlet mapping or JSP(not suggested)
                data : {"word" : s.value},
                type : 'POST',
                dataType : 'html', // Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
                success : function(response) {
                    if(response != "nosuggestion"){
                    document.getElementById("headersuggestions").innerHTML="";
                    var obj = JSON.parse(response);
                    //document.getElementById("data").innerHTML= obj[0].word+"with "+ obj[0].hits+" hits" ;
                    $.each(obj, function(key,value) {
                        var html='  <div class="hsuggestion">'+value.word+'</div>';
                        $('.sugg').append(html);
                        $('.hsuggestion').show();
                    }); 
                    /* alert(obj[0].word+"with "+ obj[0].hits+" hits"); */
                    }else{
                        document.getElementById("headersuggestions").innerHTML="";
                        $('.hsuggestion').hide();
                    }
                    $('.black-screen').hide();

                },
                error : function(request, textStatus, errorThrown) {
                }
            }); 
        }
    }
    $('body').on('focus', '.search-box-i', function(e){
        $('.hsuggestion').show();
        $('.make-search-small').show();
        $('#bs-example-navbar-collapse-1 .first-ul>li:not(li:nth-child(4))').hide();
        $('#bs-example-navbar-collapse-1 .first-ul').addClass('inc-searchulli');
        $('#bs-example-navbar-collapse-1 .first-ul li:nth-child(4)').addClass('inc-searchulli');
        $('.search-form').addClass('inc-searchbox');
    }).on('blur',".search-box-i", function() {
        /*  $('#bs-example-navbar-collapse-1 .first-ul>li').show();
        $('#bs-example-navbar-collapse-1 .first-ul').removeClass('inc-searchulli');
        $('#bs-example-navbar-collapse-1 .first-ul li:nth-child(4)').removeClass('inc-searchulli');
        $('.search-form').removeClass('inc-searchbox'); */
    });

    $('body').on('click', '.make-search-small', function(e){
        $(this).hide();
        $('#bs-example-navbar-collapse-1 .first-ul>li').show();
        $('#bs-example-navbar-collapse-1 .first-ul').removeClass('inc-searchulli');
        $('#bs-example-navbar-collapse-1 .first-ul li:nth-child(4)').removeClass('inc-searchulli');
        $('.search-form').removeClass('inc-searchbox');
    });
    $('body').on('click', '.hsuggestion', function(e){
        var suge= $(this).html();
        $('.search-box-i').val(suge);
        $('.hsuggestion').hide();
    });
    if(<%=source.equals("admin")%>){
        var eventSource = new EventSource("AdminNotificationSSE");
        eventSource.addEventListener('notify', function(event) {
                document.getElementById('notifications').innerHTML = event.data;
            }, false);
        eventSource.addEventListener('count', function(event) {

            if(event.data >0){
                 document.getElementById('notification_count').style.display = 'inline-block';
                document.getElementById('notification_count').innerHTML = event.data;
            }
        }, false);
        eventSource.addEventListener('notify', function(event) {
            document.getElementById('notifications-mob').innerHTML = event.data;
        }, false);
    eventSource.addEventListener('count', function(event) {

        if(event.data >0){
             document.getElementById('notification_count_mob').style.display = 'inline-block';
            document.getElementById('notification_count_mob').innerHTML = event.data;
        }
    }, false);
        eventSource.addEventListener('id', function(event) {
            id1= event.data;
        }, false);
    }
    else if(<%=source.equals("user")%>){
        var eventSource = new EventSource("UserNotificationSSE");
        eventSource.addEventListener('notify', function(event) {
                document.getElementById('notifications').innerHTML = event.data;
            }, false);
        eventSource.addEventListener('count', function(event) {
            if(event.data >0){
                 document.getElementById('notification_count').style.display = 'inline-block';
                document.getElementById('notification_count').innerHTML = event.data;
            }
        }, false);
        eventSource.addEventListener('notify', function(event) {
            document.getElementById('notifications-mob').innerHTML = event.data;
        }, false);
    eventSource.addEventListener('count', function(event) {

        if(event.data >0){
             document.getElementById('notification_count_mob').style.display = 'inline-block';
            document.getElementById('notification_count_mob').innerHTML = event.data;
        }
    }, false);

    }else if (<%=source.equals("advisor")%>) {
        var eventSource = new EventSource("AdvisorNotificationSSE");
        eventSource.addEventListener('notify', function(event) {
                document.getElementById('notifications').innerHTML = event.data;
            }, false);
        eventSource.addEventListener('count', function(event) {
            if(event.data >0){
                 document.getElementById('notification_count').style.display = 'inline-block';
                document.getElementById('notification_count').innerHTML = event.data;
            }
        }, false);
        eventSource.addEventListener('notify', function(event) {
            document.getElementById('notifications-mob').innerHTML = event.data;
        }, false);
    eventSource.addEventListener('count', function(event) {

        if(event.data >0){
             document.getElementById('notification_count_mob').style.display = 'inline-block';
            document.getElementById('notification_count_mob').innerHTML = event.data;
        }
    }, false);

    }


    </script>

1 个答案:

答案 0 :(得分:3)

可能的问题原因是:$ {source.equals(&#39; user&#39;)}。您使用了EL2.2 API(EL函数与args)。 Tomcat从版本7开始支持EL 2.2 API。 http://redrockdigimark.com/apachemirror/tomcat/tomcat-7/v7.0.67/RELEASE-NOTES