Hi Evgeny,
In SVN trunk (pre-2.0 M5), this part of ServerResource has been refactored
for simplification. The getVariants() method now returns a modifiable list
of variants, by default based on annotated methods. It can be easily
customized:
So, now if you don't use annotated methods, you need to override:
@Override
protected void doInit() {
getVariants().add(new Variant(MediaType.TEXT_HTML));
}
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com
-----Message d'origine-----
De : news [mailto:[email protected]] De la part de Evgeny Shepelyuk
Envoyé : lundi 31 août 2009 11:01
À : [email protected]
Objet : ServerResource - set avaialable variants
Hello,
It's not quite clear how to set available media types to my resource
implemented with ServerResource.
Before in init() method i didi following
>> getVariants().add(new Variant(MediaType.TEXT_HTML));
How to handle the same with new ServerResource class ?
--
Regards,
Evgeny Shepelyuk
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=23888
02
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2401058