Невозможно скомпилировать класс для JSP после включения файла Jquery UI.js

0

У меня небольшая проблема в моем веб-приложении. Ситуация заключается в том, что когда я включаю jquery ui.js, а также некоторый css файл jquery ui, вся моя страница разбилась. но когда я снова удалю файл jquery-ui.js, все страницы загружаются плавно. Я тестировал те же js и css файлы в html, и все работает.

Вот краткие сведения IDE: Netbeans 8 JVM: 1.7.0_21 X64 Tomcat: 8 JQuery-UI: v1.10.4

моя страница jsp выглядит

**

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
        <script type="text/javascript"><%@include file="WEB-INF/script/jquery-1.10.2.min.js" %></script>
        <script type="text/javascript"><%@include file="WEB-INF/script/jquery-ui-1.10.4.custom.js" %></script>
        <script type="text/javascript"><%@include file="WEB-INF/script/bootstrap.min.js" %></script>
        <style type="text/css"> <%@include file="WEB-INF/style/bootstrap.css" %></style>        
        <style type="text/css"> <%@include file="WEB-INF/style/bootstrap.min.css" %></style>
        <style type="text/css"> <%@include file="WEB-INF/style/r.css" %></style>
        <style type="text/css"> <%@include file="WEB-INF/style/jquery-ui-1.10.4.custom.css" %></style>        
        <title>Home</title>
        <script>
            $(function() {
                $("#datepicker").datepicker();
            });
        </script>
    </head>

** и ошибка на странице jsp выглядит следующим образом

HTTP Status 500 - Unable to compile class for JSP:

type Exception report

message Unable to compile class for JSP:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [51] in the generated java file: [C:\Tomcat 8\apache-tomcat-8.0.5\work\Catalina\localhost\FashionWorld\org\apache\jsp\Home_jsp.java]
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:475)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:380)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:355)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:342)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Пожалуйста, помогите мне.. я все еще не понимаю, что случилось с этим конкретным файлом jquery-ui.js..

Еще одна вещь, даже после удаления других js файлов, таких как bootstrap и jQuery js файл, все равно я получаю ту же ошибку. Пожалуйста помоги !!!

Теги:
jsp

1 ответ

0

Проблема заключается в следующих строках:

<script type="text/javascript"><%@include file="WEB-INF/script/jquery-1.10.2.min.js" %></script> <script type="text/javascript"><%@include file="WEB-INF/script/jquery-ui-1.10.4.custom.js" %></script> <script type="text/javascript"><%@include file="WEB-INF/script/bootstrap.min.js" %></script> <style type="text/css"> <%@include file="WEB-INF/style/bootstrap.css" %></style>
<style type="text/css"> <%@include file="WEB-INF/style/bootstrap.min.css" %></style> <style type="text/css"> <%@include file="WEB-INF/style/r.css" %></style> <style type="text/css"> <%@include file="WEB-INF/style/jquery-ui-1.10.4.custom.css" %></style>

Выполните следующие действия:

  1. Переместите файлы из WEB-INF/script/* to WebContent/script/* и WEB-INF/style/* to WebContent/style/*
  2. Измените приведенный выше код в JSP ниже:
<link href="${pageContext.request.contextPath}/style/bootstrap.css"

тип = "текст/CSS">

<link href="${pageContext.request.contextPath}/style/bootstrap.min.css" type="text/css"></link>
<link href="${pageContext.request.contextPath}/style/r.css" type="text/css"></link>

 < script type="text/javascript"
 src="CONTEXT_ROOT/script/jquery-1.10.2.min.js"></script>

 <script type="text/javascript"
 src="CONTEXT_ROOT/script/jquery-ui-1.10.4.custom.js"></script> <script
 type="text/javascript"
 src="CONTEXT_ROOT/script/bootstrap.min.js"></script>

Если CONTEXT_ROOT следует заменить на ${pageContext.request.contextPath}

  • 0
    По какой-то причине я не смог поместить теги <script в теги Code, когда добавил {pageContext.request.contextPath}. Поэтому я прошу прощения за непонятно отформатированное сообщение.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню