Skip to content

Commit

Permalink
update versions, add bonecp profile and typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeurant committed Nov 4, 2014
1 parent 15d7e98 commit d0d143b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
21 changes: 6 additions & 15 deletions docs/spring/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pom.xml example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<version>3.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.7</source>
Expand All @@ -113,24 +113,15 @@ pom.xml example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.13.v20130916</version>
<configuration>
<!-- We use non NIO connector in order to avoid read only static files under windows -->
<connectors>
<connector implementation="org.eclipse.jetty.server.bio.SocketConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
<version>9.2.2.v20140723</version>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -177,15 +168,15 @@ RESThub dependencies are available on Maven Central:
Web application initializer replaces the old web.xml file used with Servlet 2.5 or older webapps.
It has the same goal, but since it is Java based, it is safer (compilation check, autocomplete).

WebAppInitializer.java example:
WebAppInitializer.java example with JPA support:

```java
public class WebAppInitializer implements WebApplicationInitializer {

@Override
public void onStartup(ServletContext servletContext) throws ServletException {
XmlWebApplicationContext appContext = new XmlWebApplicationContext();
appContext.getEnvironment().setActiveProfiles("resthub-jpa", "resthub-web-server");
appContext.getEnvironment().setActiveProfiles("resthub-jpa", "resthub-pool-bonecp", "resthub-web-server");
String[] locations = { "classpath*:resthubContext.xml", "classpath*:applicationContext.xml" };
appContext.setConfigLocations(locations);

Expand Down Expand Up @@ -219,7 +210,7 @@ appContext.getEnvironment().setActiveProfiles("resthub-mongodb", "resthub-web-se
In your tests, you should use the `@ActiveProfiles` annotation to activate the profiles you need:

```java
@ActiveProfiles("resthub-jpa") // or @ActiveProfiles({"resthub-jpa","resthub-web-server"})
@ActiveProfiles("resthub-jpa") // or @ActiveProfiles({"resthub-jpa", "resthub-pool-bonecp", "resthub-web-server"})
public class SampleTest extends AbstractTransactionalTest {

}
Expand Down
4 changes: 2 additions & 2 deletions docs/spring/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class SampleRestControllerTest extends AbstractWebTest {

public SampleRestControllerTest() {
// Call AbstractWebTest(String profiles) constructor
super("resthub-web-server,resthub-jpa");
super("resthub-web-server,resthub-jpa,resthub-pool-bonecp");
}

// Cleanup after each test
Expand Down Expand Up @@ -130,7 +130,7 @@ To use this phase, add the following snippet to your pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.15</version>
<version>2.16</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion docs/spring/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
XmlWebApplicationContext appContext = new XmlWebApplicationContext();
appContext.getEnvironment().setActiveProfiles("resthub-jpa", "resthub-web-server", "resthub-validation");
appContext.getEnvironment().setActiveProfiles("resthub-jpa", "resthub-pool-bonecp", "resthub-web-server", "resthub-validation");

...
}
Expand Down
2 changes: 2 additions & 0 deletions docs/spring/web-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ will serialize all properties. It also work on collection (`List<Book>` for exam

## Register Jackson Modules
Jackson allows to register modules to enhance its capabilities (e.g. JodaTime module). Resthub provides a simple mean to register modules to the Jackson object mapper in the spring context:

```xml
<bean id="jacksonModules" parent="resthubJacksonModules">
<property name="sourceList">
Expand All @@ -189,6 +190,7 @@ Jackson allows to register modules to enhance its capabilities (e.g. JodaTime mo
</property>
</bean>
```

Note that `parent="resthubJacksonModules"` is mandatory

<a name="modelmapper"></a>
Expand Down

0 comments on commit d0d143b

Please sign in to comment.