我對組件AjaxFormComponentUpdatingBehavior
有問題。 當我將這個組件添加到主頁面時,spring安全啓用授權,作爲受保護的頁面。當我從頁面中刪除這個組件時,一切都變好了。Wicket AjaxFormComponentUpdatingBehavior Spring Security
我UNSECURED_RESOURCE_LIST 「/資源/ 」, 「/資產/」, 「/ CSS/」, 「/字體/」, 「/ webjars/」, 「/ IMG/」 ,「/ js/**」。
這裏是我的wicket頁面,你可以看到當我添加AjaxFormComponentUpdatingBehavior組件時,spring安全啓用授權。
public class FrontPage extends WebPage {
private List<Language> languages = Arrays.asList(Language.RUSSIAN,
Language.ENGLISH);
private Language language = Language.RUSSIAN;
private DropDownChoice languagesDD;
public FrontPage() {
languagesDD = new DropDownChoice<String>("languages", new
PropertyModel(FrontPage.this, "language"), new
PropertyModel(FrontPage.this, "languages"), new ChoiceRenderer() {
@Override
public Object getDisplayValue(Object object) {
Language language = (Language) object;
if (Language.RUSSIAN.equals(language)) {
return getString("Language.RUSSIAN");
} else if (Language.ENGLISH.equals(language)) {
return getString("Language.ENGLISH");
}
return super.getDisplayValue(object);
}
});
add(languagesDD);
languagesDD.add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//iWebSession().setLocaleString(language.getCode());
//setResponsePage(FrontPage.class);
}
});
}
}
你能更具體嗎? – soorapadman