Foren: Japanese (Thread #26997)

[Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-02 11:22 by Anonym #52269)

以下のプラグインを利用させていただいています。
・Eclipse HTML Editor Plugin
・SAStrutsPlugin for Amateras

Struts、SAStrutsのカスタムタグの補完機能は非常に便利で
利用させていただいているのですが、
自作のカスタムタグは認識せず以下のコンパイルエラーとなります。

“xxx"に対応するtaglibディレクティブが存在しないかTLDファイルが見つかりませ
ん。

認識させる方法があれば教えてください。

Reply to #52269×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-03 22:42 by takezoe #52297)

特に何もしなくても認識するはずですが、以下の二点の情報をいただけないでしょうか。

1. 自作のカスタムタグのTLDファイルはどこに配置しているのでしょうか?

2. JSPからはどのようにTLDファイルを参照しているのでしょうか?
(taglibディレクティブやweb.xmlの記述内容など)
Reply to #52269

Reply to #52297×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-04 09:19 by Anonym #52304)

ご回答ありがとう御座います。
以下のように利用しております。

1.自作カスタムタグのTLD配置箇所
  /src/main/webapp/WEB-INF/taglib.tld

2.jspからの参照
■jsp
<%@ page pageEncoding = "UTF-8" %>
<%@ taglib prefix = "abc" uri = "http://www.abc.co.jp/taglib_1_0" %>

■web.xml
     < jsp-config >
        < taglib >
           < taglib-uri > http://www.abc.co.jp/taglib_1_0 </ taglib-uri >
           < taglib-location > /WEB-INF/taglib.tld </ taglib-location >
        </ taglib >
    < jsp-property-group >
    < url-pattern > *.jsp </ url-pattern >
    < el-ignored > false </ el-ignored >
    < page-encoding > UTF-8 </ page-encoding >
    < scripting-invalid > false </ scripting-invalid >
    < include-prelude > /WEB-INF/view/common/common.jsp </ include-prelude >
    </ jsp-property-group >
    </ jsp-config >

■taglib.tld
<? xml version = "1.0" encoding = "UTF-8" ?>
<! DOCTYPE taglib PUBLIC
  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
  "http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd" >
 
< taglib >
  < tlib-version > 1.0 </ tlib-version >
  < jsp-version > 1.2 </ jsp-version >
  < short-name > abc </ short-name >
  < uri > http://www.abc.co.jp/taglib_1_0 </ uri >
  < description > ABCのタグライブラリ </ description >

Reply to #52297

Reply to #52304×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-06 00:49 by takezoe #52332)

いただいた情報であれば認識するはずですがおかしいですね…。
プロジェクトのプロパティのAmaterasのページでWebアプリケーションのルートディレクトリの設定はされていますよね?
Reply to #52304

Reply to #52332×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-06 08:48 by Anonym #52335)

はい。ルートには
/src/main/webapp
を指定しています。
状況を指定し、Eclipseを再起動することにより
strutsタグやel式が認識されるようになりました。
しかし、自作のカスタムタグのみ認識されず、
コンパイルエラーとなります。

ちなみに、
Eclipseは3.4
Eclipse HTML Editor Pluginは2.0.7
SAStrutsPlugin for Amaterasは1.0.1
を使用しています。
Reply to #52332

Reply to #52335×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-06 08:48 by Anonym #52336)

はい。ルートには
/src/main/webapp
を指定しています。
状況を指定し、Eclipseを再起動することにより
strutsタグやel式が認識されるようになりました。
しかし、自作のカスタムタグのみ認識されず、
コンパイルエラーとなります。

ちなみに、
Eclipseは3.4
Eclipse HTML Editor Pluginは2.0.7
SAStrutsPlugin for Amaterasは1.0.1
を使用しています。
Reply to #52332

Reply to #52336×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-09 00:29 by Anonym #52380)

携帯端末からの投稿で電波が悪かったため、
誤って2回投稿してしまいました。
また、以下の通り訂正させていただきます。
誤)状況を指定し
正)上記を指定し
大変失礼しました。

その後、環境の問題かと思い他のバージョンでも
確認してみましたが、エラーは解消されませんでした。
Eclipse:3.3.2
 Eclipse HTML Editor PluginのTOPの説明では
 「Eclipse 3.0、3.1で動作します」
 とありましたが、更新履歴を見ると、Version 2.0.5
 から、Eclipse 3.3に対応されていたため。
Eclipse HTML Editor Plugin:2.0.6.1
 SAStrutsPlugin for Amaterasの説明に
 「動作にはEclipseHTMLEditor 2.0.6.1が必要です」
 とあったため。

その他に、Eclipseの設定でAmateras->TLDにより表示
されるウィンドウでTLDを追加してみましたが、エラーは
解消されませんでした。
 URI:http://www.abc.co.jp/taglib_1_0
 ローカルパス:C:¥eclipse¥..¥src¥main¥WEB-INF¥taglib.tld

コンパイル時には「taglibディレクティブやweb.xmlの記述内容など」
の情報を参照しているのでしょうか?
Reply to #52332

Reply to #52380×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-09 15:40 by Anonym #52395)

調査を進めた結果をお伝えします。

tldのバージョンを
1.2->1.1
に変更することで認識されました。

1.2のタグには対応されていないという理解でよろしいでしょうか?

■taglib.tld
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

<taglib>
<tlibversion>1.2</tlibversion>
<jspversion>1.1</jspversion>
<shortname>abc</shortname>
<uri>http://www.abc.co.jp/taglib_1_0</uri> 
Reply to #52332

Reply to #52395×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-10 02:52 by takezoe #52412)

内部でTLDをパースする際にTLDのDTDの解決に失敗していたのではないかと思います。
EclpseHTMLEditorの内部ではTLD 1.2のDTDのシステムIDが

"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"

であることを期待しているのですが、自作されたTLDでは

"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd"

になっているようですので、そのためにTLDのパースに失敗しているのが原因なのではないかと思います。
可能であれば前者のシステムIDでお試しいただければと思います。

なお、ソースのほうは"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd"を追加して
コミットしておきましたので、次のバージョンでは後者のシステムIDでも問題なく認識されるように
なるかと思います。

ご指摘&情報提供ありがとうございました。
Reply to #52395

Reply to #52412×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

RE: [Eclipse HTML Editor]自作カスタムタグの認識方法 (2010-08-10 10:24 by Anonym #52415)

ご回答ありがとう御座います。

前者のシステムID
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"
で確認したところ問題なく動作しました。
(エラーもなく補完機能も利用できました。)

TLD1.2に対応されていないというわけではなく、
システムIDの記述に問題があったということですね。

"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd"
を追加して頂けるとのこと、ありがとう御座います。

Amaterasプラグインは「Seasar2徹底入門」と共に
非常に重宝しています。
これからも活用させて頂きますので、今後ともよろしく
お願いいたします。
Reply to #52412

Reply to #52415×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden