JSPͼƬ²ÊÉ«Êý×ÖÑéÖ¤
²úÉúÑéÖ¤ÂëͼƬµÄÎļþimage.jsp
<%@ page contentType="image/jpeg" import="java.awt.*,
java.awt.image.*,java.util.*,javax.imageio.*" %>
<%!
Color getRandColor(int fc,int bc){//
¸ø¶¨·¶Î§»ñµÃËæ»úÑÕÉ«
Random random = new Random();
if(fc>255) fc=255;
if(bc>255) bc=255;
int r=fc+random.nextInt(bc-fc);
int g=fc+random.nextInt(bc-fc);
int b=fc+random.nextInt(bc-fc);
return new Color(r,g,b);
}
%>
<%
//
ÉèÖÃÒ³Ãæ²»»º´æ
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
//
ÔÚÄÚ´æÖд´½¨Í¼Ïó
int width=60, height=20;
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
//
»ñȡͼÐÎÉÏÏÂÎÄ
Graphics g = image.getGraphics();
//
Éú³ÉËæ»úÀà
Random random = new Random();
//
É趨±³¾°É«
g.setColor(getRandColor(200,250));
g.fillRect(0, 0, width, height);
//
É趨×ÖÌå
g.setFont(new Font("Times New Roman",Font.PLAIN,18));
//
»±ß¿ò
//
g.setColor(new Color());
//
g.drawRect(0,0,width-1,height-1);
//
Ëæ»ú²úÉú155Ìõ¸ÉÈÅÏߣ¬Ê¹Í¼ÏóÖеÄÈÏÖ¤Âë²»Ò×±»ÆäËü³ÌÐò̽²âµ½
g.setColor(getRandColor(160,200));
for (int i=0;i<155;i++)
{
int x = random.nextInt(width);
int y = random.nextInt(height);
int xl = random.nextInt(12);
int yl = random.nextInt(12);
g.drawLine(x,y,x+xl,y+yl);
}
//
È¡Ëæ»ú²úÉúµÄÈÏÖ¤Âë(4λÊý×Ö)
String sRand="";
for (int i=0;i<4;i++
Ïà¹ØÎĵµ£º
1.×îÖ±½Ó×î¼òµ¥µÄ£¬·½Ê½ÊÇ°ÑÎļþµØÖ·Ö±½Ó·Åµ½htmlÒ³ÃæµÄÒ»¸öÁ´½ÓÖС£ÕâÑù×öµÄȱµãÊÇ°ÑÎļþÔÚ·þÎñÆ÷ÉϵÄ·¾¶±©Â¶ÁË£¬²¢ÇÒ»¹ÎÞ·¨¶ÔÎļþÏÂÔؽøÐÐÆäËüµÄ¿ØÖÆ£¨ÈçȨÏÞ£©¡£Õâ¸ö¾Í²»Ð´Ê¾ÀýÁË¡£
2.ÔÚ·þÎñÆ÷¶Ë°ÑÎļþת»»³ÉÊä³öÁ÷£¬Ð´Èëµ½response£¬ÒÔresponse°ÑÎļþ´øµ½ä¯ÀÀÆ÷£¬ÓÉä¯ÀÀÆ÷À´ÌáʾÓû§ÊÇ·ñÔ¸Òâ±£´æÎļþµ½±¾µØ¡£
3.¼ÈÈ» ......
¼òµ¥µÄÁ¬½ÓÊý¾Ý¿âµÄ²âÊÔ´úÂë
<%@¡¡page¡¡import="java.lang.*,¡¡java.io.*,¡¡java.sql.*,¡¡java.util.*"¡¡contentType="text/html;charset=gb2312"¡¡%>
¡¡¡¡<html>
¡¡¡¡<body>
¡¡¡¡<%¡¡Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
¡¡¡¡¡¡String¡¡url="jdbc:m ......
ÊÇÔÚstruts2ÏÂÒª½â¾ö¸ÃÎÊÌ⣬ÐèÒªÁ½¸öÌõ¼þ£º
1¡¢È·±£¸ÃÓ¦ÓÃΪJ2EEµÄÓ¦Ó㬼´ÔÚweb.xmlϱ£Ö¤ÓÐÒÔÏÂÅäÖÃÐÅÏ¢£º
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSche ......
JAVA/JSPÀà±ÏÒµÉè¼Æ
ÈôÓкÏÊÊÄúµÄÉè¼Æ£¬Çë¸æËßÎÒÏêϸ˵Ã÷µÄÍøÖ·£¡Ð»Ð»ºÏ×÷£¡
±àºÅ ÌâÄ¿ ¿ª·¢¹¤¾ß ÄÚÈÝ ×ÊÁÏ·Ñ Ïêϸ˵Ã÷
001JVSQL °ì¹«×Ô¶¯»¯ÏµÍ³ JAVA JAVAÔ´´úÂë+±ÏÒµÂÛÎÄ+¿ªÌⱨ¸æ+´ð±ç¸å £¤180 Ïêϸ˵Ã÷
002JVAC ѧÉúÐÅÏ¢¹ÜÀíϵͳ JAVA JAVAÔ´´úÂë+±ÏÒµÂÛÎÄ+¿ªÌⱨ¸æ+´ð±ç¸å £¤180 Ïêϸ˵Ã÷
004JVAC ͼÊé¹Ý¹ÜÀí ......
×÷Õß: Dudu, ¡¡³ö´¦:ITר¼ÒÍøÂÛ̳,¡¡ÔðÈαà¼: ³Â×Óç÷,¡¡
2009-09-18 13:00
¡¡¡¡CLOB¿ÉÓÃÓÚ´æ·Å´óÎı¾Êý¾Ý,×î¶à¿É´æ´¢4GBÊý¾Ý,ÔÚÓ¦Óÿª·¢ÖбȽϳ£¼û.javaÌṩµÄsql.ClobÀàÓëÖ®¶ÔÓ¦.ËüÌṩÁ½¸ö·½·¨À´¶ÁÈ¡ClobµÄÊý¾Ý:
¡¡¡¡ÓÃORACLE9i¡¢oracle8¡¢Óкܳ¤µÄÒ»¶Îʱ¼ä£¬ÎÒ°ÑÓÃÓÚJSPÖÐÐèҪעÒâµÄÎÊÌâÔÚÕâÀïд³öÀ´£¬½ö¹©´ó¼Ò²Î¿¼Á ......