Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP5329376B2 - Web application character code checking method, system and program - Google Patents
[go: Go Back, main page]

JP5329376B2 - Web application character code checking method, system and program - Google Patents

Web application character code checking method, system and program Download PDF

Info

Publication number
JP5329376B2
JP5329376B2 JP2009273535A JP2009273535A JP5329376B2 JP 5329376 B2 JP5329376 B2 JP 5329376B2 JP 2009273535 A JP2009273535 A JP 2009273535A JP 2009273535 A JP2009273535 A JP 2009273535A JP 5329376 B2 JP5329376 B2 JP 5329376B2
Authority
JP
Japan
Prior art keywords
character code
code check
name
web application
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2009273535A
Other languages
Japanese (ja)
Other versions
JP2011118524A (en
Inventor
聡 鬼平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Systems Ltd
Original Assignee
Hitachi Systems Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Systems Ltd filed Critical Hitachi Systems Ltd
Priority to JP2009273535A priority Critical patent/JP5329376B2/en
Publication of JP2011118524A publication Critical patent/JP2011118524A/en
Application granted granted Critical
Publication of JP5329376B2 publication Critical patent/JP5329376B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Description

本発明は、サーバサイドjava(登録商標)技術を利用し、WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションにおける入力チェック処理技術に係り、特に、不正な文字コードの入力チェック処理を効率的に行うのに好適な技術に関するものである。   The present invention relates to an input check processing technology in a Web application that uses server-side java (registered trademark) technology and uses Struts as a Web application framework, and in particular, efficiently performs input check processing of illegal character codes. The present invention relates to a technique suitable for the above.

近年、クライアントOSのバージョンアップに伴い、使用する文字コードセットが変更されるケースが発生し、従来のクライアントでは入力不可能であった文字が、入力可能になっている。   In recent years, there has been a case where the character code set to be used has been changed with the upgrade of the client OS, and it has become possible to input characters that could not be input by conventional clients.

一方、Webアプリケーションで使用する文字コードは、システム構築時に確定した条件であり、システム構築後に文字コードセットを変更することは困難である。そのため、クライアントから送信されるデータの文字コードが妥当であるか否かをチェックし、Webアプリケーションで許可されていない文字は登録できない仕組みが必要である。   On the other hand, the character code used in the Web application is a condition determined at the time of system construction, and it is difficult to change the character code set after the system construction. Therefore, it is necessary to check whether the character code of the data transmitted from the client is valid and to register a character that is not permitted by the Web application.

例えば、Windows XP(登録商標)の後に提供されたWindows Vista(登録商標)では「JIS X 0213:2004」の文字コードセットが使用されているのに対し、既存の(Windows XP(登録商標)のWebアプリケーションはshift-jisで構築されており、Windows Vista(登録商標)のPC(パーソナルコンピュータ)から送信されたデータに不正な文字コードが存在する場合には、既存のWebアプリケーションが正常に動作しなくなる場合があるので、文字コードをチェックする機能を追加して、不正な文字コードを防止する必要が生じる。   For example, Windows Vista (registered trademark) provided after Windows XP (registered trademark) uses the character code set of “JIS X 0213: 2004”, whereas existing (Windows XP (registered trademark) The web application is built with shift-jis, and if an invalid character code exists in the data transmitted from a Windows Vista (registered trademark) PC (personal computer), the existing web application operates normally. Since it may disappear, it is necessary to add a function for checking the character code to prevent an illegal character code.

Webアプリケーションに関しては、サーバサイドjava(登録商標)技術を利用したWebアプリケーションの開発を効率的に行なう為、例えば、非特許文献1,2,3に記載のように、MVC(Model、View、Control)モデルに適したフレームワークである「Struts」が多く利用されている。   For Web applications, in order to efficiently develop Web applications using server-side java (registered trademark) technology, for example, as described in Non-Patent Documents 1, 2, and 3, MVC (Model, View, Control ) “Struts”, a framework suitable for models, is often used.

Strutsは、「Jakarta Project」によって開発されている、Java(登録商標) Servlet/JSP(Java(登録商標)Server Pages)技術を用いたWebアプリケーション開発を行う上で有用な、オープンソースフレームワークであり、100%Pure Java(登録商標)で記述されており、このStrutsを使用した環境では、入力データチェックの仕組みがコンポーネントの部品として実装されており、入力データチェック機能に関しても、フレームワークの部品が提供する機能を利用して行なうのが、一般的である。   Struts is an open source framework that is useful for developing Web applications using Java (registered trademark) Servlet / JSP (Java (registered trademark) Server Pages) technology developed by the "Jakarta Project". , Written in 100% Pure Java (registered trademark). In the environment using Struts, the input data check mechanism is implemented as a component part, and the framework part is also included in the input data check function. It is common to use the functions provided.

このWebアプリケーションフレームワーク(Struts)の入力検証機能は、例えば、図1に示すアプリケーションサーバ102においては、Action108の開始時に処理しており、この時点では、クライアント端末100のWebブラウズ101から送信されたデータは全て、アプリケーションサーバ102におけるActionForm107に格納されている。   The input verification function of this Web application framework (Struts) is processed at the start of Action 108 in the application server 102 shown in FIG. 1, for example. At this time, the input verification function is transmitted from the Web browse 101 of the client terminal 100. All the data is stored in the ActionForm 107 in the application server 102.

しかし、このようなフレームワークの入力検証機能では、1項目単位のエラー検知処理を行っている。そのため、ある項目でエラーが検知されたら、それ以降の項目に関しては、処理せず、コントローラ、すなわち、図1のActionServlet112に制御を戻し、このActionServlet112(コントローラ)から画面表示クラス113を介し、ActionForm107に格納されたデータを基に、クライアント端末100へ送信する。   However, such an input verification function of the framework performs error detection processing for each item. Therefore, if an error is detected in a certain item, the subsequent items are not processed, and control is returned to the controller, that is, the ActionServlet 112 in FIG. 1, and this ActionServlet 112 (controller) returns to the ActionForm 107 via the screen display class 113. Based on the stored data, the data is transmitted to the client terminal 100.

従って、複数の項目で同時に文字コードエラーが発生するようなケースでは、先頭1件目の文字コードエラーは正しく処理できるが、2件目以降の文字コードエラーは検知できず、クライアント端末100のWebブラウザ101から受け取ったデータをそのまま返却するので、エラーデータ2件目以降に、アプリケーションサーバ102で設定されている範囲外の文字コードが送信された場合には、文字化けが発生してしまうという問題がある。   Therefore, in a case where character code errors occur simultaneously in a plurality of items, the first character code error can be processed correctly, but the second and subsequent character code errors cannot be detected, and the client terminal 100 Web Since the data received from the browser 101 is returned as it is, if a character code outside the range set in the application server 102 is transmitted after the second error data, the character is garbled. There is.

尚、例えば、特許文献1においては、Webアプリケーションサーバとは別に設けたコンピュータ装置において、Webアプリケーションサーバから送信されてくる検査情報付きレスポンスやメタ情報付きレスポンスを受信し、そのメタ情報を手がかりとして、仕様書DBの中から検査情報(期待値、検査条件)を取得し、取得した検査情報に基づいて出力項目の検査を実行し、検査情報が、Webアプリケーションの仕様書に記述された期待値である場合、出力項目と期待値が一致するか否かを判断し、合格もしくは不合格を示すメッセージを検査結果として出力する技術が記載されているが、この技術は、サーバサイドjava(登録商標)技術を活用してWebアプリケーションフレームワークにStrutsを使用した環境でコンポーネントの部品として実装されている入力データチェックの仕組みを利用するものではない。   For example, in Patent Document 1, a computer device provided separately from a Web application server receives a response with inspection information and a response with meta information transmitted from the Web application server, and uses the meta information as a clue. Inspection information (expected value, inspection condition) is acquired from the specification DB, the output item is inspected based on the acquired inspection information, and the inspection information is the expected value described in the Web application specification. In some cases, a technique is described in which whether or not an output item matches an expected value, and a message indicating pass or fail is output as a test result, this technique is described as server-side java (registered trademark). Component parts in an environment that uses Struts as a web application framework by utilizing technology It does not use the input data check mechanism implemented as.

特開2008−112300号公報JP 2008-112300 A

「IT:連載 Strutsを使うWebアプリケーション構築術(1)」、[平成21年11月10日検索]、インターネット<URL:http://www.atmarkit.co.jp/fjava/rensai3/struts01/struts01_1.html>."IT: Web application construction technique using serial Struts (1)", [searched on November 10, 2009], Internet <URL: http://www.atmarkit.co.jp/fjava/rensai3/struts01/struts01_1 .html>. 「Java(登録商標)の道:Struts(17.Validator)」、[平成21年11月10日検索]、インターネット<URL:http://www.javaroad.jp/opensource/js_struts19.htm>.“Java (registered trademark) road: Struts (17. Validator)” [searched on November 10, 2009], Internet <URL: http://www.javaroad.jp/opensource/js_struts19.htm>. 「StrutsによるWebアプリケーション開発」、[平成21年11月10日検索]、インターネット<URL:http://www.infoscience.co.jp/technical/struts/index.html>.“Web application development with Struts” [searched on November 10, 2009], Internet <URL: http://www.infoscience.co.jp/technical/struts/index.html>.

解決しようとする問題点は、従来の技術では、サーバサイドjava(登録商標)技術を活用してWebアプリケーションフレームワークにStrutsが使用された環境においてコンポーネント部品として実装されている入力データチェックの仕組みを、文字コードチェック処理に有効に利用することができない点である。   The problem to be solved is that the conventional technology uses a server side java (registered trademark) technology to check the input data that is implemented as a component part in an environment where Struts is used in the Web application framework. This is a point that cannot be used effectively for the character code check process.

本発明の目的は、これら従来技術の課題を解決し、サーバサイドjava(登録商標)技術を利用し、WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションにおける、不正な文字コードの入力チェック処理を高効率化することである。   The object of the present invention is to solve these problems of the prior art, and to improve the illegal character code input check processing in a web application using the server side java (registered trademark) technology and using Struts as the web application framework. It is to improve efficiency.

上記目的を達成するため、本発明では、サーバサイドjava(登録商標)技術を利用したWebアプリケーションフレームワークにStrutsを使用した既存のWebアプリケーションにおける入力チェック処理機能に、文字コードチェックの機能を追加し、従来のWebアプリケーションフレームワークの入力検証機能による定義を使って文字コードチェック処理を行なうことを特徴とする。特に、文字コードチェック処理を、コントローラ(ActionServlet)内で行う事により、複数の項目の文字コードチェックを一度に行なうことが可能となる。また、Webアプリケーションフレームワーク(Strust)が使用する各種定義ファイル(validation.xml、Struts-config.xml)の定義情報を活用することにより、フレームワークの入力検証機能の設定手順と同様な設定で、文字コードチェックを適用する項目を画面のフィールド単位に任意に指定できるようになる。   In order to achieve the above object, in the present invention, a character code check function is added to an input check processing function in an existing Web application that uses Struts as a Web application framework that uses server-side java (registered trademark) technology. The character code check processing is performed using the definition by the input verification function of the conventional web application framework. In particular, by performing the character code check process in the controller (ActionServlet), it is possible to check the character codes of a plurality of items at once. In addition, by utilizing the definition information of various definition files (validation.xml, Struts-config.xml) used by the Web application framework (Strust), the settings are the same as the setting procedure of the input validation function of the framework. The item to which the character code check is applied can be arbitrarily specified for each field of the screen.

本発明によれば、Webアプリケーションフレームワークの入力検証機能の定義をそのまま文字コードチェックの定義に使用できる為、汎用性が高い。また、文字コードチェックプログラムは、Webアプリケーションのコントローラ(ActionServlet)で共通的に処理し、画面個別処理には依存しない為、既存のWebアプリケーションに文字コードチェックプログラムを後から追加する場合には、少ない変更で簡単に追加することができる。   According to the present invention, since the definition of the input verification function of the Web application framework can be used as it is for the definition of the character code check, the versatility is high. In addition, since the character code check program is commonly processed by the controller (ActionServlet) of the Web application and does not depend on the individual screen processing, there are few cases where the character code check program is added to the existing Web application later. Can be easily added with changes.

本発明に係るWebアプリケーションの文字コードチェックシステムの構成例を示すブロック図である。It is a block diagram which shows the structural example of the character code check system of the Web application which concerns on this invention. 図1におけるWebアプリケーションの文字コードチェックシステムの本発明に係るWebアプリケーションの文字コードチェック方法の第1の手順例を示すフローチャートである。FIG. 3 is a flowchart showing a first example of a procedure of a character code check method for a Web application according to the present invention of the Web application character code check system in FIG. 1. FIG. 図1におけるWebアプリケーションの文字コードチェックシステムの本発明に係るWebアプリケーションの文字コードチェック方法の第2の手順例を示すフローチャートである。It is a flowchart which shows the 2nd example of a procedure of the character code check method of the Web application which concerns on this invention of the character code check system of the Web application in FIG. 図1における文字コードチェック定義ファイルの構成例を示す説明図である。It is explanatory drawing which shows the structural example of the character code check definition file in FIG. 図1におけるStruts-config.xmlファイルの構成例を示す説明図である。It is explanatory drawing which shows the structural example of the Struts-config.xml file in FIG. 図1におけるvalidation.xmlファイルの構成例を示す説明図である。It is explanatory drawing which shows the structural example of validation.xml file in FIG.

以下、図を用いて本発明を実施するための形態例を説明する。図1において、100はクライアント端末(図中「端末」と記載)、101はクライアント端末100で稼働するWebブラウザ、102はアプリケーションサーバ、110はデータベースであり、クライアント端末100とアプリケーションサーバ102は図示していないインターネット等のネットワークで接続されている。   Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings. In FIG. 1, 100 is a client terminal (denoted as “terminal” in the figure), 101 is a Web browser operating on the client terminal 100, 102 is an application server, 110 is a database, and the client terminal 100 and the application server 102 are illustrated. Not connected via a network such as the Internet.

クライアント端末100およびアプリケーションサーバ102は、CPU(Central Processing Unit)や主メモリ、表示装置、入力装置、外部記憶装置等を具備したコンピュータ構成からなり、光ディスク駆動装置等を介してCD−ROM等の記憶媒体に記録されたプログラムやデータを外部記憶装置内にインストールした後、この外部記憶装置から主メモリに読み込みCPUで処理することにより、各処理部の機能を実行する。   The client terminal 100 and the application server 102 have a computer configuration including a CPU (Central Processing Unit), a main memory, a display device, an input device, an external storage device, and the like, and are stored in a CD-ROM or the like via an optical disk drive device or the like. After the program or data recorded on the medium is installed in the external storage device, the function of each processing unit is executed by reading the program or data from the external storage device into the main memory and processing it by the CPU.

特に、本例のアプリケーションサーバ102は、サーバサイドjava(登録商標)技術を利用したWebアプリケーションフレームワークにStrutsを使用しており、プログラムされたコンピュータ処理を実行する機能として、Action108、業務ロジッククラス109、画面表示クラス111、ActionServlet(コントローラ)112を具備している。   In particular, the application server 102 of this example uses Struts as a Web application framework that uses server-side java (registered trademark) technology. Action 108, business logic class 109 are functions that execute programmed computer processing. , A screen display class 111 and an ActionServlet (controller) 112.

ActionServlet(コントローラ)112は、クライアント端末100のWebブラウザからの要求を受け取ると、リクエストデータをActionForm107に格納し、Action108を呼び出す。   When the ActionServlet (controller) 112 receives a request from the Web browser of the client terminal 100, it stores the request data in the ActionForm 107 and calls the Action 108.

Action108は、ActionForm107に格納されたデータを基に業務ロジッククラス109を実行し、JSP(Java(登録商標)Server Pages)を呼び出し、データベース110に対するアクセス制御を行う。   The Action 108 executes the business logic class 109 based on the data stored in the ActionForm 107, calls JSP (Java (registered trademark) Server Pages), and performs access control on the database 110.

尚、JSPとは、Java(登録商標)言語を利用してWebサーバで動的にWebページを生成し、クライアントに送信する技術であり、HTMLファイルの中にJava(登録商標)プログラムを埋め込んでおき、クライアントの要求に応じてプログラムを実行し、処理結果のみをクライアントに送信する。送信する処理結果は通常のHTML形式になるため、Webブラウザに特殊な機能を組みこむことなくWebアプリケーションを構築できる。   JSP is a technology that uses the Java (registered trademark) language to dynamically generate a web page on a web server and send it to the client. The Java (registered trademark) program is embedded in the HTML file. Then, the program is executed in response to the request from the client, and only the processing result is transmitted to the client. Since the processing result to be sent is in the normal HTML format, it is possible to construct a Web application without incorporating special functions in the Web browser.

このような動作を行う本例のアプリケーションサーバ102では、サーバサイドjava(登録商標)技術を利用したWebアプリケーションフレームワークにStrutsを使用した既存のWebアプリケーションにおける入力チェック処理機能に、文字コードチェックの機能を追加し、従来のWebアプリケーションフレームワークの入力検証機能による定義を使って文字コードチェック処理を行なう。   In the application server 102 of this example that performs such operations, a character code check function is added to an input check processing function in an existing Web application that uses Struts as a Web application framework that uses server-side java (registered trademark) technology. The character code check process is performed using the definition by the input verification function of the conventional Web application framework.

特に、本例のアプリケーションサーバ102では、文字コードチェック処理を、ActionServlet112内で行う事により、複数の項目の文字コードチェックを一度に行なうことが可能となる。   In particular, in the application server 102 of this example, by performing the character code check process in the ActionServlet 112, it is possible to check the character codes of a plurality of items at once.

すなわち、ActionServlet112は、文字コードチェックプログラム103を実行して、文字コードチェック定義ファイル104、validation.xml105、Struts-config.xml106を用いて、本発明に係る文字コードチェック処理を行う。   That is, the ActionServlet 112 executes the character code check program 103 and performs the character code check process according to the present invention using the character code check definition file 104, validation.xml 105, and Struts-config.xml 106.

この際、アプリケーションサーバ102では、Webアプリケーションフレームワーク(Strust)が使用する各種定義ファイルであるvalidation.xml105、Struts-config.xml106における定義情報を活用することにより、フレームワークの入力検証機能の設定と同様な設定で、文字コードチェックを適用する項目を画面のフィールド単位に任意に指定できるようになる。   At this time, the application server 102 uses the definition information in validation.xml 105 and Struts-config.xml 106, which are various definition files used by the Web application framework (Strust), to set the input validation function of the framework. With the same setting, the item to which the character code check is applied can be arbitrarily specified for each field of the screen.

尚、Struts-config.xml106においては、どのActionForm(107)にリクエストデータを格納するのか、どのAction(108)を呼び出すのか、Actionの実行後、どのJSPを呼び出すのか等が定義されており、validation.xml105は、Validatorにおいて、ActionForm(108)に格納された値が指定した条件に合致しているか否かを調べ、合致していない場合はエラーを表示する際に用いるルールが定義されている。   In Struts-config.xml 106, which ActionForm (107) stores the request data, which Action (108) is called, which JSP is called after the execution of Action, etc. are defined. .xml 105 defines a rule that is used in the Validator to check whether the value stored in the ActionForm (108) matches the specified condition, and when it does not match, an error is displayed.

このように、本例のアプリケーションサービス102においては、WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションに入力される文字コードのチェックを、struts-config.xmlファイルとvalidation.xmlファイルを用いて行うために、コンピュータ装置に、プログラムされたコンピュータ処理を実行する機能として、ActionServlet(112)を継承する文字コードチェック処理機能(文字コードチェックプログラム103)を設けている。   As described above, in the application service 102 of this example, the character code input to the web application using Struts as the web application framework is checked using the struts-config.xml file and the validation.xml file. In addition, the computer device is provided with a character code check processing function (character code check program 103) that inherits ActionServlet (112) as a function for executing programmed computer processing.

そして、この文字コードチェックプログラム103は、予め文字コードチェック定義ファイル104に定義された、文字コードチェックを行う文字コードセットの名称(文字エンコーディング名)と文字コードチェックのルール名を読み出して記憶装置に記憶し、クライアント端末100からWebブラウザ101を介して入力されたリクエスト要求pathを基にstruts-config.xmlファイル106を検索して、当該リクエスト要求pathに対応して予め定義されたform name、validate属性、input pathのそれぞれの値を取得して記憶装置に記憶し、取得したvalidate属性の値がtrueであるか否かを判別して、validate属性値がtrueでなければ、当該リクエスト要求pathのままActionServlet112に制御を戻し、validate属性値がtrueであれば、下記の手順を実行して、全てのリクエストデータに対する文字コードチェック処理を行う。   The character code check program 103 reads a character code set name (character encoding name) and a character code check rule name that are defined in advance in the character code check definition file 104 and performs character code check, and stores them in the storage device. The struts-config.xml file 106 is searched based on the request request path that is stored and input via the web browser 101 from the client terminal 100, and the form name and validate defined in advance corresponding to the request request path are stored. Acquire each value of attribute and input path and store them in the storage device, determine whether the acquired validate attribute value is true, and if the validate attribute value is not true, If control is returned to ActionServlet 112 and the validate attribute value is true, the following procedure is executed to execute all requests. Performing character code check processing for the Todeta.

すなわち、文字コードチェックプログラム103は、取得したform nameを基にvalidation.xmlファイル105を検索して、form nameの値が一致し、かつ、field propertyの値がリクエスト要求の項目名称と一致する予め定義されたフィールドを特定し、特定したフィールドにおけるdepend属性に、取得した文字コードチェックのルール名が予め定義されているか否かを判別し、予め定義されていれば、特定したフィールドに入力される文字が、取得した文字エンコーディング名の文字コードセットに含まれるか否かを判定し、含まれない場合にエラー発生を検出し、エラーメッセージを生成して出力する。   That is, the character code check program 103 searches the validation.xml file 105 based on the acquired form name, and the value of the form name matches and the value of the field property matches the item name of the request request in advance. Identifies the defined field, determines whether or not the acquired character code check rule name is defined in advance in the depend attribute in the identified field, and if it is defined in advance, it is input to the identified field It is determined whether or not the character is included in the character code set of the acquired character encoding name. If the character is not included, an error occurrence is detected, and an error message is generated and output.

また、文字コードチェックプログラム103は、エラー発生を検出した文字を全て、予め文字コードチェック定義ファイル104に定義された、読み出した文字エンコーディング名の文字コードセットの範囲に存在する文字に置き換え、validation.xmlファイル105において予めarg0 keyで定義されている項目名を用いて、エラーメッセージを生成し、入力されたリクエスト要求pathを、struts-config.xmlファイル106に予め定義されたinput pathに変更して、ActionServlet112に制御を戻す。   In addition, the character code check program 103 replaces all characters for which an error has been detected with characters existing in the character code set range of the read character encoding name defined in the character code check definition file 104 in advance. An error message is generated using the item name defined in advance in the xml file 105 with the arg0 key, and the input request request path is changed to an input path defined in the struts-config.xml file 106 in advance. , Control is returned to the ActionServlet 112.

以下、このような、アプリケーションサーバ102による、本発明に係る文字コードチェック処理に係る処理動作について具体的に説明する。   Hereinafter, the processing operation related to the character code check processing according to the present invention by the application server 102 will be specifically described.

アプリケーションサーバ102には、サーブレット、JSPなど、サーバサイドJava(登録商標)技術のコンポーネント実行環境と、WebアプリケーションフレームワークのStruts実行環境が含まれている。   The application server 102 includes a server side Java (registered trademark) technology component execution environment such as a servlet and JSP, and a Web application framework Struts execution environment.

図1において、クライアント端末100がWebブラウザ101を使用してデータを送信すると、アプリケーションサーバ102のActionServlet112を継承する文字コードチェックプログラム103に処理が遷移する。   In FIG. 1, when the client terminal 100 transmits data using the Web browser 101, the process transitions to the character code check program 103 that inherits the ActionServlet 112 of the application server 102.

文字コードチェックプログラム103では、文字コードチェック定義ファイル104、Struts-config.xml106、validation.xml105を使用して、送信されたデータの文字コードチェックを行ない、ActionForm107に格納する。   The character code check program 103 uses the character code check definition file 104, Struts-config.xml 106, and validation.xml 105 to check the character code of the transmitted data and stores it in the ActionForm 107.

文字コードチェックの結果が正常でエラーが発生しない場合には、要求されたパスへ制御を渡し、Struts-config.xml106において指定されている画面表示クラス111によって、ActionFrom107の内容を出力し、出力結果をクライアント端末100のWebブラウザ101に表示する。   If the result of the character code check is normal and no error occurs, control is passed to the requested path, the contents of ActionFrom107 are output by the screen display class 111 specified in Struts-config.xml 106, and the output result Is displayed on the Web browser 101 of the client terminal 100.

文字コードチェックエラーが発生した場合には、Struts-config.xml106において定義されているINPUTパスへ制御を渡し、Struts-config.xml106において指定されている画面表示クラス111によって、エラーメッセージを出力し、出力結果をクライアント端末100のWebブラウザ101に表示する。   If a character code check error occurs, control is passed to the INPUT path defined in Struts-config.xml 106, and an error message is output by the screen display class 111 specified in Struts-config.xml 106. The output result is displayed on the Web browser 101 of the client terminal 100.

以下、図2および図3を用いて、このような、Webアプリケーションサーバ102の、文字コードチェックプログラム103による処理動作を説明する。   Hereinafter, the processing operation by the character code check program 103 of the Web application server 102 will be described with reference to FIGS. 2 and 3.

図2のステップS201の処理において、文字コードチェックプログラム103により、文字コードチェック定義ファイル104より、文字コードチェックを行なう文字コードセットの名称(文字エンコーデイング名)を取得する。   In the process of step S201 in FIG. 2, the character code check program 103 acquires the name of the character code set (character encoding name) for performing the character code check from the character code check definition file 104.

ステップS202の処理では、文字コードチェック定義ファイル104より、validation.xml105参照時に使用する、文字コードチェックのルール名を取得する。   In the process of step S202, the character code check rule name used when referring to validation.xml 105 is acquired from the character code check definition file 104.

ステップS203の処理では、文字コードチェック定義ファイル104より、文字コードエラーが発生した場合に文字化けしないで表示させる為に、文字コードエラー発生時に置換する文字を取得する。尚、この置換文字は、文字化けしない文字である必要がある為、ステップS201の処理で取得した文字コードセットの範囲に存在する文字である必要がある。   In the process of step S203, a character to be replaced when a character code error occurs is acquired from the character code check definition file 104 so that the character code error is displayed without being garbled. The replacement character needs to be a character that is not garbled, and therefore needs to be a character that exists in the range of the character code set acquired in the process of step S201.

ステップS204の処理では、クライアント端末100から送信されたリクエスト要求のURLのパス情報を取得し、ステップS205の処理では、取得したパス情報を基にStruts-config.xml106ファイルを検索し、URLパス情報に対応するform name、validate 属性、input 属性、各々の値を取得する。   In the process of step S204, URL path information of the request request transmitted from the client terminal 100 is acquired. In the process of step S205, the Struts-config.xml106 file is searched based on the acquired path information, and the URL path information is obtained. Get the form name, validate attribute, and input attribute values corresponding to.

ステップS206の処理では、Validate属性がtrueであるか否かを判別し、Validate属性がtrueの場合は、validation.xml105の定義による入力検証処理が実装されており、この入力検証の定義を活用して文字コードチェックを行なう為に、図3のステップS301に分岐し、validate属性がtrue以外の場合には、文字コードチェックは行なわない為、ステップS207の処理を行い、リクエスト要求pathのままActionServlet112に制御を戻す。   In the process of step S206, it is determined whether or not the Validate attribute is true. If the Validate attribute is true, the input validation process based on the definition of validation.xml 105 is implemented, and this input validation definition is utilized. In order to check the character code, the process branches to step S301 in FIG. 3. If the validate attribute is other than true, the character code check is not performed, so the process of step S207 is performed, and the request request path remains in the ActionServlet 112. Return control.

図3のステップS301では、クライアントから送信される項目全ての文字コードチェックを行なう必要がある為、送信データ項目分の繰り返し処理の中で、文字コードチェックを行なう。   In step S301 in FIG. 3, since it is necessary to check the character codes of all items transmitted from the client, the character codes are checked in the repeated processing for the transmission data items.

ステップS302では、図2のステップS205で取得したform nameより、validation.xml105に定義されているform nameと一致し、かつ、リクエスト要求の項目名称と一致するfield propertyの値と一致するノードを検索する。   In step S302, a node that matches the form name defined in validation.xml 105 and matches the field property value that matches the item name of the request request is searched from the form name acquired in step S205 of FIG. To do.

ステップS303では、validation.xml105の該当field のdepends属性より、ステップS202で取得した文字コードチェックルールが存在するかを判定する。存在しない場合には、文字コードチェックをしないフィールドである為、何も処理しない。存在する場合には、文字コードチェックを行なう必要のあるフィールドである為、ステップS304の処理を行なう。   In step S303, it is determined whether the character code check rule acquired in step S202 exists from the dependencies attribute of the corresponding field of validation.xml 105. If it does not exist, the field is not checked for character code, so nothing is processed. If it exists, it is a field that needs to be checked for character code, so the process of step S304 is performed.

このステップS304では、文字コードチェックを行なってエラーが発生した場合に、エラーメッセージの一部に項目名称を置換して編集する為、validation.xml105の該当fieldに対応する項目名称(arg0 key 属性)を取得する。   In step S304, when an error occurs due to a character code check, an item name (arg0 key attribute) corresponding to the corresponding field of validation.xml 105 is used for editing by replacing the item name with a part of the error message. To get.

そして、ステップS305では、特定したfieldに入力された文字の1桁目〜n桁目迄の繰り返し処理(ステップS306〜S307)を行なう。   In step S305, iterative processing (steps S306 to S307) from the first digit to the nth digit of the character input in the specified field is performed.

ステップS306では、特定したfieldに入力されたデータの1文字分が、図2のステップS201で取得した文字エンコーディング名の文字セットに含まれるかを判定し、含まれる場合は、次の文字の判定処理を行ない、含まれない場合には、ステップS307において、図2のステップS203で取得したエラー発生時の置換文字で置き換える。   In step S306, it is determined whether one character of the data input in the specified field is included in the character set of the character encoding name acquired in step S201 of FIG. 2, and if included, determination of the next character is performed. If it is not included, it is replaced with the replacement character at the time of occurrence of the error acquired in step S203 of FIG.

特定したfieldに入力された文字の最後まで、文字コードチェックが終了したら、ステップS308において、置換文字の置き換えが発生したかを判定し、置き換えが発生していた場合は、ステップS309において、ActionFormに置換された項目を設定する。   When the character code check is completed up to the end of the character input in the specified field, it is determined in step S308 whether replacement of the replacement character has occurred. If replacement has occurred, the action form is set in step S309. Set the replaced item.

また、ステップS310において、ステップS304で取得した項目名称を使用して、エラーメッセージの編集を行ない、エラーメッセージをセットする。   In step S310, the error message is edited using the item name acquired in step S304, and the error message is set.

そして、文字コードチェック対象field全てをチェックした後、ステップS311において、文字コードエラーが発生したかどうかを判定する。   After checking all the character code check target fields, it is determined in step S311 whether or not a character code error has occurred.

文字コードエラーが発生しなかった場合には、図2のステップS207の処理に分岐し、リクエスト要求pathのまま、ActionServletへ制御を戻す。文字コードエラーが発生した場合には、図2のステップS208に分岐し、リクエスト要求pathをステップS205で取得したinput pathに変更し、ActionServletへ制御を戻す。   If no character code error has occurred, the process branches to step S207 in FIG. 2, and the control is returned to the ActionServlet without changing the request request path. If a character code error has occurred, the process branches to step S208 in FIG. 2, the request request path is changed to the input path acquired in step S205, and control is returned to ActionServlet.

図4においては、図1における文字コードチェック定義ファイル104での定義例の詳細(文字コードチェック定義ファイル400)を示しており、定義401では、図2のステップS201で取得する文字エンコーディング名を定義する。図4の例では、文字エンコーディング名は、「MS932」であり、文字コードチェック処理の文字コードセットとして使用される。   4 shows details of the definition example (character code check definition file 400) in the character code check definition file 104 in FIG. 1. In the definition 401, the character encoding name acquired in step S201 in FIG. 2 is defined. To do. In the example of FIG. 4, the character encoding name is “MS932”, which is used as a character code set for character code check processing.

定義402では、図2のステップS202で取得する文字コードチェックルール名を定義する。図4の例では、文字コードチェックルールは、「charcode」と定義されており、図6においてvalidation.xml600として詳細を示す図1のvalidation.xml105のdepends属性で指定するチェックルールと対応している。   In the definition 402, the character code check rule name acquired in step S202 of FIG. 2 is defined. In the example of FIG. 4, the character code check rule is defined as “charcode” and corresponds to the check rule specified by the dependencies attribute of the validation.xml 105 in FIG. 1, which is shown in detail as validation.xml 600 in FIG. 6. .

定義403では、図2のステップS203で取得するエラー発生時の置換文字を定義する。図4の例では、置換文字は、「?」と設定されており、図3のステップS307において、文字コードエラー発生時に、エラー対象の文字は、定義403の置換文字(「?」)で置き換えられる。   The definition 403 defines a replacement character at the time of occurrence of an error acquired in step S203 in FIG. In the example of FIG. 4, the replacement character is set to “?”, And when a character code error occurs in step S307 of FIG. 3, the error target character is replaced with the replacement character (“?”) Of the definition 403. It is done.

定義404では、図3のステップS310でエラーメッセージ編集の基となるメッセージを定義する。定義404における{0}は、図3のステップS304の処理で、図6のvalidation.xml600における定義602でのarg0 key で取得した項目名称(「案件名称」)で置き換え、定義404における{1}は、図2のステップS203の処理で、図4の定義403から取得した置換文字(「?」)で置き換えて、エラーメッセージを編集する。   In the definition 404, a message serving as a basis for editing the error message is defined in step S310 of FIG. {0} in the definition 404 is replaced with the item name ("Matter name") acquired by the arg0 key in the definition 602 in the validation.xml 600 in FIG. 6 in the process of step S304 in FIG. Is replaced with the replacement character (“?”) Acquired from the definition 403 in FIG. 4 in the process of step S203 in FIG. 2, and the error message is edited.

図5においては、図1におけるStruts-config.xml106での定義例の詳細(Struts-config.xml500)を示しており、定義501では、図2のステップS204で取得したリクエスト要求のpathと一致するpathが定義されている。リクエスト要求のpathと一致したpathが、当該リクエスト処理に関する情報である。   FIG. 5 shows details of the definition example (Struts-config.xml 500) in Struts-config.xml 106 in FIG. 1, and the definition 501 matches the path of the request request acquired in step S204 of FIG. path is defined. A path that matches the path of the request request is information related to the request processing.

定義502では、図2のステップS205で取得されるform nameの値が、定義503では、図2のステップS205で取得されるvalidate属性の値が、定義504では、図2のステップS205で取得されるinput pathの値が設定される。   In the definition 502, the value of the form name acquired in step S205 in FIG. 2 is acquired. In the definition 503, the value of the validate attribute acquired in step S205 in FIG. 2 is acquired in the definition 504 in step S205 of FIG. Input path value is set.

図6においては、図1におけるvalidation.xml105での定義例の詳細(validation.xml600)を示しており、定義601では、フィールド名が「ankennm」のdepends属性に、入力チェックを行なうルールが定義されており、最後に文字コードチェック用のルール「charcode」が設定されている為、当該フィールドは、文字コードチェック対象のフィールドという事になる。   FIG. 6 shows details of the definition example (validation.xml 600) in validation.xml 105 in FIG. 1. In the definition 601, a rule for performing input check is defined for the depends attribute whose field name is “ankennm”. Finally, since the character code check rule “charcode” is set, this field is a character code check target field.

定義602では、フィールド名に対応する項目名が定義されており(arg0 key)、エラーメッセージの編集に使用される。   In the definition 602, an item name corresponding to the field name is defined (arg0 key) and used for editing an error message.

この図6におけるvalidation.xml600の定義は、既存技術のStrutsWebアプリケーションフレームワークの入力検証機能で使用するものと同じものを使用し、文字コードチェック処理だけでなく、他の入力検証の定義と一緒に定義する。   The definition of validation.xml 600 in FIG. 6 is the same as that used in the input validation function of the Struts Web application framework of the existing technology, and not only the character code check process but also other input validation definitions. Define.

以上、図1〜図6を用いて説明したように、本例では、サーバサイドjava技術を利用したWebアプリケーションフレームワークにStrutsを使用した既存のWebアプリケーションにおける入力チェック処理機能に、文字コードチェックの機能を追加し、従来のWebアプリケーションフレームワークの入力検証機能による定義を使って文字コードチェック処理を行なうことを特徴とする。特に、文字コードチェック処理を、コントローラ(ActionServlet)内で行う事により、複数の項目の文字コードチェックを一度に行なうことが可能となる。また、Webアプリケーションフレームワーク(Struts)が使用する各種定義ファイル(validation.xml、Struts-config.xml)の定義情報を活用することにより、フレームワークの入力検証機能の設定手順と同様な設定で、文字コードチェックを適用する項目を画面のフィールド単位に任意に指定できるようになる。   As described above with reference to FIGS. 1 to 6, in this example, the character code check function is added to the input check processing function in an existing Web application that uses Struts as a Web application framework using the server-side java technology. A function is added, and character code check processing is performed using a definition by an input verification function of a conventional Web application framework. In particular, by performing the character code check process in the controller (ActionServlet), it is possible to check the character codes of a plurality of items at once. In addition, by utilizing the definition information of various definition files (validation.xml, Struts-config.xml) used by the Web application framework (Struts), the settings are the same as the setting procedure of the input validation function of the framework. The item to which the character code check is applied can be arbitrarily specified for each field of the screen.

具体的には図1に示すように、WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションに入力される文字コードのチェックを、struts-config.xmlファイルとvalidation.xmlファイルを用いて行うために、コンピュータ装置に、プログラムされたコンピュータ処理を実行する機能として、ActionServlet(112)を継承する文字コードチェック処理機能(文字コードチェックプログラム103)を設ける。   Specifically, as shown in FIG. 1, in order to check the character code input to the web application using Struts as the web application framework using the struts-config.xml file and the validation.xml file, The computer device is provided with a character code check processing function (character code check program 103) inheriting ActionServlet (112) as a function for executing programmed computer processing.

そして、この文字コードチェックプログラム103において、予め文字コードチェック定義ファイル104に定義された、文字コードチェックを行う文字コードセットの名称(文字エンコーディング名)と文字コードチェックのルール名を読み出して記憶装置に記憶し、クライアント端末100からWebブラウザ101を介して入力されたリクエスト要求pathを基にstruts-config.xmlファイル106を検索して、当該リクエスト要求pathに対応して予め定義されたform name、validate属性、input pathのそれぞれの値を取得して記憶装置に記憶し、取得したvalidate属性の値がtrueであるか否かを判別して、validate属性値がtrueでなければ、当該リクエスト要求pathのままActionServlet112に制御を戻し、validate属性値がtrueであれば、下記の手順を実行して、全てのリクエストデータに対する文字コードチェック処理を行う。   Then, the character code check program 103 reads the name of the character code set (character encoding name) and the character code check rule name that are defined in advance in the character code check definition file 104 and performs the character code check and stores them in the storage device. The struts-config.xml file 106 is searched based on the request request path that is stored and input via the web browser 101 from the client terminal 100, and the form name and validate defined in advance corresponding to the request request path are stored. Acquire each value of attribute and input path and store them in the storage device, determine whether the acquired validate attribute value is true, and if the validate attribute value is not true, Return control to ActionServlet112, and if validate attribute value is true, execute the following procedure, Performing character code check processing for the quest data.

すなわち、文字コードチェックプログラム103は、取得したform nameを基にvalidation.xmlファイル105を検索して、form nameの値が一致し、かつ、field propertyの値がリクエスト要求の項目名称と一致する予め定義されたフィールドを特定し、特定したフィールドにおけるdepend属性に、取得した文字コードチェックのルール名が予め定義されているか否かを判別し、予め定義されていれば、特定したフィールドに入力される文字が、取得した文字エンコーディング名の文字コードセットに含まれるか否かを判定し、含まれない場合にエラー発生を検出し、エラーメッセージを生成して出力する。   That is, the character code check program 103 searches the validation.xml file 105 based on the acquired form name, and the value of the form name matches and the value of the field property matches the item name of the request request in advance. Identifies the defined field, determines whether or not the acquired character code check rule name is defined in advance in the depend attribute in the identified field, and if it is defined in advance, it is input to the identified field It is determined whether or not the character is included in the character code set of the acquired character encoding name. If the character is not included, an error occurrence is detected, and an error message is generated and output.

また、文字コードチェックプログラム103は、エラー発生を検出した文字を全て、予め文字コードチェック定義ファイル104に定義された、読み出した文字エンコーディング名の文字コードセットの範囲に存在する文字に置き換え、validation.xmlファイル105において予めarg0 keyで定義されている項目名を用いて、エラーメッセージを生成し、入力されたリクエスト要求pathを、struts-config.xmlファイル106に予め定義されたinput pathに変更して、ActionServlet112に制御を戻す。   In addition, the character code check program 103 replaces all characters for which an error has been detected with characters existing in the character code set range of the read character encoding name defined in the character code check definition file 104 in advance. An error message is generated using the item name defined in advance in the xml file 105 with the arg0 key, and the input request request path is changed to an input path defined in the struts-config.xml file 106 in advance. , Control is returned to the ActionServlet 112.

このようにして、Webアプリケーションフレームワークの入力検証機能の定義をそのまま文字コードチェックの定義に使用できる為、汎用性が高くなる。また、文字コードチェックプログラム103は、Webアプリケーションのコントローラ(ActionServlet112)で共通的に処理し、画面個別処理には依存しない為、既存のWebアプリケーションに文字コードチェックプログラムを後から追加する場合には、少ない変更で簡単に追加することができる。   In this way, since the definition of the input verification function of the Web application framework can be used as it is for the definition of the character code check, versatility is enhanced. Further, since the character code check program 103 is processed in common by the controller (ActionServlet 112) of the Web application and does not depend on the individual screen processing, when adding the character code check program to the existing Web application later, Easy to add with few changes.

これにより、本例によれば、サーバサイドjava(登録商標)技術を利用し、WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションにおける入力チェック処理を効率的に行うことができる。   Thereby, according to this example, it is possible to efficiently perform input check processing in a Web application using Struts as a Web application framework by using server-side java (registered trademark) technology.

尚、本発明は、図1〜図6を用いて説明した例に限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能である。例えば、図1に示す構成では、データベース110をアプリケーションサーバ102とは別のコンピュータシステムとし構成となっているが、アプリケーションサーバ102内にデータベース110を設けた構成としても良い。   In addition, this invention is not limited to the example demonstrated using FIGS. 1-6, In the range which does not deviate from the summary, various changes are possible. For example, in the configuration illustrated in FIG. 1, the database 110 is configured as a computer system different from the application server 102, but the database 110 may be provided in the application server 102.

また、クライアント端末100とアプリケーションサーバ102を接続するネットワークとしてインターネットを例示したが、イントラネットであっても良い。   Further, although the Internet is exemplified as a network connecting the client terminal 100 and the application server 102, an intranet may be used.

また、本例のコンピュータ構成例に関しても、キーボードや光ディスクの駆動装置の無いコンピュータ構成としても良い。また、本例では、光ディスクを記録媒体として用いているが、FD(Flexible Disk)等を記録媒体として用いることでも良い。また、プログラムのインストールに関しても、通信装置を介してネットワーク経由でプログラムをダウンロードしてインストールすることでも良い。   The computer configuration example of this example may also be a computer configuration without a keyboard or optical disk drive. In this example, an optical disk is used as a recording medium. However, an FD (Flexible Disk) or the like may be used as a recording medium. As for the program installation, the program may be downloaded and installed via a network via a communication device.

100:クライアント端末、101:Webブラウザ、102:アプリケーションサーバ、103:文字コードチェックプログラム、104:文字コードチェック定義ファイル、105:validation.xmlファイル(Strutsフレームワークの定義ファイル)、106:Struts-config.xmlファイル(Strutsフレームワークの定義ファイル)、107:ActionForm、108:Action、109:業務ロジッククラス、110:データベース、111:画面表示クラス、112:ActionServlet(コントローラ)、400:文字コードチェック定義ファイル、401:定義(文字エンコーデイング名の定義例)、402:定義(文字コードチェックルールの定義例)、403:定義(エラー発生時の置換文字の定義例)、404:定義(エラーメッセージの定義例)、500:Struts-config.xmlファイル、501:定義(pathの定義例)、502:定義(form nameの定義例)、503:定義(validation 属性の定義例)、504:定義(input pathの定義例)、600:validation.xmlフィル、601:定義(field名称およびdepends属性の定義例)、602:定義(のarg0 key属性の定義例)。   100: Client terminal 101: Web browser 102: Application server 103: Character code check program 104: Character code check definition file 105: Validation.xml file (Struts framework definition file) 106: Struts-config .xml file (Struts framework definition file), 107: ActionForm, 108: Action, 109: Business logic class, 110: Database, 111: Screen display class, 112: ActionServlet (controller), 400: Character code check definition file 401: Definition (example of character encoding name definition) 402: Definition (example of character code check rule definition) 403: Definition (example of definition of replacement character when error occurs) 404: Definition (definition of error message) Example), 500: Stru ts-config.xml file, 501: definition (path definition example), 502: definition (form name definition example), 503: definition (validation attribute definition example), 504: definition (input path definition example), 600: validation.xml file, 601: definition (definition example of field name and dependencies attribute), 602: definition (definition example of arg0 key attribute).

Claims (5)

WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションに入力される文字コードのチェックを、struts-config.xmlファイルとvalidation.xmlファイルを用いて行うWebアプリケーションの文字コードチェック方法であって、
ンピュータ装置は、プログラムされたコンピュータ処理を実行する手段として、
ActionServletを継承する文字コードチェック処理手段を具備し、
該文字コードチェック処理手段は、
予め文字コードチェック定義ファイルに定義された、文字コードチェックを行う文字コードセットの名称(文字エンコーディング名)と文字コードチェックのルール名を読み出して記憶装置に記憶し、
入力されたリクエスト要求pathを基に上記struts-config.xmlファイルを検索して、当該リクエスト要求pathに対応して予め定義されたform name、validate属性、input pathのそれぞれの値を取得して記憶装置に記憶し、
上記取得したvalidate属性の値がtrueであるか否かを判別して、validate属性値がtrueでなければ、当該リクエスト要求pathのまま上記ActionServletに制御を戻し、validate属性値がtrueであれば、下記の手順を実行して、全てのリクエストデータに対する文字コードチェック処理を行う
ことを特徴とするWebアプリケーションの文字コードチェック方法。
<手順>
上記取得したform nameを基に上記validation.xmlファイルを検索して、form nameの値が一致し、かつ、field propertyの値がリクエスト要求の項目名称と一致する予め定義されたフィールドを特定し、
特定したフィールドにおけるdepend属性に、上記取得した文字コードチェックのルール名が予め定義されているか否かを判別し、
予め定義されていれば、特定したフィールドに入力される文字が、上記取得した文字エンコーディング名の文字コードセットに含まれるか否かを判定し、
含まれない場合にエラー発生を検出し、エラーメッセージを生成して出力する
A web application character code check method that uses a struts-config.xml file and a validation.xml file to check the character code input to a web application that uses Struts as a web application framework.
Computer device, as a means for performing a programmed computer processor,
It has a character code check processing means that inherits ActionServlet,
The character code check processing means includes:
Read out the name of the character code set (character encoding name) and the character code check rule name that is defined in the character code check definition file in advance, and store them in the storage device.
Search the struts-config.xml file based on the input request request path, and acquire and store the values of form name, validate attribute, and input path that are predefined for the request request path. Memorize in the device,
It is determined whether or not the value of the acquired validate attribute is true. If the validate attribute value is not true, control is returned to the ActionServlet with the request request path, and if the validate attribute value is true, A character code check method for a Web application, wherein a character code check process is performed for all request data by executing the following procedure.
<Procedure>
Search the validation.xml file based on the acquired form name, identify the predefined field whose form name value matches and the field property value matches the item name of the request request,
Determine whether the rule name of the character code check acquired above is defined in advance in the depend attribute in the identified field,
If it is defined in advance, it is determined whether or not the character input in the specified field is included in the character code set of the acquired character encoding name,
If it is not included, an error is detected and an error message is generated and output.
請求項1に記載のWebアプリケーションの文字コードチェック方法であって、
上記文字コードチェック処理手段は、
上記エラー発生を検出した文字を全て、予め上記文字コードチェック定義ファイルに定義された、上記読み出した文字エンコーディング名の文字コードセットの範囲に存在する文字に置き換え、
上記validation.xmlファイルにおいて予めarg0 keyで定義されている項目名を用いて、上記エラーメッセージを生成し、
上記入力されたリクエスト要求pathを、上記struts-config.xmlファイルに予め定義されたinput pathに変更して、上記ActionServletに制御を戻す
ことを特徴とするWebアプリケーションの文字コードチェック方法。
A method of checking a character code of a web application according to claim 1,
The character code check processing means
Replace all the characters that detected the error occurrence with characters that exist in the character code set range of the read character encoding name defined in the character code check definition file in advance,
Using the item name defined in advance in arg0 key in the validation.xml file, generate the error message,
A method of checking a character code of a Web application, wherein the input request request path is changed to an input path defined in advance in the struts-config.xml file, and control is returned to the ActionServlet.
WebアプリケーションフレームワークにStrutsを使用したWebアプリケーションに入力される文字コードのチェックを、struts-config.xmlファイルとvalidation.xmlファイルを用いて、プログラムされたコンピュータ処理により行うWebアプリケーションの文字コードチェックシステムであって、
該Webアプリケーションの文字コードチェックシステムは、プログラムされたコンピュータ処理を実行する手段として、ActionServletを継承する文字コードチェック処理手段を具備し、
該文字コードチェック処理手段は、
予め文字コードチェック定義ファイルに定義された、文字コードチェックを行う文字コードセットの名称(文字エンコーディング名)と文字コードチェックのルール名を読み出して記憶装置に記憶する機能と、
入力されたリクエスト要求pathを基に上記struts-config.xmlファイルを検索して、当該リクエスト要求pathに対応して予め定義されたform name、validate属性、input pathのそれぞれの値を取得して記憶装置に記憶する機能、および、
上記取得したvalidate属性の値がtrueであるか否かを判別して、validate属性値がtrueでなければ、当該リクエスト要求pathのまま上記ActionServletに制御を戻し、validate属性値がtrueであれば、下記の手順を実行して、全てのリクエストデータに対する文字コードチェック処理を行う機能を有する
ことを特徴とするWebアプリケーションの文字コードチェックシステム。
<手順>
上記取得したform nameを基に上記validation.xmlファイルを検索して、form nameの値が一致し、かつ、field propertyの値がリクエスト要求の項目名称と一致する予め定義されたフィールドを特定し、
特定したフィールドにおけるdepend属性に、上記取得した文字コードチェックのルール名が予め定義されているか否かを判別し、
予め定義されていれば、特定したフィールドに入力される文字が、上記取得した文字エンコーディング名の文字コードセットに含まれるか否かを判定し、
含まれない場合にエラー発生を検出し、エラーメッセージを生成して出力する
Character code check system for web applications that checks the character code input to a web application that uses Struts as the web application framework, using the struts-config.xml file and validation.xml file, by programmed computer processing Because
The Web application character code check system includes character code check processing means that inherits ActionServlet as means for executing programmed computer processing,
The character code check processing means includes:
A function that reads a character code set name (character encoding name) and a character code check rule name that are defined in the character code check definition file in advance and stores them in a storage device;
Search the struts-config.xml file based on the input request request path, and acquire and store the values of form name, validate attribute, and input path that are predefined for the request request path. The function to store in the device, and
It is determined whether or not the value of the acquired validate attribute is true. If the validate attribute value is not true, control is returned to the ActionServlet with the request request path, and if the validate attribute value is true, A Web application character code check system characterized by having a function of executing character code check processing for all request data by executing the following procedure.
<Procedure>
Search the validation.xml file based on the acquired form name, identify the predefined field whose form name value matches and the field property value matches the item name of the request request,
Determine whether the rule name of the character code check acquired above is defined in advance in the depend attribute in the identified field,
If it is defined in advance, it is determined whether or not the character input in the specified field is included in the character code set of the acquired character encoding name,
If it is not included, an error is detected and an error message is generated and output.
請求項3に記載のWebアプリケーションの文字コードチェックシステムであって、
上記文字コードチェック処理手段は、
上記エラー発生を検出した文字を全て、予め上記文字コードチェック定義ファイルに定義された、上記読み出した文字エンコーディング名の文字コードセットの範囲に存在する文字に置き換え、
上記validation.xmlファイルにおいて予めarg0 keyで定義されている項目名を用いて、上記エラーメッセージを生成し、
上記入力されたリクエスト要求pathを、上記struts-config.xmlファイルに予め定義されたinput pathに変更して、上記ActionServletに制御を戻す機能を有する
ことを特徴とするWebアプリケーションの文字コードチェックシステム。
The web application character code check system according to claim 3,
The character code check processing means
Replace all the characters that detected the error occurrence with characters that exist in the character code set range of the read character encoding name defined in the character code check definition file in advance,
Using the item name defined in advance in arg0 key in the validation.xml file, generate the error message,
A character code check system for a Web application, having a function of changing the input request request path to an input path defined in advance in the struts-config.xml file and returning control to the ActionServlet.
コンピュータに、請求項1もしくは請求項2のいずれかに記載のWebアプリケーションの文字コードチェック方法における文字コードチェック処理手段による各処理を実行させるためのプログラム。   A program for causing a computer to execute each process by the character code check processing means in the character code check method of the Web application according to claim 1.
JP2009273535A 2009-12-01 2009-12-01 Web application character code checking method, system and program Expired - Fee Related JP5329376B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009273535A JP5329376B2 (en) 2009-12-01 2009-12-01 Web application character code checking method, system and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009273535A JP5329376B2 (en) 2009-12-01 2009-12-01 Web application character code checking method, system and program

Publications (2)

Publication Number Publication Date
JP2011118524A JP2011118524A (en) 2011-06-16
JP5329376B2 true JP5329376B2 (en) 2013-10-30

Family

ID=44283799

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009273535A Expired - Fee Related JP5329376B2 (en) 2009-12-01 2009-12-01 Web application character code checking method, system and program

Country Status (1)

Country Link
JP (1) JP5329376B2 (en)

Also Published As

Publication number Publication date
JP2011118524A (en) 2011-06-16

Similar Documents

Publication Publication Date Title
JP5821678B2 (en) Web service for automatic compatibility check independent of web application browser
CN108089974B (en) Test the application with a defined input format
JP5851690B2 (en) Web document set automatic editing system and method
CN102483698B (en) The client tier checking of dynamic WEB application
US8983935B2 (en) Methods for utilizing a javascript emulator in a web content proxy server and devices thereof
US7240279B1 (en) XML patterns language
JP5742521B2 (en) Method and program for automated testing of web application forms
US8661416B2 (en) Method and apparatus for defining and instrumenting reusable Java server page code snippets for website testing and production
JP4023803B2 (en) Web application development support apparatus, data processing method, and program
KR20080053293A (en) Server-Side Initial Content Rendering for Client Script Web Pages
JP2021108189A (en) Method for acquiring vulnerability feature, device, and electronic apparatus
US20220405196A1 (en) Operation pattern generation apparatus, operation pattern generation method and program
JP5329376B2 (en) Web application character code checking method, system and program
US20110246965A1 (en) Correcting document generation for policy compliance
JP5545133B2 (en) Static analysis processing system, method, and program
JP6941980B2 (en) Test scenario execution system and test scenario execution method
US7603388B2 (en) Representing file data using virtual hierarchy
US9965453B2 (en) Document transformation
CN114691176A (en) Code viewing method, device, equipment and storage medium based on updating annotation
JP6818568B2 (en) Communication device, communication specification difference extraction method and communication specification difference extraction program
US20260017382A1 (en) Vulnerability Detection And Smart Remediation Using Runtime Data
CN115509543B (en) Methods, apparatus, electronic devices and storage media for determining document validity
US11960560B1 (en) Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof
US20240012740A1 (en) Systems and methods for integrated design, assessment and remediation of web pages
CN119622739A (en) Vulnerability patch verification method, device, computer equipment, readable storage medium and program product

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20110617

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20111227

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120914

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130424

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130507

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130613

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130702

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130724

R150 Certificate of patent or registration of utility model

Ref document number: 5329376

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees