开发者

user friendly urls in j2ee application

I want to develop a forum application using jsp, servlets.Now i want to have user friendly url to each post eg

http://stackoverflow.com/questions/5509365/associating-a-dojoattachpoint-to-a-div-create-dynamicallycaly

and I dont want to use something like that

 http://stackoverflow.com/post=1234

How can i have such user friendl开发者_开发知识库y urls.


I guess you are looking for Representational State Transfer (REST)


you need to use a technology named URL Rewrite, usually people put a nginx in front of tomcat, so the nginx get the request:

http://stackoverflow.com/questions/5509365/associating-a-dojoattachpoint-to-a-div-create-dynamicallycaly`

and nginx forward a url to tomcat which tomcat can understand:

http://stackoverflow.com/questions?id=5509365


or if you want pure java solution, then take a look at:

http://code.google.com/p/urlrewritefilter/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜