jsp读取foxpro的dbf文件
<%@page contentType="text/html"%>
<%@page pageEncoding="GBK"%>
<%@page import="java.sql.*;" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>JSP+DBF</title>
</head>
<body>
<h2 align="center">JSP连接DBF</h2><hr>
<%!
Connection con = null;
Statement st = null;
ResultSet rs = null;
%>
<%
String path = "";
request.setCharacterEncoding("GBK");
path = request.getRealPath("").replace('\\', '/');
out.println(path); /**/
int i = 1;
String url = "jdbc:odbc:driver={Microsoft Visual FoxPro Driver};" +
"SourceType=DBF;SourceDB=" + path + "/";
con = DriverManager.getConnection(url);
String Showsql = "select * from inform";
st = con.createStatement();
rs = st.executeQuery(Showsql);
while (rs.next()) {
String str = i +
相关文档:
用了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 ......
树节点组合模型
package cn.com.jsnh.model.catalog;
public class TreeModel {
private String node;
private CatalogModel model;
public String getNode() {
return node;
}
public void setNode(String node) {
this.node = node;
}
public CatalogModel getModel() {
return model;
}
public void setMo ......
以前有提到过乱码问题,最近在使用window.open时又出现此类问题,现解决如下:
1:使用encodeURIComponent函数对参数进行处理,例如:window.open("html.jsp?name=" + encodeUrlComponent(value)));
2:修改tomcat服务器的server.xml文件添加:useBodyEncodingForURI="true"或者
URIEncoding=" ......
JSP共有以下9种基本内置组件(可与ASP的6种内部组件相对应):
1.request 用户端请求,此请求会包含来自GET/POST请求的参数。
2. response 网页传回用户端的回应 。
3.pageContext 网页的属性是在这里管理 。
4.session 与请求有关的会话期。
5.ap ......