diff --git a/ear/.settings/org.eclipse.wst.common.component b/ear/.settings/org.eclipse.wst.common.component index 27ec86c..f8b4522 100644 --- a/ear/.settings/org.eclipse.wst.common.component +++ b/ear/.settings/org.eclipse.wst.common.component @@ -18,5 +18,14 @@ uses + + uses + + + uses + + + uses + diff --git a/ear/src/main/resources/ear-sample.properties b/ear/src/main/resources/ear-sample.properties new file mode 100644 index 0000000..a661cf1 --- /dev/null +++ b/ear/src/main/resources/ear-sample.properties @@ -0,0 +1,3 @@ +here=is +configuration=for +the=webapps diff --git a/parent/pom.xml b/parent/pom.xml index 5f1e8fa..7801b06 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -36,6 +36,13 @@ + + org.jboss.seam + seam-bom + 3.1.0.Final + import + pom + org.jboss.spec jboss-javaee-6.0 diff --git a/rs/pom.xml b/rs/pom.xml index cd4f935..012e50a 100644 --- a/rs/pom.xml +++ b/rs/pom.xml @@ -22,6 +22,11 @@ soluvas-jaxrs 1.0.0-SNAPSHOT + + + org.jboss.solder + solder-impl + joda-time joda-time diff --git a/rs/src/main/java/org/soluvas/earsample/rs/ArticleResource.java b/rs/src/main/java/org/soluvas/earsample/rs/ArticleResource.java index 2f3fb1f..c46fd7d 100644 --- a/rs/src/main/java/org/soluvas/earsample/rs/ArticleResource.java +++ b/rs/src/main/java/org/soluvas/earsample/rs/ArticleResource.java @@ -2,17 +2,23 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.Properties; +import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import org.jboss.solder.resourceLoader.Resource; import org.soluvas.earsample.data.Article; @Path("article") public class ArticleResource { + @Inject @Resource("ear-sample.properties") Properties props; + @GET @Produces(MediaType.APPLICATION_JSON) public List
getIndex() { ArrayList
articles = new ArrayList
(); @@ -22,4 +28,11 @@ public List
getIndex() { "Makin bagus dan selalu mantab gan.", "Cinta Sejati")); return articles; } + + @GET @Produces(MediaType.APPLICATION_JSON) + @Path("props") + public Properties getProps() { + return props; + } + }