Java实现目录查找与文本阅读 1.实现文本阅读package AllAboutFile;/** * * @author lucifer */import java.awt.*;import java.awt.event.*;import java.io.*;public class FileViewer extends Frame implements ActionL
JSP实现HTTP隧道 共有两个java类和一个servlet(在同一个java包JavaSerializable中):java:StudentList StudentListTunnetApp(客户端)servlet:StudentListTunnetServlet(服务器端)StudentList(java类)定义一个类,StudentListTunnetApp(java类)运
Java对象串行化实例 1.StudentList.java:/** * * @author lucifer */package JavaSerializable;import java.util.*;import java.io.*;public class StudentList implements Serializable{
JSP利用URL重写传递参数示例 在servlet页中重定向到index.jsp页,但重写index.jsp页的URL传递两个参数给index页1.Servlet页:/** * * @author lucifer */package MyServlet;import java.io.IOException;import java.io.
Servlet实现文件下载 1.JSP页: Document : DownloadFile Created on : 2009-10-11, 21:24:22 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd"> JSP P
Java Bean实现网页来访计数器 1.JSP页: Document : index Created on : 2009-10-10, 14:47:46 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd"> JSP
Java Servlet获得HTTP请求消息的内容 两个java类一个jsp:ServerAccept负责监听接口8091,当客户端与端口建立连接时,该类通过一个新线程启动ServerEchoRequest类处理请求内容,并保存在目录下的request.text中。1.ServerAccept:/** * * @author lucifer */import java.net.*;impo
Java Servlet实现购物车(Session实例) 1.JSP代码:(购物form)-- Document : testSession Created on : 2009-10-9, 15:05:55 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd">
Servlet处理Cookies 用Servlet中定义的cookie类处理cookies1.JSP代码(form): Document : testCookie Created on : 2009-10-9, 14:38:59 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dt
在Java Servlet中处理异常 输入一个内容,如果是数字则输出数字,否则输出异常1.JSP代码(form表单): Document : numException Created on : 2009-10-9, 13:14:29 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd">
JSP中Servlet获取表单数据示例(doGet()和doPost()共用接口) 仔细钻研下面两个代码绝对让你受益匪浅1.JSP页(form表单): Document : index Created on : 2009-10-9, 10:37:30 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd">
含泪总结String类==与equals的区别 今天写了个注册系统,其中一段代码如下: String _username = request.getParameter("username"); String _password1 = request.getParameter("password1"); String _password2 = request.getParameter("pass
MySQL操作示例 1.创建数据库(自己进行)略. Document : index Created on : 2009-10-7, 14:27:45 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd"> JSP
JSP中include指令和include动作区别详解 我们都知道在JSP中include有两种形式,分别是<%@ include file=” ”%><jsp:include page=” ” flush=”true”/>前者是指令元素,后者是动作元素。具体它们将在何处用?如何用及它们有什么区别?这应该是很多人看到它都会想到的问题。下面一起来看看吧。通常当应用程序中所有的页面的某些部分(例如标题、页脚和导航栏)
createStatement参数解释 Statement stmt=conn.createStatement(Value1,Value2)Value1可以取值为 ResultSet.RTYPE_FORWORD_ONLY:这是缺省值,只可向前滚动; ResultSet.TYPE_SCROLL_INSENSITIVE:双向滚动,但不及时更新,就是如果数据库里的数据修改过,并不在ResultSet中反应出来。
NteBeans下JSP连接MySQL示例 注意:所有小写有下划线的地方均要自己改,如user_name,table_value1......import="java.sql.*"%>String server="localhost";String dbname="user_database"; //database名字St
form表单方法示例 1.代码: Document : index Created on : 2009-10-4, 13:56:46 Author : lucifer--%> function giveFocus(){ document.lo
JSP中application(return String)用法详例 1.JSP代码: Document : Application Created on : 2009-10-4, 13:18:53 Author : lucifer--%> "http://www.w3.org/TR/html4/loose.dtd"> JSP Pa