Twitter allows access to a user account through an OAuth workflow; from our web application, the user is redirected to a Twitter page to authorize the Twitter application in order to access his/her account. The user is then redirected back to our web application. In this recipe, we'll implement this OAuth workflow.
You need an existing Twitter application. Refer to the Creating a Twitter application recipe.
We will use a JSP, so make sure that the Maven dependency for JSTL is declared in your pom.xml
file and the corresponding ViewResolver
bean is declared in your Spring configuration class. For more details, refer to the Using a JSP view recipe in Chapter 3, Using Controllers and Views.