JSPエディタの補完

[SASTRUTS-102] WTPのJSPエディタでアクションのメソッドやアクションフォームのフィールドを補完できるようにする。 - The Seasar Foundation Issues (Deprecated)

たけぞうさんのコードを参考にやってみました。

Actionが以下で

package tutorial.action;

import javax.annotation.Resource;

import org.seasar.struts.annotation.ActionForm;
import org.seasar.struts.annotation.Execute;

import tutorial.form.AddForm;

public class AddAction {

	public Integer result;

	@ActionForm
	@Resource
	protected AddForm addForm;

	@Execute(validator = false)
	public String index() {
		return "index.jsp";
	}

	/**
	 * 
	 * @return 戻り値
	 */
	@Execute(input = "index.jsp")
	public String submit() {
		result = Integer.valueOf(addForm.arg1) + Integer.valueOf(addForm.arg2);
		return "index.jsp";
	}
}

ActionFormが以下のような場合

package tutorial.form;

import org.seasar.struts.annotation.IntegerType;
import org.seasar.struts.annotation.Required;

public class AddForm {

	@Required
	@IntegerType
	public String arg1;

	/**
	 * hoge
	 */
	@Required
	@IntegerType
	public String arg2;
}

以下のように補完されます。


c:foreachタグでループをまわしている場合はうまく動きません。
補完候補となるのはActionの@Executeアノテーションがついたpublicでかつ引数0のメソッドとActionFormのpublicフィールドです。

ひとまず現状のものをコミットしたので興味のある方はどうぞ。