JSP supports server-side file inclusion, that is, you can insert multiple other files in a JSP file to achieve a unified web interface. Modify the above hi.jsp and save as mypage.jsp:
<%@ include file= "top.htm"%>
<%
String MSG = "This JSP test.";
Out.print ("Hello world!");
%>
<%=Msg%>
<%@ include file= "bot.htm"%>
With the visual HTML editor, such as FrontPage, Dreamweave, and other design Web site framework structure, the design of the frame structure file divided into two parts, the upper half of the above save as top.htm, the following half saved as bot.htm, the code as follows:
Type http://localhost:8080/mypage.jsp in the address bar of the browser. So the interface of the site can be unified, and designers can focus on the function module to deal with user login, connect the database, send email and so on. Each JSP file has the following structure:
<%@ include file= "top.htm"%>
<%
Implement some features
%>
<%@ include file= "bot.htm"%>
Maintaining the site's interface is also relatively easy, as long as you modify top.htm and bot.htm, you can affect all pages.
Five, server parameter setting
The JSWDK Web server parameter is saved in \jswdk-1.0.1\webserver.xml, and the default setting value can be modified by opening and editing the file with Windows WordPad. This section focuses on a slightly different setting for Tomcat under Jswdk,linux.
JSWDK The default document directory is \jswdk-1.0.1\webpages, where subdirectories, such as \jswdk-1.0.1\webpages\test, can be created in a browser http://localhost/ Test access to this directory, in order to enable this subdirectory to execute the JSP program, you must also add in the <Service> </Service> section in Webserver.xml:
Also, you must create a \jswdk-1.0.1\webpages\test\web-inf directory and copy it from the \jswdk-1.0.1\webpages\web-inf directory: Mappings.properties, Mime.properties, Servlets.properties and Webapp.properties. Complete these procedures to notify the JSWDK Web server of executing JSP programs in Http://localhost/test.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.