Hey there,
I have a problem figuring out how I can send a tweet from my webapp after the oauth.
My callback is working and starts the controller:
@RequestMapping(value = “about/callback”, method = { RequestMethod.GET, RequestMethod.POST })
public ModelAndView twitterTest(
ModelMap model,
Locale locale,
@ModelAttribute(AbstractNavigationController.NAVIGATION) Navigation navigation,
HttpServletRequest request) {
TwitterUtils twitter = new TwitterUtils(myAccessToken);
String verifier = request.getParameter("oauth_verifier");
twitter4j.User user = twitter.verify(verifier);
ModelAndView twitModel = new ModelAndView("twittertest");
twitModel.addObject("verified_user", user.getName());
twitModel.addObject("user_id", user.getId());
return twitModel;
}
That’s working perfectly and after the return the “twittertest.jsp” is displayed.
The URL is then something like this: “http://127.0.0.1:8080/webapp/about/callback?oauth_token=xxxxxxx&oauth_verifier=xxxxxx”
On my twittertest.jsp I now have a inputfield and a submit-button:
<label for="tweet">Tweet here:</label>
<input id="tweet" name="tweet" type="text" />
<input type="submit" class="button" value="Tweet" />
How can I now “transfer” the text from the input field and my “user_id” from the twitModel to a controller to send a tweet?
Thanks in advance.