第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

驗(yàn)證碼出不來(lái) 好心人幫看看


jsp

<%@ page language="java" contentType="text/html; charset=utf-8"

? ? pageEncoding="utf-8"%>

?<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%> ??

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

?<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0"> ? ?

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

</head>

<body>

驗(yàn)證碼:<input type="text" name="checkcode"/>

<img alt="驗(yàn)證碼" src="<%=request.getContextPath() %>/servlet/ImageServlet>"/>

<a href="javascript:reloadCode();">看不清楚</a><br>

</body>

</html>





package checkCode;


import java.awt.Color;

import java.awt.Graphics;

import java.awt.image.BufferedImage;

import java.io.IOException;

import java.util.Random;


import javax.imageio.ImageIO;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;


public class ImageServlet extends HttpServlet {

/**

*?

*/

private static final long serialVersionUID = 1L;


public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException{

BufferedImage bi=new BufferedImage(68,22,BufferedImage.TYPE_INT_RGB);

Graphics g=bi.getGraphics();

Color c= new Color(200,150,255);

g.setColor(c);

g.fillRect(0, 0, 68, 22);

char[] ch="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toCharArray();

Random r=new Random();

int len=ch.length,index;

StringBuffer sb=new StringBuffer();

for(int i=0;i<4;i++){

index=r.nextInt(len);

g.setColor(new Color(r.nextInt(88),r.nextInt(188),r.nextInt(255)));

g.drawString(ch[index]+"", (i*15)+3, 18);

sb.append(ch[index]);

}

request.getSession().setAttribute("piccode", sb.toString());

ImageIO.write(bi, "JPG", response.getOutputStream());

}

}


<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

? <display-name>checkCode</display-name>

?<servlet>

? <servlet-name>ImageServlet</servlet-name>

? <servlet-class>com.muke.ImageServlet</servlet-class>

?</servlet>

?<servlet-mapping>

? <servlet-name>ImageServlet</servlet-name>

? <url-pattern>/Servlet/ImageServlet</url-pattern>

?</servlet-mapping>

? <welcome-file-list>

? ? <welcome-file>index.html</welcome-file>

? ? <welcome-file>index.htm</welcome-file>

? ? <welcome-file>index.jsp</welcome-file>

? ? <welcome-file>default.html</welcome-file>

? ? <welcome-file>default.htm</welcome-file>

? ? <welcome-file>default.jsp</welcome-file>

? </welcome-file-list>

</web-app>


正在回答

舉報(bào)

0/150
提交
取消

驗(yàn)證碼出不來(lái) 好心人幫看看

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)