JSP验证码问题
杯具了。今天找这个错误找了一个多小时了。我服了。。还是找不出来。救救我吧。。。
当我点击更换验证码的时候没有效果。。刷新的话就可以显示新的验证码。
大家麻烦看一下代码。。。Java code:
public class CodeServlet 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 {
response.setHeader("pragma", "no-cache");
response.setHeader("cache-control", "no-cache");
response.setHeader("expires", "0");
String checkcode="";
char[] c=new char[62];
Random r=new Random();
for(int i=0;i<c.length;i++){
if(i<=9){
c[i]=(char)(i+48);
}
if(i>=10&&i<=35){
c[i]=(char)(i+'A'-10);
}
if(i>=36){
c[i]=(char)(i+'a'-36);
}
}
for(int i=0;i<5;i++){
checkcode+=c[r.nextInt(62)];
}
System.out.println(checkcode);
int width=120,height=40;
BufferedIm
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......
我想用javabean实现计数
代码如下:
ComputerCount.java
package tom.jiafei;
import java.io.*;
public class ComputerCount{
int number=0;
boolean iscome=false;
File file=new ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......
想做一个jsp的电子商务网站,想找一些源代码,请问那个网站有好的资源。谢谢!
搜索下吧 开源的也有
csdn就有相似的源码,楼主搜一下
java 开源大全
改模板好麻烦哦,还不如自己写个了呢
jf
顶一 ......