解决: The server encountered an internal error that prevented it from fulfilling this request.

    今天在编写springmvc的时候,出现了这么一个问题,完整的如下:

HTTP Status 500 - /WEB-INF/jsps/demo.jsp (line: 2, column: 16) equal symbol expected


type Exception report

message /WEB-INF/jsps/demo.jsp (line: 2, column: 16) equal symbol expected

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

exception

org.apache.jasper.JasperException: /WEB-INF/jsps/demo.jsp (line: 2, column: 16) equal symbol expected
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89)
	org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:219)
	org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:162)
	org.apache.jasper.compiler.Parser.parsePageDirective(Parser.java:342)
	org.apache.jasper.compiler.Parser.parseDirective(Parser.java:473)
	org.apache.jasper.compiler.Parser.parseFileDirectives(Parser.java:1773)
	org.apache.jasper.compiler.Parser.parse(Parser.java:135)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
	org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:119)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:194)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:660)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
	org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.86 logs.


Apache Tomcat/7.0.86


    接下来讲下为什么会出现这个问题。

    在run server前,我习惯性地在project->Clean中Clean了一下,想要防止其他因素干扰

解决: The server encountered an internal error that prevented it from fulfilling this request._第1张图片

    然后一运行,就出现了The server encountered an internal error that prevented it from fulfilling this request.这个错误。

    看了一下说是demo.jsp文件中的第二行出现错误,我的demo.jsp文件下部分程序内容如下:

    1<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    2<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    3
    4
    5
    6
    7Insert title here

    8

    ……

    我看了一下,以为是我的javabean核心标签库c标签库的uri有问题,于是我又把c.tld文件导入WEB-INF下,把第二行的代码换成了<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>,结果还是爆出同样的错误。

    重新启动myelipse和restart一下tomcat也不行,最后,想了下,可能是我一开始的clean了工程,却没有重新编译项目导致的,于是我在project->build处点击了一下,最后再次跑了一下,成功了。

    myeclipse中clean的功能:就是把编译好的class文件都删除后再重新生成

    myeclipse中build的功能:就是编译(没有选中project->Build Automatically的话就需要手动在project->Build All一下)

你可能感兴趣的:(解决: The server encountered an internal error that prevented it from fulfilling this request.)