This commit is contained in:
eugenp 2014-02-21 18:48:07 +01:00
commit 528ef210e4
5 changed files with 8 additions and 7 deletions

View File

@ -4,6 +4,7 @@ import java.io.IOException;
import org.junit.Test;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -16,6 +17,8 @@ public class SandboxTest {
testElement.setX(10);
testElement.setY("adasd");
final ObjectMapper om = new ObjectMapper();
om.setVisibilityChecker(om.getSerializationConfig().getDefaultVisibilityChecker().withFieldVisibility(JsonAutoDetect.Visibility.ANY).withGetterVisibility(JsonAutoDetect.Visibility.NONE));
final String serialized = om.writeValueAsString(testElement);
System.err.println(serialized);
}

View File

@ -1,13 +1,10 @@
package org.baeldung.jackson.sandbox;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class TestElement {
int x;
@JsonIgnore
private String y;
private transient String y;
public int getX() {
return x;

View File

@ -2,6 +2,6 @@
## Spring Security for REST Example Project
### Relevant Articles:
- [Spring Security Authentication Provider](http://www.baeldung.com/spring-security-authentication-provider)
- [Retrieve User Information in Spring Security](http://www.baeldung.com/get-user-in-spring-security)

View File

@ -196,7 +196,7 @@
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
<scope>test</scope>
</dependency>

View File

@ -10,12 +10,13 @@
<http use-expressions="true" entry-point-ref="restAuthenticationEntryPoint">
<intercept-url pattern="/api/**" access="isAuthenticated()" />
<sec:form-login authentication-success-handler-ref="mySuccessHandler" />
<sec:form-login authentication-success-handler-ref="mySuccessHandler" authentication-failure-handler-ref="myFailureHandler" />
<logout />
</http>
<beans:bean id="mySuccessHandler" class="org.baeldung.security.MySavedRequestAwareAuthenticationSuccessHandler" />
<beans:bean id="myFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler" />
<authentication-manager alias="authenticationManager">
<authentication-provider>