mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-06 10:42:33 +00:00
ant format seems to have reformated these differently than what is in CVS
This commit is contained in:
parent
2786312b8e
commit
a09f2a4c18
@ -48,8 +48,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
|
|||||||
//~ Instance fields ========================================================
|
//~ Instance fields ========================================================
|
||||||
|
|
||||||
private HttpSession session;
|
private HttpSession session;
|
||||||
private Map paramMap = new HashMap();
|
|
||||||
private Map headersMap = new HashMap();
|
private Map headersMap = new HashMap();
|
||||||
|
private Map paramMap = new HashMap();
|
||||||
private Principal principal;
|
private Principal principal;
|
||||||
private String contextPath = "";
|
private String contextPath = "";
|
||||||
private String queryString = null;
|
private String queryString = null;
|
||||||
@ -66,16 +66,17 @@ public class MockHttpServletRequest implements HttpServletRequest {
|
|||||||
this.queryString = queryString;
|
this.queryString = queryString;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MockHttpServletRequest() {
|
public MockHttpServletRequest(Map headers, Principal principal,
|
||||||
super();
|
HttpSession session) {
|
||||||
}
|
|
||||||
|
|
||||||
public MockHttpServletRequest(Map headers, Principal principal, HttpSession session) {
|
|
||||||
this.headersMap = headers;
|
this.headersMap = headers;
|
||||||
this.principal = principal;
|
this.principal = principal;
|
||||||
this.session = session;
|
this.session = session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private MockHttpServletRequest() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
//~ Methods ================================================================
|
//~ Methods ================================================================
|
||||||
|
|
||||||
public void setAttribute(String arg0, Object arg1) {
|
public void setAttribute(String arg0, Object arg1) {
|
||||||
|
@ -25,8 +25,8 @@ import net.sf.acegisecurity.SecurityConfig;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests parts of {@link RegExpBasedFilterInvocationDefinitionMap} not tested by {@link
|
* Tests parts of {@link RegExpBasedFilterInvocationDefinitionMap} not tested
|
||||||
* FilterInvocationDefinitionSourceEditorTests}.
|
* by {@link FilterInvocationDefinitionSourceEditorTests}.
|
||||||
*
|
*
|
||||||
* @author Ben Alex
|
* @author Ben Alex
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
package sample.contact;
|
package sample.contact;
|
||||||
|
|
||||||
import net.sf.acegisecurity.Authentication;
|
import net.sf.acegisecurity.Authentication;
|
||||||
import net.sf.acegisecurity.GrantedAuthority;
|
|
||||||
import net.sf.acegisecurity.AuthenticationCredentialsNotFoundException;
|
import net.sf.acegisecurity.AuthenticationCredentialsNotFoundException;
|
||||||
|
import net.sf.acegisecurity.GrantedAuthority;
|
||||||
import net.sf.acegisecurity.context.ContextHolder;
|
import net.sf.acegisecurity.context.ContextHolder;
|
||||||
import net.sf.acegisecurity.context.SecureContext;
|
import net.sf.acegisecurity.context.SecureContext;
|
||||||
|
|
||||||
@ -67,10 +67,11 @@ public class SecureIndexController implements Controller, InitializingBean {
|
|||||||
public ModelAndView handleRequest(HttpServletRequest request,
|
public ModelAndView handleRequest(HttpServletRequest request,
|
||||||
HttpServletResponse response) throws ServletException, IOException {
|
HttpServletResponse response) throws ServletException, IOException {
|
||||||
SecureContext secureContext = ((SecureContext) ContextHolder.getContext());
|
SecureContext secureContext = ((SecureContext) ContextHolder.getContext());
|
||||||
|
|
||||||
if (null == secureContext) {
|
if (null == secureContext) {
|
||||||
throw new AuthenticationCredentialsNotFoundException(
|
throw new AuthenticationCredentialsNotFoundException(
|
||||||
"Authentication credentials were not found in the " +
|
"Authentication credentials were not found in the "
|
||||||
"SecureContext");
|
+ "SecureContext");
|
||||||
}
|
}
|
||||||
|
|
||||||
final Authentication currentUser = secureContext.getAuthentication();
|
final Authentication currentUser = secureContext.getAuthentication();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user