Spring Security with Wicket – basic database authentication
Our aim is to do a simple basic authentication on the Wicket application. I want a login dialog to pop-up when we access the URL of the Wicket application. On success it should get redirected to the home page. We need to add Spring Security dependencies to the pom.xml
file and rebuild the Wicket application. The next step will be configuring the spring listener in the web.xml
file. We also need to add the applicationContext.xml
file.
Getting ready
Update the
pom.xml
file with Spring dependency.Create an
applicationContext.xml
file. It's mandatory to name it asapplicationContext
or else we will get error messages in the console.Edit the
web.xml
with Spring listeners.Create a
database-details.xml
file and add the database details.Add the
db-details.xml
file ascontext-param
to the spring listener.
How to do it...
The following are the steps for implementing Spring Security with Wicket to demonstrate basic authentication where credentials...