J2EE´î½¨WAPÕ¾µãʱͼƬ·¢²¼Í³Ò»¸ñʽ´¦Àí½â¾ö·½°¸
ÔÚWMLÖУ¬ÓÉÓÚÖ§³ÖµÄä¯ÀÀÆ÷²»Í¬£¬¶ÔÓÚͼƬ¸ñʽҲÓв»Í¬µÄÏÞÖÆ¡£±ÈÈç³£¼ûµÄM3Gate£¬Ä¿Ç°Ö÷ÒªÖ§³ÖµÄÊÇPNG¸ñʽ£¬ÓеÄä¯ÀÀÆ÷Ö§³ÖµÄÊÇJPGµÄ¸ñʽ¡£µ«ÊÇÈç¹ûͼƬ²»ÊÇ×Ô¼º¼Ó¹¤µÄ£¬±ÈÈçÊÇͨ¹ýÍøÒ³²É¼¯¹¤¾ß²É¼¯¹ýÀ´µÄͼƬ¸ñʽ¸÷²»Ïàͬ£¬ÕâÑù¾ÍÐèÒªÔÚ·¢²¼µÄʱºò½øÐÐͳһµÄ¸ñʽ´¦Àí¡£
ÔÚÕâÀÓÉÓÚ¸öÈËÒ»Ö±´ÓʵÄÊÇJ2EEµÄÑз¢£¬ËùÒÔÔÚ·¢²¼Í¼Æ¬µÄʱºò¶¼ÊDzÉÓÃServletÀ´·¢²¼µÄͼƬ£¬ÎªÁ˽â¾öWAPÖÐÓöµ½µÄÕâ¸öÌôÕ½£¬×öÁËһЩ±È½ÏÉîÈëµÄÑо¿¡£ÏÂÃæÊÇÕûÀíºóµÄ½â¾ö·½°¸£¨ÒѾʵÏÖ£©£¬À´Íê³ÉͼƬ·¢²¼Ê±Í³Ò»Í¼Æ¬¸ñʽ¡£
Solutions£º
ÔÚJ2EEµÄWebÓ¦ÓÃÖУ¬³£¼ûµÄ¹æ·¶ÊÇServlet¹æ·¶£¬ÓÉÓÚÄ¿Ç°Ö÷Á÷µÄÓ¦Ó÷þÎñÆ÷¶¼Ö§³ÖServlet2.3¹æ·¶£¬ËùÒÔ±¾·½°¸µÄ»ù±¾¾ÍÊÇServlet2.3¹æ·¶£¬ÀûÓÃServlet2.3ÖеÄFilterÌØÐÔÀ´¹ýÂËͼƬÄÚÈÝ£¬ÕûºÏͼƬ¸ñʽ¡£ÏÂÃæÊǾßÌåµÄ½â¾ö·½°¸£¨¼ÙÉèÓÃÀ´·¢²¼Í¼Æ¬µÄServletÊÇgetImage£©£º
ÔÚgetImageÇ°ÃæÅäÖÃÇ°ÖõÄFilter£¬ÔÚ¿Í»§¶Ë·ÃÎÊͼƬµÄʱºò£¬À¹½Ø¿Í»§¶ËµÄÇëÇó£¬Éú³ÉÒ»¸öеÄServletResponse¶ÔÏ󴫵ݸøgetImage¡£
ÌṩºóÖõÄFilter£¨ImagePostFilter£©
ÔÚgetImageÉÏÃæÅäÖúóÖõÄFilter£¬À¹½ØgetImageµÄ·µ»Ø½á¹û£¬Í¬Ê±¸ù¾ÝgetImageµÄ·µ»Ø½á¹û£¬½«Í¼Æ¬×ª»»³ÉͳһµÄ¸ñʽ·µ»Ø¸ø¿Í»§¶Ë¡£
ÍⲿʵÏÖHttpServletResponseÀࣨImageHttpServletResponse£©
±£´æWeb ContainerµÄHttpServletResponseÒÔ¼°getImageÕâ¸öServletÊä³öµ½response¶ÔÏóÖеÄÐÅÏ¢£¬Èçcookie£¬Header£¬ContentTypeµÈ¡£
ÍⲿʵÏÖOutputStreamÀࣨImageOutputStream£©
ÔÚImageHttpServletResponseÀà»ñÈ¡outputstreamµÄʱºò£¬·µ»ØÒ»¸ö×Ô¼º¶¨ÒåµÄImageOutputStream£¬ImageOutputStream½«getImageÕâ¸öservletÖÐÊä³öµÄËùÓжþ½øÖÆÊý¾Ý±£´æÆðÀ´£¨¿ÉÒÔʹÓÃjava.nio.ByteBuffer£©
ÏÂÃæ½éÉÜһЩÈçºÎÀûÓÃImageIO¶ÔÏóÀ´´¦ÀíͼƬ¸ñʽ£º
´ÓÊäÈëÁ÷ÖжÁÈ¡³öÒ»¸öBufferedImage¶ÔÏó£º
ByteArrayInputStream bin = new ByteArrayInputStream(outputstream.getBytes());
BufferedImage src = ImageIO.read(bin);
ÀûÓÃImageIO.write·½·¨£¬½«Í¼Æ¬×ª»»³ÉÖ¸¶¨µÄ¸ñʽ²¢Ð´Èëµ½Ö¸¶¨µÄÁ÷ÖУº
ImageIO.write(bimage,"png",outs);
Ïà¹ØÎĵµ£º
ÖйúµçÐÅWap¡¢Net¡¢²ÊÐŲÎÊýÉèÖÃ
WAPÏà¹Ø²ÎÊý£¨Ð£©£º
APNºÅ£ºÁô¿Õ»òÈÎÒâÃüÃû£¬È绥ÁªÐÇ¿Õ
µç»°ºÅÂ룺#777
Óû§Ãû£ºctwap@mycdma.cn
ÃÜÂ룺vnet.mobi£¨»òwap¡¢wap2£©
WAP´úÀí·þÎñÆ÷10.0.0.200£º
HTTP 10.0.0.200:80
WAP 10.0.0.200:80
Wap protal£ºwap.vnet.mobi
»¥ÁªÍøÁ¬½Ó-InternetÉèÖãº
netÏà¹Ø²ÎÊý£º
APNº ......
ÔÎĵØÖ·£ºhttp://www.pumaboyd.com/archives/754
WAP1.1ʱ´úÊÇ·ñ½áÊøÕâ¸ö²»¿É϶¨ÂÛ¡£µ«WAP2.0µÄ´óÃæ»ýʹÓÃÓ¦¸ÃÒѾ³ÉÊì¡£DianPingÍøµÄWAPÕ¾µãÒ²»ù±¾ÉÏǨÒƵ½WAP2.0
´Ó¹¹½¨WAPÍøÕ¾µÄ¹ý³ÌÀ´¿´,WAP2.0ºÍWAP1.1²¢Ã»ÓÐʲôºÜ´óµÄÇø±ð¡£
¿ÉÒÔÕâô˵wap2.0Æäʵ¾ÍÊÇxhtmlµÄÍøÕ¾£¬¶øwap1.1ÊÇwmlµÄÍøÕ¾¡£
Ïà±ÈWMLÊܵ½µÄÏÞÖÆ£¬WA ......
½ñÌìÔÚÓ¦ÓÃVSTS¼ÖÆwap»Ø·Åʱwebä¯ÀÀÆ÷ÀïÃæËùÓеÄÎÄ×Ö¶¼ÏÔʾ³ÉÁËÂÒÂ룬ËäÈ»¶Ô»Ø·Å½á¹ûûÓÐʲôӰÏ죬µ«ÊÇ£¬¿´ÉÏÈ¥ÖÕÊÇÈÃÈ˲»ÂúÒ⣬³õ²½¹À¼ÆÊÇÒòΪ»Ø·ÅµÄʱºòÓÎÀÀÆ÷ʹÓõÄ×Ö·û¼¯¸úwapÍøÕ¾Ò³ÃæµÄ²»Ò»Ö¡£ÓÚÊÇÎÒ°ÑIEµÄ±àÂëÑ¡ÔñΪ×Ô¶¯Ñ¡Ôñ£¬Ôٻطţ¬OK£¬ÎÊÌâ½â¾öÁË¡£²»ÔÙÏÔʾÂÒÂëÁË£¡ ......
wapͨÓ÷ÖÒ³¿ª·¢(×ÖÊý£¯ÎÄÕÂ)2008Äê12ÔÂ08ÈÕ ÐÇÆÚÒ» ÏÂÎç 04:24×ÖÊý·ÖÒ³£º
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<%@ page language="java" import="java.util.*,duba.dbo.dtobject.TingBook_Books,duba.dbo.dtobjec ......
package org.fox.image;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Image;
/**
* ÀàÃû£ºImageHandler.java ±àдÈÕÆÚ: 2007-8-17 ......