if jaxrs produce html. can it render in velocity?

so the pojo mapped there

like struts2 did

Frans Thamura
Meruvian
On Aug 25, 2012 4:00 AM, "Martin Gainty" <mgai...@hotmail.com> wrote:

>
> I guess Im not understanding where the default response of json is
> specified from the resteasy-jaxrs if you specify
> @Produces("text/html")
> your function will output HTML
>
> as far as Produces.java
> public @interface Produces
> {
>    /**
>     * A list of media types. Each entry may specify a single type or
> consist
>     * of a comma separated list of types. E.g. {"image/jpeg,image/gif",
>     * "image/png"}. Use of the comma-separated form allows definition of a
>     * common string constant for use on multiple targets.
>     */
>    String[] value() default "*/*";
> }
>
> your testcases will use any one of the enumerated MediaType specifically
> ProxyBuilder.build serverMediaType can be TEXT_HTML
>
>         String url = TestPortProvider.generateURL("/");   //anyone landing
> on Root gets our attention
>         Foo foo = ProxyBuilder.build(Foo.class,
> url).serverMediaType(MediaType.TEXT_HTML).now();
>
> MediaTypes can be
>
>  public final static String WILDCARD = "*/*";
>    public final static String APPLICATION_XML = "application/xml";
>    public final static String APPLICATION_ATOM_XML =
> "application/atom+xml";
>    public final static String APPLICATION_XHTML_XML =
> "application/xhtml+xml";
>    public final static String APPLICATION_SVG_XML = "application/svg+xml";
>    public final static String APPLICATION_JSON = "application/json";
>  //one of many but NOT the default
>    public final static String APPLICATION_FORM_URLENCODED =
> "application-x-www-form-urlencoded";
>    public final static String MULTIPART_FORM_DATA = "multipart/form-data";
>    public final static String APPLICATION_OCTET_STREAM =
> "application/octet-stream";
>    public final static String TEXT_PLAIN = "text/plain";
>    public final static String TEXT_XML = "text/xml";
>    public final static String TEXT_HTML = "text/html";
>
> Im not understanding your statement that resteasy-jaxrs will output only
> application/json..could you elaborate where the output default is set?
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
> .
> > Date: Fri, 24 Aug 2012 09:46:22 +0700
> > Subject: RE: Q: S2 REST vs JAXRS or S2-JAX-RS plugins
> > From: fr...@meruvian.org
> > To: user@struts.apache.org
> >
> > we use resteasy also here
> >
> > but we still develop with html output
> >
> > result to html from action with rest url naming
> >
> > resteasy is different approach, output only json.
> >
> > we use the same Service for both.
> >
> > and want a smiliar url for rest
> > On Aug 24, 2012 9:22 AM, "Martin Gainty" <mgai...@hotmail.com> wrote:
> >
> > >
> > > Frans
> > >
> > > grab what you need from
> > > https://resteasy.svn.sourceforge.net/svnroot/resteasy/trunk/jaxrs
> > > cd jaxrs-api
> > > mvn -e -X compile
> > > mvn -e -X package
> > > mvn -e -X install:install-file
> > > mvn -e -X deploy:deploy-file
> > >
> > > add the dependency to your dependencies list
> > > <dependencies>
> > > <dependency>
> > >     <groupId>org.jboss.resteasy</groupId>
> > >     <artifactId>jaxrs-api</artifactId>
> > >     <version>2.3.4.Final</version>
> > > </dependency>
> > > ....
> > >
> > > then annotate your code.. resteasy-jaxrs provides you these annotations
> > >     @Path("/")        //javax.ws.rs.Path
> > >     @GET               //javax.ws.rs.GET
> > >     @Produces("application/json")    //javax.ws.rs.Produces
> > >
> > > anything missing?
> > > Martin
> > > ______________________________________________
> > > Verzicht und Vertraulichkeitanmerkung/Note de déni et de
> confidentialité
> > >
> > > Diese Nachricht ist vertraulich.  Sie nicht der vorgesehene Empfaenger
> > > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> > > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
> Nachricht
> > > dient lediglich dem Austausch von Informationen und entfaltet keine
> > > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> > > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > > Ce message est confidentiel et peut être privilégié. Si vous n'êtes
> pas le
> > > destinataire prévu, nous te demandons avec bonté que pour satisfaire
> > > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie
> > > de ceci est interdite. Ce message sert à l'information seulement et
> n'aura
> > > pas n'importe quel effet légalement obligatoire. Étant donné que les
> email
> > > peuvent facilement être sujets à la manipulation, nous ne pouvons
> accepter
> > > aucune responsabilité pour le contenu fourni.
> > >
> > >
> > > > Date: Fri, 24 Aug 2012 03:17:05 +0700
> > > > Subject: Re: Q: S2 REST vs JAXRS or S2-JAX-RS plugins
> > > > From: fr...@meruvian.org
> > > > To: user@struts.apache.org
> > > >
> > > > any idea to use resteasy with s2?
> > > >
> > > > esp to use the url pattern of rest (blabla/blabla) with Action
> > > > On Aug 23, 2012 12:53 PM, "Lukasz Lenart" <lukaszlen...@apache.org>
> > > wrote:
> > > >
> > > > > But I think you can always use RESTeasy and get the same value
> without
> > > > > needs for custom plugin. I don't see a point to have another JAX-RS
> > > > > implementation on the market.
> > > > >
> > > > >
> > > > > Regards
> > > > > --
> > > > > Łukasz
> > > > > + 48 606 323 122 http://www.lenart.org.pl/
> > > > >
> > > > >
> > > > > 2012/8/21 Frans Thamura <fr...@meruvian.org>:
> > > > > > yes
> > > > > >
> > > > > > righr now the syntax is @result and @action
> > > > > >
> > > > > > i think if we have more like @get etc
> > > > > >
> > > > > > that make it more powerfull
> > > > > >
> > > > > > On Aug 22, 2012 3:01 AM, "Łukasz Lenart" <
> lukasz.len...@gmail.com>
> > > > > wrote:
> > > > > >>
> > > > > >> Hi,
> > > > > >>
> > > > > >> I'm not sure if I understand, you just want implement JAX-RS as
> a
> > > > > >> Struts 2 plugin ?
> > > > > >>
> > > > > >>
> > > > > >> Regards
> > > > > >> --
> > > > > >> Łukasz
> > > > > >> mobile +48 606 323 122 http://www.lenart.org.pl/
> > > > > >> Warszawa JUG conference - Confitura http://confitura.pl/
> > > > > >>
> > > > > >>
> > > ---------------------------------------------------------------------
> > > > > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > > > >> For additional commands, e-mail: user-h...@struts.apache.org
> > > > > >>
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > > > For additional commands, e-mail: user-h...@struts.apache.org
> > > > >
> > > > >
> > >
>

Reply via email to