Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

Apache Wicket Interview Questions and Answers

Ques. How to integrate apache-wicket with Spring?
Ans.
Override Wicket application init() method with this addComponentInstantiationListener(new SpringComponentInjector(this));.

File : Wicket application class

package com.withoutbook;
 
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import com.withoutbook.user.SimplePage;
 
public class WicketApplication extends WebApplication {
 
@Override
public Class<SimplePage> getHomePage() {
 
return SimplePage.class; // return default page
}
 
@Override
protected void init() {
 
super.init();
addComponentInstantiationListener(new SpringComponentInjector(this));
 
}
 
}
Now, you can inject Spring bean into Wicket component via @SpringBean.
Is it helpful? Yes No

Most helpful rated by users:

©2020 WithoutBook