日期:2014-05-19  浏览次数:20703 次

j2me结合j2ee实现用户登陆功能-2【转】

服务器代码:
LoginServlet:
package com;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/** *//*******************************************************************************
*
*
@author zdw
*
*/

@SuppressWarnings(
"serial")
public class LoginServlet extends HttpServlet
{

????
public void doGet(HttpServletRequest request, HttpServletResponse response)
????????????
throws ServletException, IOException
????
{
????????
this.doPost(request, response);
???? }


????
public void doPost(HttpServletRequest request, HttpServletResponse response)
????????????
throws ServletException, IOException
????
{
????????
// 得到客户端传入的数据(用户名和密码)
???????? String username = request.getParameter("username");
???????? String password
= request.getParameter(