摘要: public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{ response.setContentType("text/html");//创建一个HttpSession HttpSession session=request.getSession();//回话的使用:session.setAbttribute(String name,Object value);保存一个对象//session.getAbtt 阅读全文
posted @ 2011-11-14 21:56 张书薏 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 所谓servlet生命周期就是servlet被创建到销毁的过程。1.实例化---创建一个servlet。2.初始化---调用init()方法。3.服务 ---接受请求,对客户端请求进行判断(get/post),调用doGet()或doPost()。4.销毁 ---调用destroy()进行销毁操作。 阅读全文
posted @ 2011-11-14 16:32 张书薏 阅读(94) 评论(0) 推荐(0) 编辑
摘要: package com.mytest;public class GetArray { //求数组最大值 public void getMaxArray(int[] intArray){ int maxArray=intArray[0]; for (int i = 0; i < intArray.length; i++) {if(intArray[i]>maxArray){maxArray=intArray[i]; }} System.out.println("最大值:"+maxArray); }//求数组最小值 public void getMinArray(i 阅读全文
posted @ 2011-11-13 14:07 张书薏 阅读(4454) 评论(0) 推荐(0) 编辑