性videosgratis喷潮,亚洲国产成人一区二区三区 ,一个人看的www的视频,国产精品成人精品久久久,国产亚洲欧美精品永久

    itcast-tools-1.4.2.jar下載
網(wǎng)絡(luò)軟件 系統(tǒng)軟件 應(yīng)用軟件 聯(lián)絡(luò)聊天 圖形圖像 多媒體類 游戲娛樂 編程開發(fā) 安全相關(guān) 行業(yè)軟件

itcast-tools-1.4.2.jar包

綠色版

itcast-tools-1.4.2.jar包

itcast-tools-1.4.2.jar幫助你進行java開發(fā),這款jar文件包用于驗證碼的功能組件,讓你在今后的開發(fā)中節(jié)省時間。如果你是一名java工程師,那么這款jar包是你必不可少的軟件!

簡介:

itcast-tools-1.4.2.jar包是一款實現(xiàn)jsp servlet驗證碼等功能必不可少的jar工具包,如果缺失了itcast-tools-1.4.2.jar包許多重要的功能將報錯。

使用實例:

<servlet>

<servlet-name>VerifyCodeServlet</servlet-name>

<servlet-class>cn.itcast.vcode.servlet.VerifyCodeServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>VerifyCodeServlet</servlet-name>

<url-pattern>/VerifyCodeServlet</url-pattern>

</servlet-mapping>

利用itcast-tool包實現(xiàn)jsp+servlet驗證碼

需要的包名:itcast-tools.jar

itcast-tools-1.4.2.jar包

新建LoginServlet.Java

package cn.itcast.test.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import cn.itcast.servlet.BaseServlet;

public class LoginServlet extends BaseServlet {

public String login(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

/*

* 校驗驗證碼

* 1. 獲取表單中的驗證碼

* 2. 獲取圖片上的文字

*/

String verifyCode = request.getParameter("verifyCode");

// VerifyCodeServlet會把真正的驗證碼保存到session中

String vcode = (String) request.getSession().getAttribute("vCode");

System.out.println(verifyCode.equalsIgnoreCase(vcode));

return null;

}

}

新建form.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="//java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>My JSP 'form.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">

<!--

<link rel="stylesheet" type="text/css" href="styles.css">

-->

<script type="text/javascript">

function _hyz() {

/*

1. 獲取<img>元素

2. 給它的src指向為/tools/VerifyCodeServlet

*/

var img = document.getElementById("imgVerifyCode");

// 需要給出一個參數(shù),這個參數(shù)每次都不同,這樣才能干掉瀏覽器緩存!

img.src = "/tools/VerifyCodeServlet?a=" + new Date().getTime();

}

</script>

</head>

<body>

<%--

1. 寫表單,其中包含圖片(驗證碼)

2. 讓圖片顯示出來:

把<img>的src指向VerifyCodeServlet,你需要在web.xml中部署VerfiyCodeServlet

3. 換一張

--%>

<form action="/tools/LoginServlet" method="post">

<%-- 添加一個參數(shù):method=login --%>

<input type="hidden" name="method" value="login">

用戶名:<input type="text"  name="name"/><br/>

密碼:<input type="password" name="pwd"/><br/>

驗證碼:<input type="text" name="verifyCode"/><br/>

<img src="/tools/VerifyCodeServlet" id="imgVerifyCode"/>

<a href="javascript:_hyz()">換一張</a>

<br/>

<input type="submit" value="提交"/>

</form>

</body>

</html>

收起介紹展開介紹

安裝界面預(yù)覽圖

itcast-tools-1.4.2.jar包 綠色版 0

發(fā)表評論 查看所有評論(0)

昵稱:
字數(shù): 0/500

熱門標簽

裝機必備軟件