読者です 読者をやめる 読者になる 読者になる

Wicket で 数値文字参照をなんとかする

http://d.hatena.ne.jp/yuripop/20081113/p1
こうですか??わかりません><

import org.apache.wicket.Component;
import org.apache.wicket.application.IComponentInstantiationListener;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;


public class SampleWebAplication extends WebApplication {

	
	@Override
	public Class<? extends WebPage> getHomePage() {
		return IndexPage.class;
	}
	@Override
	protected void init() {
		super.init();

		this.addComponentInstantiationListener(new EscapeModelStringsModifier(false));
		this.getPageSettings().setAutomaticMultiWindowSupport(false);
	}
	class EscapeModelStringsModifier implements IComponentInstantiationListener {

		private boolean modify;

		public EscapeModelStringsModifier(boolean modify) {
			this.modify = modify;
		}

		@Override
		public void onInstantiation(Component component) {
			component.setEscapeModelStrings(this.modify);
		}
	}

}

もっとぶっちゃけちゃうと

import org.apache.wicket.Component;
import org.apache.wicket.application.IComponentInstantiationListener;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;

public class SampleWebAplication extends WebApplication {

	@Override
	public Class<? extends WebPage> getHomePage() {
		return IndexPage.class;
	}

	@Override
	protected void init() {
		super.init();

		this.addComponentInstantiationListener(new IComponentInstantiationListener() {
			@Override
			public void onInstantiation(Component component) {
				component.setEscapeModelStrings(false);
			}
		});
		this.getPageSettings().setAutomaticMultiWindowSupport(false);
	}
}

こうでしょうか? わかりません><