jsp中的include指令的用法,include文件路径问题,txt文件的编码问题
来源:互联网 发布:专业地图软件 编辑:程序博客网 时间:2024/06/05 07:19
高手略过!
include用来在jsp页面中插入一个包含文本文件或代码的文件,在转换成servlet时将包含的文件和当前的文件进行合并!
文件路径:使用默认的jsp文件格式,将要加载的文件放在webRoot下面即可。
解决txt的汉字乱码问题,在txt文件第一句加上一句话:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>include用法</title>
</head>
<body>
包含文本文件. <br>
<%@ include file ="hello.txt" %>
包含jsp文件. <br>
<%@ include file ="index.jsp" %>
包含html文件. <br>
<%@ include file ="hello.html" %>
</body>
</html>
- jsp中的include指令的用法,include文件路径问题,txt文件的编码问题
- 关于freemarker include文件路径的问题
- 关于freemarker include文件路径的问题
- include文件路径问题
- jsp中include指令的绝对路径问题
- JSP中include指令的乱码问题
- jsp:include包含txt文件出现乱码问题
- JSP @include file的路径问题
- java web 在jsp中使用include指令导入带中文的HTML文件乱码问题
- makefile include 文件中取当前路径的问题mark
- 关于jsp include html文件导致中文乱码的问题
- jsp include进去的txt文件出现乱码
- JSP的include指令
- JSP的include指令
- JSP的include指令
- JSP的include指令
- Eclipse中使用JSP的Include指令的格式问题
- JSP中的include指令和include动作的区别
- js 判断文字是否破行
- 平面设计和网页设计之间的联系
- Java 多线程
- T-SQL中的GROUP BY GROUPING SETS
- Linux
- jsp中的include指令的用法,include文件路径问题,txt文件的编码问题
- lua时间函数
- 虚函数的3种调用
- SensorService architechure’ note
- 并查集查找、合并查找
- Development road-null
- spring 定时器
- Qt:支持鼠标拖动来移动内容的窗口
- zTree【部分函数和属性介绍】