开发者

Dynamic Sitemap in Java EE app

Is it possible to create a dynamic sitemap in a Java EE app? I'm using GWT and glassfish, but I doubt that matters.

The URLs I want to add are in this form: site.com/article/id/title-of-article

The best I think up with was to make a servlet and map it with *sitemap.xml, a开发者_运维知识库nd have that create the XML for the sitemap. Is there a better way?


I've done the same thing... exactly as you described. The fact that it's Java EE is really beside the point. It's really the framework you're using (Spring MVC/Struts/custom) and how it maps views to URLs. If it's REST style URLs as you stated, then it should be a pretty straight forward implementation generating XML from the servlet. Be sure to use a streaming writer (StAX?) to keep your heap usage down.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜