找到sun的文档了:1.0:
http://java.sun.com/products/jsp/syntax/1.0/syntaxref10.fm11.html
1.1:
http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html#8828
1.2:
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html#8828看起来<jsp:include page="<%=filename%>"/>和共产主义信仰一样的正确呀
http://java.sun.com/products/jsp/syntax/1.0/syntaxref10.fm11.html
1.1:
http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html#8828
1.2:
http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html#8828看起来<jsp:include page="<%=filename%>"/>和共产主义信仰一样的正确呀
解决方案 »
- [求助]关于java web开发,运行性能主要应该注意那些方面?
- GWT.create()的作用是什么?
- hibernate中一个表有复合主键,其中一个主键字段是自增的,请问该如何配置自增序列!!
- netbean关于textclient和ChatRoomServer的具体部署
- jsp中关于application的使用
- 救命呀。内存回收的问题
- 在Struts2.x中theme和template之间是什么关系?
- 安装Jive3.1.1后,中文搜索总是乱码,我按照如下的方法操作也没有解决——
- 电子工业的书WROX系列千万不要买!!(求例子)
- 在线求助???急!!!!!
- 关于jsp+javabean的问题
- 关于树状控件的问题,如何点击节点时,让执行的jsp获取参数?
JSP Syntax
<%@ include file="relativeURL" %>
--------------------------------------------------------------------------
(http://java.sun.com/products/jsp/syntax/1.0/syntaxref10.fm6.html)
你定义 filename 是否是个有效的文件呢?我觉等应该没有问题的。
<jsp:include page="a.jsp"/>
<%
String s= "a.jsp";
%>
<jsp:include page="<%=s%>"/>肯定可以!-----------------
注意:路径问题!
我就这样试验的,方法如下:include.jsp1内容:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.sql.*" %>
</head><body bgcolor="#FFFFFF" text="#000000">
<%
String s = "include2.jsp";
%>
<jsp:include page="<%=s%>"/>
</body>
</html>
include2.jsp内容:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.sql.*" %>
</head><body bgcolor="#FFFFFF" text="#000000">
sdfsdfs</body>
</html>
启动include1.jsp,可以阿,一点问题没有,你试试!
就是加不进
我记得我以前出过这问题
后来换了个服务器才解决试试看
的程序没有问题,没错。
但如果使用value时就要用真值来传了
下面也是可以的
test.jsp
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.sql.*" %>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
String s = "add";
%>
<jsp:include page="include2.jsp" flush="true" >
<jsp:param name="p"
value="<%=s%>" />
</jsp:include>
</body>
</html>
*******************************
include2.jsp
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" import="java.sql.*" %>
</head>
<body bgcolor="#FFFFFF" text="#000000">
sdfsdfs
<%
out.print(request.getParamter("p"));
%>
</body>
</html>
面是<jsp:include page="<%=filename%>" flssh="true/false"/> 你怎么把后面的东西给戽了呀,是必写的!
1。如果只是包含一些静态的页面,建议使用<%@include file="your.jsp"%>指令,静态的含义是不需要传递参数的,可以使jsp/html/txt文件。
2。至于<jsp:include page="<%=filename%>">没用过,理论上应该是可以的啊。
3。jeffaple(坤) ,你想包含的页面都是事先写好的吧,用第一种方式就ok了。
4。另外建议一本书《jsp网站开发与编程实战》科学出版社的,例子比较好,但是指令讲解得不够详细。
贴代码吧,我怎么也看不出来会是怎样啊?
常量的话没必要写在<%%>里面
一定要写,如下:
<jsp:include page="<%=\"Jsp2.jsp\"%>"/>
我一直都这么用的,没有问题啊