JSP中动态INCLUDE与静态INCLUDE的区别
JSP中有两种包含语句:
1. <%@include file="head.jsp" %>
2. <jsp:include page="head.jsp" />
或者:
<jsp:include page="jieshou.jsp">
<jsp:param name="canshu" value="magci" />
</jsp:include>
两种包含的区别:
1.<%@include file="uri" %>:先包含后处理
a.不管被包含文件是静态还是动态,直接将页面中的全部内容包含进来;
b.执行时先将包含进来的内容一起处理完之后再将所有的内容发给客户端。
2.<jsp:include page="uri" />:先处理后包含
a.能自动区分被包含文件是静态还是动态;
b.如果被包含文件是静态文件,处理方式跟第1种方式一样,
如果是动态文件,则各自处理完之后把结果包含进来发给客户端。
实例:
被包含页面(inc.jsp):
<%
int i=2;
%>
<h1>inc.jsp:<%=i%></h1>
使用<%@include file="uri" %>包含:
<html>
<head>
<title>include1</title>
</head>
<body>
<%
int i=1;
%>
<%@include file="inc.jsp" %>
<h1>JSP:<%=i %></h1>
</body>
</html>
使用<jsp:include page="uri" />包含:
<html>
<head>
<title>include2</title>
</head>
<body>
<%
int i=1;
%>
<jsp:include page="inc.jsp" />
&nb
相关文档:
<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*" %>
<%
//在这里如果写成“WEB-INF\templates\template.htm”程序会报错
String filePath = request.getRealPath("/")+"WEB-INF/templates/template.htm"; &nbs ......
这是一个用户注册的页面,部分代码(没有错误)已略,可是不能实现form的action跳转
checkform()里明明有document.form.submit(),就是不能跳转,
能帮我看下问题出在哪吗?
这是照着书上的例子写的,注册和重置动都作是通过图片来处理的。
请不吝赐教,在下不胜感激。。。
<%@ page contentType="te ......
用了commons-fileupload-1.2.jar和commons-io-1.3.2.jar这两个包。
save.jsp
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.regex.*"%>
<%@ page import="org.apache.co ......
一、
问:org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.254.103", user "postgres",database "postgres", SSL off
答:PostgreSQ数据库为了安全,它不会监听除本地以外的所有连接请求,当用户通过JDBC访问是,就会报一些以上的异常。要解决这个问题 ......