[Javalist] resteasy

András Csányi sayusi.ando at gmail.com
2011. Dec. 23., P, 15:03:21 CET


2011/12/23 Böszörményi Péter <zmblevlist at gmail.com>:
> Csak hogy meglegyen egy resteasy-s megoldas is:
> web.xml
>
> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
>        <servlet>
>                <servlet-name>Resteasy</servlet-name>
>
>  <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
>        </servlet>
>
>
>        <context-param>
>                <param-name>resteasy.scan</param-name>
>                <param-value>true</param-value>
>        </context-param>
>
>  <servlet-mapping>
>                <servlet-name>Resteasy</servlet-name>
>                <url-pattern>/*</url-pattern>
>        </servlet-mapping>
>
> </web-app>
>
> java kod:
> package test;
>
> import javax.ws.rs.GET;
> import javax.ws.rs.Path;
>
>
> @Path("resource")
> public class TestResource {
>
>        @GET
>        public String foo() {
>                return "E!";
>        }
> }
>
> Ez nekem stock jboss 6.1-al mukodik.

Ennek nagyon örülök! :) Ellenben én felrobbanok az idegtől! A doksi
azt mondja, hogy "You can use it with EJB and CDI and you can rely
completely on JBoss for scanning for your JAX-RS services and
deploying them. All you have to provide is your JAX-RS service classes
packaged within a WAR either as POJOs, CDI beans, or EJBs and provide
an empty web.xml file as follows: "
(http://docs.jboss.org/resteasy/docs/2.3.0.GA/userguide/html_single/index.html#d0e219)

Amiben az utolsó mondat a lényeges, hogy üres web.xml fájl, amiben
legyen benne az, mai a tied elején is van. Vagy én nem tudok már
angolul?

-- 
- -
--  Csanyi Andras (Sayusi Ando)  -- http://sayusi.hu --
http://facebook.com/andras.csanyi
--  ""Trust in God and keep your gunpowder dry!" - Cromwell


További információk a(z) Javalist levelezőlistáról