Zjednodušení URL a vyřazení nadbytečné závislosti na knihovně.
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon Apr 05 19:08:52 2010 +0200 (2010-04-05)
changeset 88a5339bcce9a2
parent 87 27ddd3691997
child 89 59ba044de164
Zjednodušení URL a vyřazení nadbytečné závislosti na knihovně.
java/nekurak.net-rest/nbproject/genfiles.properties
java/nekurak.net-rest/nbproject/project.properties
java/nekurak.net-rest/nbproject/project.xml
java/nekurak.net-rest/src/java/cz/frantovo/nekurak/rest/ClankyREST.java
java/nekurak.net-rest/web/WEB-INF/web.xml
     1.1 --- a/java/nekurak.net-rest/nbproject/genfiles.properties	Mon Apr 05 18:44:10 2010 +0200
     1.2 +++ b/java/nekurak.net-rest/nbproject/genfiles.properties	Mon Apr 05 19:08:52 2010 +0200
     1.3 @@ -1,9 +1,9 @@
     1.4 -build.xml.data.CRC32=8f44a4ef
     1.5 +build.xml.data.CRC32=27a024ad
     1.6  build.xml.script.CRC32=fb1b7f84
     1.7  build.xml.stylesheet.CRC32=c0ebde35@1.21.2.1
     1.8  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     1.9  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    1.10 -nbproject/build-impl.xml.data.CRC32=8f44a4ef
    1.11 +nbproject/build-impl.xml.data.CRC32=27a024ad
    1.12  nbproject/build-impl.xml.script.CRC32=f658df40
    1.13  nbproject/build-impl.xml.stylesheet.CRC32=b139b33b@1.21.2.1
    1.14  nbproject/rest-build.xml.data.CRC32=d32e8880
     2.1 --- a/java/nekurak.net-rest/nbproject/project.properties	Mon Apr 05 18:44:10 2010 +0200
     2.2 +++ b/java/nekurak.net-rest/nbproject/project.properties	Mon Apr 05 19:08:52 2010 +0200
     2.3 @@ -26,8 +26,7 @@
     2.4  j2ee.platform=1.6-web
     2.5  j2ee.server.type=gfv3ee6
     2.6  jar.compress=false
     2.7 -javac.classpath=\
     2.8 -    ${libs.restlib_gfv3ee6.classpath}
     2.9 +javac.classpath=
    2.10  # Space-separated list of extra javac options
    2.11  javac.compilerargs=
    2.12  javac.debug=true
     3.1 --- a/java/nekurak.net-rest/nbproject/project.xml	Mon Apr 05 18:44:10 2010 +0200
     3.2 +++ b/java/nekurak.net-rest/nbproject/project.xml	Mon Apr 05 19:08:52 2010 +0200
     3.3 @@ -10,11 +10,7 @@
     3.4          <data xmlns="http://www.netbeans.org/ns/web-project/3">
     3.5              <name>nekurak.net-rest</name>
     3.6              <minimum-ant-version>1.6.5</minimum-ant-version>
     3.7 -            <web-module-libraries>
     3.8 -                <library dirs="200">
     3.9 -                    <file>${libs.restlib_gfv3ee6.classpath}</file>
    3.10 -                </library>
    3.11 -            </web-module-libraries>
    3.12 +            <web-module-libraries/>
    3.13              <web-module-additional-libraries/>
    3.14              <source-roots>
    3.15                  <root id="src.dir"/>
     4.1 --- a/java/nekurak.net-rest/src/java/cz/frantovo/nekurak/rest/ClankyREST.java	Mon Apr 05 18:44:10 2010 +0200
     4.2 +++ b/java/nekurak.net-rest/src/java/cz/frantovo/nekurak/rest/ClankyREST.java	Mon Apr 05 19:08:52 2010 +0200
     4.3 @@ -4,6 +4,7 @@
     4.4  import javax.ws.rs.GET;
     4.5  import javax.ws.rs.PUT;
     4.6  import javax.ws.rs.Path;
     4.7 +import javax.ws.rs.PathParam;
     4.8  import javax.ws.rs.Produces;
     4.9  
    4.10  @Path("clanek")
    4.11 @@ -18,9 +19,10 @@
    4.12      private static String data;
    4.13  
    4.14      @GET
    4.15 +    @Path("/{id}")
    4.16      @Produces("text/plain")
    4.17 -    public String getText() {
    4.18 -	return "Naposledy sem někdo poslal:\n" + data + "\n";
    4.19 +    public String getText(@PathParam("id") int id) {
    4.20 +	return "Naposledy sem někdo poslal:\n" + data + "\n" + id + "\n" ;
    4.21      }
    4.22  
    4.23      @PUT
     5.1 --- a/java/nekurak.net-rest/web/WEB-INF/web.xml	Mon Apr 05 18:44:10 2010 +0200
     5.2 +++ b/java/nekurak.net-rest/web/WEB-INF/web.xml	Mon Apr 05 19:08:52 2010 +0200
     5.3 @@ -1,13 +1,13 @@
     5.4  <?xml version="1.0" encoding="UTF-8"?>
     5.5  <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">
     5.6      <servlet>
     5.7 -	<servlet-name>ServletAdaptor</servlet-name>
     5.8 +	<servlet-name>REST</servlet-name>
     5.9  	<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    5.10  	<load-on-startup>1</load-on-startup>
    5.11      </servlet>
    5.12      <servlet-mapping>
    5.13 -	<servlet-name>ServletAdaptor</servlet-name>
    5.14 -	<url-pattern>/zdroje/*</url-pattern>
    5.15 +	<servlet-name>REST</servlet-name>
    5.16 +	<url-pattern>/*</url-pattern>
    5.17      </servlet-mapping>
    5.18      <session-config>
    5.19  	<session-timeout>