Re: [JSP ] Twitter4J怎麼用?
推
12/07 11:09,
12/07 11:09
→
12/07 11:10,
12/07 11:10
→
12/07 15:21,
12/07 15:21
→
12/07 15:52,
12/07 15:52
請參考sign-in-with-twitter範例
https://github.com/yusuke/sign-in-with-twitter
檔案:sign-in-with-twitter/src/main/webapp/index.jsp
<tag:loggedin>
<h1>Welcome ${twitter.screenName} (${twitter.id})</h1>
<form action="./post" method="post">
<textarea cols="80" rows="2" name="text"></textarea>
<input type="submit" name="post" value="update"/>
</form>
<a href="./logout">logout</a>
</tag:loggedin>
上面紅色標示的地方即為twitter id
這個index.jsp有用到Tag File與EL,對剛接觸JSP的朋友應該稍微有點吃力
Scriptlet的版本請參考 https://gist.github.com/4232986
附帶一提,這個範例在session的處理上沒有做得很好
如果連 http://localhost/sign-in-with-twitter/index.jsp 發生Exception時
請改連 http://localhost/sign-in-with-twitter/signin
若是signin也發生錯誤時,請檢查consumerKey、consumerSecret與callback網址
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.193.183.7
推
12/10 10:46, , 1F
12/10 10:46, 1F
推
12/10 11:30, , 2F
12/10 11:30, 2F
推
12/11 10:28, , 3F
12/11 10:28, 3F
→
12/11 10:55, , 4F
12/11 10:55, 4F
→
12/11 10:58, , 5F
12/11 10:58, 5F
→
12/11 11:01, , 6F
12/11 11:01, 6F
→
12/11 12:08, , 7F
12/11 12:08, 7F
推
12/11 13:48, , 8F
12/11 13:48, 8F
推
12/12 10:31, , 9F
12/12 10:31, 9F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 4 之 4 篇):