您正在查看 "Jsp" 分类下的文章
2007年12月30日 星期日 下午 03:00
(4) 编程语言方面:vector是C++标准模板库中的部分内容,中文偶尔译作“容器”,但并不准确。它是一个多功能的,能够操作多种数据结构和算法的模板类和函数库。vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说,vector是一个能够存放任意类型的动态数组,能够增加和压缩数据。
简单的使用方法如下:
vector<int> test;//建立一个vector
test.pushback(1);//把1和2压入vector 这样 |
2007年12月30日 星期日 上午 10:19
/**
* 该类为网上书店字符串检测操作公用类
* 负责对表单字符串进行检测和操作
* 判断字符串是否为数字或E-mail地址
* 并负责将字符串转化为整数或浮点数
*/
package bean;
import java.util.*;
public class StrClass{
private String str;
public StrClass(){
str="";
}
public StrClass(String str){
this.str=str;
}
public String getStr(){
return this |
2007年12月30日 星期日 上午 10:18
/**
* 该类为网上书店操作数据库的公用类
* 用于数据库连接、查询和更新等操作
*/
package bean;
import java.io.*;
import java.util.*;
import java.sql.*;
public class DBClass
{
private String driver;
private String url;
private String username;
private String password;
private Connection connection;
private Statement statement;
private String message="";
public DBClass(){
|
2007年10月05日 星期五 下午 10:27
doSubmit.html
<html>
<body>
<center>
<h2>志愿者注册</h2>
<FORM action="doSubmit.jsp" method="post">
<table border=0>
<tr valign="top">
<td align="right">姓名:</td>
<td align="left"><input type="text" name="na |
2007年10月05日 星期五 下午 10:05
<%@ page info="北京欢迎您!" contentType="text/html;charset=GBK" %>
<html>
<head>
<title>page对象</title>
</head>
<body>
<b>页面指令中定义的Info属性 :</b>
<%= ((javax.servlet.Servlet)page).getServletInfo() %>
</body>
</html> |
2007年10月05日 星期五 下午 09:34
<%@ page contentType="text/html;charset=GBK" import="java.util.*" %>
<html>
<body>
本页面通过pageContext访问不同范围的属性对象
<%
pageContext.setAttribute("页内有效属性:姓名","陈龙");
request.setAttribute("请求有效属性:姓名","杨兵");
session.setAttribute("会话有效属性:姓名","邓萍");
application.setAttribute("应用有效属性:姓名","yoyo");
%>
<pre>
|
2007年10月05日 星期五 下午 08:45
<%@ page contentType="text/html;charset=GBk" import="java.util.*"%>
<html>
<head>
<title>客户端请求信息</title>
</head>
<body>
<p>您的客户端发送的HTTP请求头包含如下信息:</p>
<%
Enumeration enum1 = request.getHeaderNames();
while (enum1.hasMoreElements()) {
String headerName = (String) enum1.nextElement();
String headerValue = request.getHeader(headerName);
%>
<b><%= head |
2007年10月02日 星期二 下午 11:23
4-02.jsp中异常转到4-03.jsp中
4-02.jsp如下:
<%@ page language ="java" errorPage="4-03.jsp" contentType="text/html;charset=gb2312" %>
<%
int divided=0;
int divisor=0;
int result=0;
try{
result=divided/divisor;
}
catch(ArithmeticException zz){
throw new ArithmeticException("除数不能为零!");
}
%>
4-03.jsp如下: |
2007年09月25日 星期二 上午 10:51
|
浅析JSP开发中的对象和范围属性
|
|
来源:中国IT实验室收集整理 时间:2007-8-30
|
|
|
|
|