tags: javax.servlet.ServletException: Fil jsp include
<jsp:include page="${ctx}/header.jsp"></jsp:include>
${ctx}Is the project name, set on the login page<c:set var="ctx" scope="application" value="${pageContext.request.contextPath}"/>
Note: If you use the idea to deploy without specifying the project name, you can access it successfully.${ctx}="/"
use<%@include file="/header.jsp"%>replace<jsp:include page="${ctx}/header.jsp"/>
When the jsp foreground is displayed, it will be translated into a Servlet first, and then used.javax.servlet.http.HttpServletResponse responseShow at the front desk
<jsp:include/>manual
<jsp:include page="${ctx}/header.jsp"></jsp:include>Turn the user intoServlet,header.jspFirst translated intoServlet,ServletMedium configurationheader.jspofServletverification
under Tomcat\work\Catalina\localhostCan be found underheader_jsp.javaFile, the user also has a corresponding file, open to see
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, (java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${ctx}/header.jsp", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false), out, false);
Reference header.jsp in the servlet
<%@include%>The code is introduced, the code is included, and when new JSP is added, it will be generated by default.
<%@include%>manual
View jsp translated files and found noheader_jsp.java, can be seen in the user
out.write("\r\n");
···
···
···
/**
*Content in the header.jsp file
*/
out.write("</head>");
| the difference | include | jsp:include |
|---|---|---|
| execution time | Translation stage | Executed during the request processing phase |
| Introduced content | Introduce static text,First include, post-compilation |
Introduce the response text generated by the execution page or servlet. The included fileCompile first, then includeCome in, then show |
Translation stage:
The jsp page cannot be transferred to the browser as it is, and all jsp elements must be processed by the server first. This is done by translating the jsp page into a servlet and then executing the servlet. The server needs a jsp container to handle the jsp page. The jsp container is usually implemented in the form of a servlet that is configured to handle all requests to the jsp page.
The Jsp container also converts the jsp page into a servlet (called the JSP Page implementation class) and compiles the servlet. These two steps form the translation phase.
Request processing phase:
In addition to the above mentioned Jsp container to convert the jsp page into a servlet, it also calls the jsp page implementation class to process each request and generate a response. This stage is called the request processing stage. The request processing stage only executes the class documentation.
Complete error message HTTP Status 500 - javax.servlet.ServletException: File [/head.jsp] not found type Exception report message javax.servlet.ServletException: File [/head.jsp] not found description...
I started learning C++ language this week, using Visual Studio 2010 as a compiler, and found that there is no basic textbook on compiling programs with VS2010. And when you look online, the tutorial i...
Input.GetAxis Get axis static function GetAxis (axisName : string) : float Descriptiondescription Returns the value of the virtual axis identified by axisName. Returns the value in the ...
Error:(12, 8) java: Unable to access javax.servlet.ServletException Cannot find class file for javax.servlet.ServletException Need to add servlet dependencies or...
What have I done in these 20 days? In addition to class, playing badminton, playing games, learning JSP&Servlet, reviewing sql, Ubuntu, decided to use it as an online poker game.howeverMaybe becau...
8 scriptless JSP 8.1 Using Action Elements on JSP Pages If the useBean can't find a bean called person, it will create such a class by itself, and look at the code in the generated servlet: But the be...
At first glance, the servlet&jsp servlet of the HF series did not have time to summarize. In the future, I will start with "using jsp", do a summary, share it with everyone, and review i...
However, java.io.FileNotFoundException is reported when running: c:\temp\test.txt (The system cannot find the specified path.) After troubleshooting, it is found that the corresponding directory is no...
Learning mybatis, just started writing profiles mybatis-config.xml ,, when the top copy and paste alisa error: Attribute "alisa" must be declared for element type "typeAlias" Worka...
The declared package "com.how2java.j2se" does not match the expected package "" I encountered this error, because the first written document, after loading the server caused it, de...