The approval process in the project requires that the business form be nested in the approved page. Due to the large number of business forms, the front desk has AXJX to the address of the selected form. What would have been done was to put this link on the approval page, but what is needed now is to embed the biz form directly into the approved page.
The initial solution has three ways of include and IFRAME for JSP.
(1) static include
Implemented with include pseudo code, does not check for changes in the included files, and is suitable for containing static pages. The use of the occasion is mainly contains some JS packets, CSS, system constants and so on.
The syntax is:
<% @include File = " biz.htm " %>
(2) Dynamic include is implemented with the Jsp:include action, which always checks for changes in the included files, is suitable for containing dynamic pages, and can take parameters.
Grammar:
<Jsp:includepage= "/jsp/oa/biz/<%=path[1]%/<%=path[2]%>.jsp>"Flush= "true"> <Jsp:paramvalue= "<%=piId%>"name= "PiId"/> <Jsp:paramvalue= "View"name= "Action"/> </Jsp:include>
which flush= "true"
In the same JSP, if you continue to include yourself (the source file), you logically form a dead loop. By default, the server waits for the file to be read to the end before it is output to the client and destroys the request and response for that access. When the flush attribute is true, when the cache accumulates some data, the server provides a portion of the data to the browser and waits for subsequent content. Thus, in a simple page, this attribute is not taken into account, while the page contains a large amount of data, in order to shorten the client delay, a portion of the content can be output. This attribute also has a corresponding application in the Servlet.
(3) Most common iframe nesting
<id= "logfrm" src= "login_files/loginbox.jsp" style = "width:400px;height:280px;" frameborder = "0" scrolling = "No" ></ iframe >
Problems that are easy to come by
1, use JS method times wrong Javascript "unterminated String Literal" error. For this problem is mainly said JS has spaces, newline characters and so on. To remove the space between the discovery does not error.
2, Chinese garbled
Add a sentence to the nested page: <%@ page contenttype= "Text/html;charset=utf-8" language= "Java"%> such as:
<%@ Page ContentType="Text/html;charset=utf-8"language="Java"%><navclass= "NavBar Navbar-default"role= "Navigation"> <Divclass= "Container"> <Divclass= "Navbar-header"> <aclass= "Navbar-brand"href= "/metamaintain-web/group">Product Configuration Module</a> </Div> <Div> <ulclass= "Nav navbar-nav"> <binclass= "Dropdown"><aclass= "Dropdown-toggle"Data-toggle= "Dropdown">Delete a task configuration<bclass= "Caret"></b> </a> <ulclass= "Dropdown-menu"> <Li><ahref= "/metamaintain-web/group">Task grouping</a></Li> <Li><ahref= "/metamaintain-web/task">Task item</a></Li> </ul></Li> </ul> </Div> <Divclass= "Navbar-header"> <aclass= "Navbar-brand"href= "/metamaintain-web/testtabs">Test tab page</a> </Div> </Div> </nav>
JSP page Nesting