public class MakeImage extends HttpServlet
画像イメージに、文字列を動的に合成作成する、サーブレットです。 画像イメージを読取り、そこに、引数のテキスト文字列を合成します。 元は、googleMap のマーカーに、マーカー番号を合成する為に作られました。 一般的なサーブレットと同様に、デプロイメント・ディスクリプタ WEB-INF/web.xml に、 servlet 要素と そのマッピング(servlet-mapping)を定義する必要があります。 <servlet> <servlet-name>makeImage</servlet-name> <servlet-class>org.opengion.hayabusa.servlet.MakeImage</servlet-class> </servlet> <servlet-mapping> <servlet-name>makeImage</servlet-name> <url-pattern>/jsp/makeImage</url-pattern> </servlet-mapping> 一般には、http://サーバー:ポート/システムID/jsp/makeImage?text=番号 形式のURL でアクセスします。
コンストラクタと説明 |
---|
MakeImage() |
修飾子とタイプ | メソッドと説明 |
---|---|
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
GET メソッドが呼ばれたときに実行します。
|
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
POST メソッドが呼ばれたときに実行します。
|
void |
init(ServletConfig config)
Servlet の 初期値設定を行います。
|
static void |
main(java.lang.String[] args)
PNGイメージの透過色指定を行います。
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
doGet
クラス内 HttpServlet
request
- HttpServletRequestオブジェクトresponse
- HttpServletResponseオブジェクトServletException
- サーブレット関係のエラーが発生した場合、throw されます。java.io.IOException
- 入出力エラーが発生したときpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
doPost
クラス内 HttpServlet
request
- HttpServletRequestオブジェクトresponse
- HttpServletResponseオブジェクトServletException
- サーブレット関係のエラーが発生した場合、throw されます。java.io.IOException
- 入出力エラーが発生したときpublic void init(ServletConfig config) throws ServletException
init
インタフェース内 Servlet
init
クラス内 GenericServlet
config
- ServletConfigオブジェクトServletException
public static void main(java.lang.String[] args) throws java.io.IOException
args
- コマンド引数配列java.io.IOException
- 入出力エラーが発生したときWebアプリケーションフレームワーク openGionCopyright (c) 2009 The openGion Project.