how can i override functions ( create, delete, modify, etc ) of crudify class ( scala with lift )
as above a title
i use the lift ( scala ) with jetty web server
开发者_如何转开发i wanted to develop rest api . as fast as possible.
so i extended crudify ( trait )
finally , i can get results that are html web pages
now..
i want to get form that is json or xml format
i don't need html code.
i just want format of json or xml.
how can i modify this source code extending crudify
may be . i think that overriding some functions of crudify.
thanks in advance
Crudify is not the right solution for a REST API. You should have a look at the REST Web Services page in the Lift wiki. To create XML documents automatically, maybe you should have a look at JAXB.
Like the answer above CRUDify is for HTML not for JSON nor XML. To represent your mapper object as a xml or json use: toXml and asJs functions. The other way you have to add parse functions that convert values posted by user into mapper objects.
精彩评论