2012-02-29 9 views
0

最近、WebアプリケーションをJSF 2.0(MyFaces 2.0.9)にアップグレードし、tomcat 6(Servlet 2.5コンテナ)を使用してアップグレードしました。今入力値のEL条件文の結果、設定操作に不正な構文が発生する

ERROR: org.ajax4jsf.webapp.BaseXMLFilter - Exception in the filter chain javax.servlet.ServletException: /jsp/CrudUser.jsp(79,9) '#{myBean.countrySelectionControl ? (empty myBean.restrictedCountry ? '' : myBean.restrictedCountry) : myBean.countryCode}' Illegal Syntax for Set Operation

<h:selectOneMenu id="country" 
      value="#{myBean.countrySelectionControl ? (empty myBean.restrictedCountry ? '' : myBean.restrictedCountry) : myBean.countryCode}" 
      onchange="submit()" 
      disabled="#{myBean.countrySelectionControl}"> 
      <f:selectItem itemValue="" itemLabel="------------------Select-----------------" /> 
      <f:selectItem itemValue="here" itemLabel="Here" /> 
      <f:selectItem itemValue="there" itemLabel="There" /> 
    </h:selectOneMenu> 

が、今までにアップグレードするので、このような文は以下のようにエラーを引き起こしている:以前

は、JSPファイルに(JSF 2にアップグレードする前に)私は、次のようなたstatmentsを持っていました私は論理をBackbeanに戻すことができますが、その前に、他の選択肢があるかどうかを確認して確認し、そのような場合に「ベストプラクティス」が何であるかを知りたいと思っていました。

+1

[JSTL](http://stackoverflow.com/tags/jstl/info)と[EL](http://stackoverflow.com/tags/el/info)を混同しないでください。 – BalusC

+1

2.0.12のようなより最新のバージョンにアップグレードしてみてください。 – Daniel

答えて

2

Javaコード(モデル+コントローラ)にできるだけ多くのロジックをテンプレート(ビュー)にロジックを持たせることとは反対の考え方があります。 xhtmlには非常に複雑なロジックがあり、Beanへの移行はこのルールに沿っています。

関連する問題