Skip to content
Browse files

Trying Solder. Doesn't work.

  • Loading branch information...
1 parent d568274 commit 61d4ecbbbf6c03b7c0acac7d344120e1f80787fb @ceefour ceefour committed Mar 30, 2012
View
9 ear/.settings/org.eclipse.wst.common.component
@@ -18,5 +18,14 @@
<dependent-module archiveName="soluvas-jaxrs-1.0.0-SNAPSHOT.jar" deploy-path="/lib/" handle="module:/resource/soluvas-jaxrs/soluvas-jaxrs">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="solder-impl-3.1.0.Final.jar" deploy-path="/lib/" handle="module:/classpath/var/M2_REPO/org/jboss/solder/solder-impl/3.1.0.Final/solder-impl-3.1.0.Final.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="solder-api-3.1.0.Final.jar" deploy-path="/lib/" handle="module:/classpath/var/M2_REPO/org/jboss/solder/solder-api/3.1.0.Final/solder-api-3.1.0.Final.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="solder-logging-3.1.0.Final.jar" deploy-path="/lib/" handle="module:/classpath/var/M2_REPO/org/jboss/solder/solder-logging/3.1.0.Final/solder-logging-3.1.0.Final.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
</wb-module>
</project-modules>
View
3 ear/src/main/resources/ear-sample.properties
@@ -0,0 +1,3 @@
+here=is
+configuration=for
+the=webapps
View
7 parent/pom.xml
@@ -37,6 +37,13 @@
<dependencyManagement>
<dependencies>
<dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-bom</artifactId>
+ <version>3.1.0.Final</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>2.0.0.Final</version>
View
5 rs/pom.xml
@@ -22,6 +22,11 @@
<artifactId>soluvas-jaxrs</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.solder</groupId>
+ <artifactId>solder-impl</artifactId>
+ </dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
View
13 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<Article> getIndex() {
ArrayList<Article> articles = new ArrayList<Article>();
@@ -22,4 +28,11 @@
"Makin bagus dan selalu mantab gan.", "Cinta Sejati"));
return articles;
}
+
+ @GET @Produces(MediaType.APPLICATION_JSON)
+ @Path("props")
+ public Properties getProps() {
+ return props;
+ }
+
}

0 comments on commit 61d4ecb

Please sign in to comment.
Something went wrong with that request. Please try again.