質問

JSPには、次のフィールドがあります。

<stripes:text name="email"/>

このフィールドは私のアクションビーン(スニペット)にあります:

    public class CreateClaim implements ActionBean {

    private String email;

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }

    public Resolution alc(){
        email = "poodle";
        return new ForwardResolution("aForward.jsp");
    }

}

Alc()Methosでは、メールをnullに設定しています。しかし、ページがレンダリングすると、電子メールフィールドの値は元々入力されたものです。一度このフィールドをクリアする方法はあり、イベントがトリガーされましたか?

乾杯

デイブ

役に立ちましたか?

解決

これはに関係しています 人口戦略 ストライプのフレームワークの。デフォルトでは、を持っています 最初の戦略を要求します (以前のバージョンとの後方互換性のため)、しかし私は常にそれを変更します 豆の最初の人口戦略.

編集するだけです web.xml Stripesフィルターにinit-paramを追加するには:

<filter>
  <filter-name>StripesFilter</filter-name>
    <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>

    <init-param>
      <param-name>PopulationStrategy.Class</param-name>
      <param-value>
        net.sourceforge.stripes.tag.BeanFirstPopulationStrategy
      </param-value>
    </init-param>
..etc...
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top