来自Grails的原子馈送
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了来自Grails的原子馈送相关的知识,希望对你有一定的参考价值。
Here's a quick block of code that adds a valid Atom feed to you Grails application. Validate here: http://feedvalidator.org/check?url=http://aboutgroovy.com/item/atom
params.order = 'desc' <title type="text">aboutGroovy.com</title> <link rel="alternate" type="text/html" href="http://aboutGroovy.com"/> <link rel="self" type="application/atom+xml" href="http://aboutGroovy.com/item/atom"/> <updated>2006-12-17T18:30:02Z</updated> <author><name>Scott Davis</name></author> <id>tag:aboutgroovy.com,2006-12-18:thisIsUnique</id> <generator uri="http://aboutGroovy.com" version="0.0.1">Hand-rolled Grails code</generator> """ x.entry(xmlns:"http://www.w3.org/2005/Atom"){ author{name("Scott Davis")} published(df.format(item.datePosted)) updated(df.format(item.datePosted)) link(href:"http://aboutGroovy.com/item/show/${item.id}", rel:"alternate", title:item.title, type:"text/html") id("tag:aboutgroovy.com,2006:/item/show/${item.id}") title(type:"text", item.title) content(type:"xhtml"){ div(xmlns:"http://www.w3.org/1999/xhtml"){ p("Category: ${item.type}") p{a(href:item.url, "Original Source")} p(item.shortDescription) p(item.description) } } } } response.setContentType("application/atom+xml") render "${feedHeader}${feed}${feedFooter}" }
以上是关于来自Grails的原子馈送的主要内容,如果未能解决你的问题,请参考以下文章