本文整理汇总了Java中org.springframework.extensions.webscripts.servlet.WebScriptServletRequest类的典型用法代码示例。如果您正苦于以下问题:Java WebScriptServletRequest类的具体用法?Java WebScriptServletRequest怎么用?Java WebScriptServletRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebScriptServletRequest类属于org.springframework.extensions.webscripts.servlet包,在下文中一共展示了WebScriptServletRequest类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: create
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
@Override
public Authenticator create(WebScriptServletRequest req, WebScriptServletResponse res)
{
String runAsUser = AuthenticationUtil.getRunAsUser();
if (runAsUser == null)
{
runAsUser = AuthenticationUtil.getSystemUserName();
}
return new LocalTestRunAsAuthenticator(runAsUser);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:LocalTestRunAsAuthenticatorFactory.java
示例2: getStream
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
/**
* Returns the input stream for the request
* @param req WebScriptRequest
* @return InputStream
*/
private InputStream getStream(WebScriptRequest req)
{
try
{
if (req instanceof WebScriptServletRequest)
{
WebScriptServletRequest servletRequest = (WebScriptServletRequest) req;
return servletRequest.getHttpServletRequest().getInputStream();
}
else if (req instanceof WrappingWebScriptRequest)
{
// eg. BufferredRequest
WrappingWebScriptRequest wrappedRequest = (WrappingWebScriptRequest) req;
return wrappedRequest.getContent().getInputStream();
}
}
catch (IOException error)
{
logger.warn("Failed to get the input stream.", error);
}
return null;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:29,代码来源:ResourceWebScriptPut.java
示例3: create
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
@Override
public Authenticator create(WebScriptServletRequest req, WebScriptServletResponse res)
{
// Do we have current details?
if (AuthenticationUtil.getFullyAuthenticatedUser() != null)
{
// There are already details existing
// Allow these to be kept and used
String fullUser = AuthenticationUtil.getFullyAuthenticatedUser();
logger.debug("Existing Authentication found, remaining as " + fullUser);
return new LocalTestRunAsAuthenticator(fullUser);
}
// Fall back to the http auth one
logger.debug("No existing Authentication found, using regular HTTP Auth");
return httpAuthFactory.create(req, res);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:18,代码来源:LocalWebScriptConnectorServiceImpl.java
示例4: testLogInWithNonExistingPerson
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
@Test
public void testLogInWithNonExistingPerson()
{
// Random non existing person
final String username = GUID.generate();
// Mock a request with a username in the header
HttpServletRequest mockHttpRequest = mock(HttpServletRequest.class);
when(mockHttpRequest.getHeader("X-Alfresco-Remote-User")).thenReturn(username);
when(mockHttpRequest.getScheme()).thenReturn("http");
WebScriptServletRequest mockRequest = mock(WebScriptServletRequest.class);
when(mockRequest.getHttpServletRequest()).thenReturn(mockHttpRequest);
HttpServletResponse mockHttpResponse = mock(HttpServletResponse.class);
WebScriptServletResponse mockResponse = mock(WebScriptServletResponse.class);
when(mockResponse.getHttpServletResponse()).thenReturn(mockHttpResponse);
Authenticator authenticator = remoteUserAuthenticatorFactory.create(mockRequest, mockResponse);
assertTrue("The non existing user should be authenticated.", authenticator.authenticate(RequiredAuthentication.user, false));
assertTrue("The user should be auto created.", personService.personExists(username));
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:22,代码来源:RemoteAuthenticatorFactoryTest.java
示例5: invalidateSession
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
private void invalidateSession(WebScriptRequest req) {
if (!(req instanceof WebScriptServletRequest)) {
return;
}
WebScriptServletRequest request = (WebScriptServletRequest) req;
HttpServletRequest servletRequest = request.getHttpServletRequest();
HttpSession session = servletRequest.getSession(false);
if (session == null) {
return;
}
session.invalidate();
}
开发者ID:Redpill-Linpro,项目名称:alfresco-cluster-probe,代码行数:18,代码来源:AbstractProbe.java
示例6: BasicHttpAuthenticator
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
/**
* Construct
*
* @param req WebScriptServletRequest
* @param res WebScriptServletResponse
* @param listener AuthenticationListener
*/
public BasicHttpAuthenticator(WebScriptServletRequest req, WebScriptServletResponse res, AuthenticationListener listener)
{
this.servletReq = req;
this.servletRes = res;
HttpServletRequest httpReq = servletReq.getHttpServletRequest();
this.listener = listener;
this.authorization = httpReq.getHeader("Authorization");
this.ticket = httpReq.getParameter("alf_ticket");
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:BasicHttpAuthenticatorFactory.java
示例7: PublicApiAuthenticator
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
/**
* Construct
*
* @param req WebScriptServletRequest
* @param res WebScriptServletResponse
* @param proxyListener ProxyListener
*/
public PublicApiAuthenticator(WebScriptServletRequest req, WebScriptServletResponse res, ProxyListener proxyListener)
{
super(req, res, proxyListener);
if (!(req instanceof TenantWebScriptServletRequest))
{
throw new WebScriptException("Request is not a tenant aware request");
}
servletReq = (TenantWebScriptServletRequest)req;
this.proxyListener = proxyListener;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:18,代码来源:PublicApiAuthenticatorFactory.java
示例8: testEnabledUser
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
@Test
public void testEnabledUser() throws Exception
{
final String username = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<String>()
{
@Override
public String execute() throws Throwable
{
return AuthenticationUtil.runAs(new RunAsWork<String>()
{
@Override
public String doWork() throws Exception
{
return createPerson(true);
}
}, AuthenticationUtil.SYSTEM_USER_NAME);
}
}, false, true);
// Mock a request with a username in the header
HttpServletRequest mockHttpRequest = mock(HttpServletRequest.class);
when(mockHttpRequest.getHeader("X-Alfresco-Remote-User")).thenReturn(username);
when(mockHttpRequest.getScheme()).thenReturn("http");
WebScriptServletRequest mockRequest = mock(WebScriptServletRequest.class);
when(mockRequest.getHttpServletRequest()).thenReturn(mockHttpRequest);
HttpServletResponse mockHttpResponse = mock(HttpServletResponse.class);
WebScriptServletResponse mockResponse = mock(WebScriptServletResponse.class);
when(mockResponse.getHttpServletResponse()).thenReturn(mockHttpResponse);
Authenticator authenticator = remoteUserAuthenticatorFactory.create(mockRequest, mockResponse);
assertTrue(authenticator.authenticate(RequiredAuthentication.user, false));
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:34,代码来源:RemoteAuthenticatorFactoryTest.java
示例9: WebClientAuthenticator
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
/**
* Construct
*
* @param req WebScriptServletRequest
* @param res WebScriptServletResponse
*/
public WebClientAuthenticator(WebScriptServletRequest req, WebScriptServletResponse res)
{
this.servletReq = req;
this.servletRes = res;
this.ticket = req.getParameter("ticket");
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:14,代码来源:WebClientAuthenticatorFactory.java
示例10: create
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
public Authenticator create(WebScriptServletRequest req, WebScriptServletResponse res)
{
return new BasicHttpAuthenticator(req, res, listener);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:5,代码来源:BasicHttpAuthenticatorFactory.java
示例11: create
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
@Override
public Authenticator create(WebScriptServletRequest req, WebScriptServletResponse res)
{
return new RemoteUserAuthenticator(req, res, this.listener);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:6,代码来源:RemoteUserAuthenticatorFactory.java
示例12: RemoteUserAuthenticator
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
public RemoteUserAuthenticator(WebScriptServletRequest req, WebScriptServletResponse res, AuthenticationListener listener)
{
super(req, res, listener);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:5,代码来源:RemoteUserAuthenticatorFactory.java
示例13: create
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
public Authenticator create(WebScriptServletRequest req, WebScriptServletResponse res)
{
return new PublicApiAuthenticator(req, res, new ProxyListener());
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:5,代码来源:PublicApiAuthenticatorFactory.java
示例14: testDisabledUser
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
@Test
public void testDisabledUser() throws Exception
{
final String username = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<String>()
{
@Override
public String execute() throws Throwable
{
return AuthenticationUtil.runAs(new RunAsWork<String>()
{
@Override
public String doWork() throws Exception
{
return createPerson(false);
}
}, AuthenticationUtil.SYSTEM_USER_NAME);
}
}, false, true);
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Void>()
{
@Override
public Void execute() throws Throwable
{
return AuthenticationUtil.runAs(new RunAsWork<Void>()
{
@Override
public Void doWork() throws Exception
{
// Mock a request with a username in the header
HttpServletRequest mockHttpRequest = mock(HttpServletRequest.class);
when(mockHttpRequest.getHeader("X-Alfresco-Remote-User")).thenReturn(username);
when(mockHttpRequest.getScheme()).thenReturn("http");
WebScriptServletRequest mockRequest = mock(WebScriptServletRequest.class);
when(mockRequest.getHttpServletRequest()).thenReturn(mockHttpRequest);
HttpServletResponse mockHttpResponse = mock(HttpServletResponse.class);
WebScriptServletResponse mockResponse = mock(WebScriptServletResponse.class);
when(mockResponse.getHttpServletResponse()).thenReturn(mockHttpResponse);
Authenticator authenticator = remoteUserAuthenticatorFactory.create(mockRequest, mockResponse);
assertFalse(authenticator.authenticate(RequiredAuthentication.user, false));
return null;
}
}, AuthenticationUtil.SYSTEM_USER_NAME);
}
}, false, true);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:50,代码来源:RemoteAuthenticatorFactoryTest.java
示例15: create
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
public Authenticator create(WebScriptServletRequest req, WebScriptServletResponse res)
{
return new WebClientAuthenticator(req, res);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:5,代码来源:WebClientAuthenticatorFactory.java
示例16: WebscriptRequestWrapper
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
public WebscriptRequestWrapper(WebScriptServletRequest request) {
super(request.getHttpServletRequest());
this.origReq = request;
}
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:5,代码来源:DispatcherWebscript.java
示例17: getWebScriptServletRequest
import org.springframework.extensions.webscripts.servlet.WebScriptServletRequest; //导入依赖的package包/类
public WebScriptServletRequest getWebScriptServletRequest() {
return origReq;
}
开发者ID:dgradecak,项目名称:alfresco-mvc,代码行数:4,代码来源:DispatcherWebscript.java
注:本文中的org.springframework.extensions.webscripts.servlet.WebScriptServletRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论