WAS6.1とSAStrutsのEL関数で発生する不思議な現象


次のような事態が発生したが、原因がさっぱり。
どうやらWAS固有の問題な気がするが・・・。

Websphere 6.1
SAStruts 1.0.4-sp8

[現象]
javax.servlet.jsp.el.ELException: No function is mapped to the name
"f:h"が発生する。


エラーとなっている箇所はこんな感じの場所。

<inputonclick="javascript:test('${f:h(testProperty)}');"/>


[特徴]

  • それ以外の場所で使っているf:hではエラーが発生しない。
  • f:hを自作タグに入れ替えると動作する。こんな感じ↓。
<inputonclick="javascript:test('${xf:h(testProperty)}');"/>
<%@taglib prefix="xf" uri="http://localhost/Test" %>
<?xml version="1.0" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
web-jsptaglibrary_2_0.xsd"
version="2.0">

<tlib-version>2.0</tlib-version>

<function>
  <name>f</name>
  <function-class>test.testFunction</function-class>
  <function-signature>
    java.lang.String f(java.lang.String)
  </function-signature>
</function>
</taglib>
<jsp-config>
<taglib>
  <taglib-uri>http://localhost/Test</taglib-uri>
  <taglib-location>/WEB-INF/tld/testFunction.tld</taglib-location>
</taglib>
</jsp-config>
  • シングルクオートとダブルクオートを入れ替えたら動作した。こんな感じ↓。
<inputonclick='javascript:test("${f:h(testProperty)}");'>


グーグル先生に聞いてみたら
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg1PK24731
とか
http://kashira.jugem.jp/?eid=56
とかが引っかかった。

WASの6.1でEL式の評価方法を変えたようでそれが影響しているよう。
シングルクオートとダブルクオートを入れ替えたら動いたから、そこが原因かな?

ただ、これだとf:hが動かなくてxf:hで動く理由がよく分からない・・・。


ひとまず、今日はここまで。