In the front-end development, especially the MVC architecture of multi-person development, responsible for the front-end child shoes always need to do static pages, and back to the background before the use of variables such as El expression and other testing functions, so I introduced a template JSP data testing dedicated files, specifically configure all the variables, Then, in the JSP page to be tested into, you can test, and background integration only need to delete the include tag. (Because I am a beginner, if there is any more clever and quick test method,, Hope not spray < ( ̄︶ ̄) [go!] )
Here is the project structure (slightly complex, SPRINGMVC architecture, to take the required), redirected to the/jsp/pages/exercise.jsp file (equivalent to the home page) via redirect.jsp, which references a common file jsp/template/View-test-config. JSP, used to initialize all test data.
All static files are placed under the Web page directory.
Two file contents:
/jsp/pages/exercise.jsp
<Head><Metahttp-equiv= "Content-type" Content=" text/html; charset=utf-8 "> <title> Practice </title>
< %@ include file= ". /template/view-test-config.jsp "%> </head>
jsp/template/view-test-config. jsp
<HTML> <Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"> </Head> <% StringQusid= "1"; //Problem numberStringquscontent= "the suffix of the C language executable file is:"; //topic contentStringqustipcontent= "Single Choice"; %></HTML>
The web says that all resource requests are blocked by default in the SPRINGMVC architecture, so if you don't want to do work mapping and configure these files, change the MVC mapping rule from "/" to a specific URL (the NetBeans default project mapping rule is "*.htm")
Beginners, please advise ^_^ if there is any mistake.
A debugging method and problem of JSP page in Web project--SPRINGMVC architecture test