本文整理了Java中org.apache.wicket.Request
类的一些代码示例,展示了Request
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request
类的具体详情如下:
包路径:org.apache.wicket.Request
类名称:Request
[英]Base class for page request implementations allowing access to request parameters. A Request has a URL and a parameter map. You can retrieve the URL of the request with getURL(). The entire parameter map can be retrieved via getParameterMap(). Individual parameters can be retrieved via getParameter(String). If multiple values are available for a given parameter, they can be retrieved via getParameters(String).
[中]允许访问请求参数的页面请求实现的基类。请求有一个URL和一个参数映射。可以使用getURL()检索请求的URL。可以通过getParameterMap()检索整个参数映射。可以通过getParameter(字符串)检索单个参数。如果给定参数有多个值可用,则可以通过getParameters(String)检索这些值。
代码示例来源:origin: org.wicketstuff/jquery
@Override protected void respond(AjaxRequestTarget target) {
Request req = RequestCycle.get().getRequest();
onCropped(target, Integer.parseInt(req.getParameter("width")), Integer.parseInt(req.getParameter("height")),
Integer.parseInt(req.getParameter("top").replace("px", "")), Integer.parseInt(req.getParameter("left").replace("px", "")));
}
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
/**
* @see org.apache.wicket.Request#getRelativePathPrefixToContextRoot()
*/
@Override
public String getRelativePathPrefixToContextRoot()
{
return request.getRelativePathPrefixToContextRoot();
}
代码示例来源:origin: org.onehippo.cms7/hippo-cms-xinha-integration
protected Map<String, String> getParameters() {
Request request = RequestCycle.get().getRequest();
HashMap<String, String> p = new HashMap<String, String>();
Map<String, ?> requestParams = request.getRequestParameters().getParameters();
for (String key : requestParams.keySet()) {
if (key.startsWith(AbstractXinhaPlugin.XINHA_PARAM_PREFIX)) {
p.put(key.substring(AbstractXinhaPlugin.XINHA_PARAM_PREFIX.length()), request.getParameter(key));
}
}
return p;
}
代码示例来源:origin: org.wicketstuff/minis
final String pathInfo = getRequestPath(request);
parameters.setPath(pathInfo);
parameters.setPageMapName(request.getParameter(PAGEMAP));
addInterfaceParameters(request, parameters);
addBookmarkablePageParameters(request, parameters);
addResourceParameters(request, parameters);
if (request.getParameter(IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null)
Map<String, String[]> map = request.getParameterMap();
Iterator<String> iterator = map.keySet().iterator();
parameters.setQueryString(request.getQueryString());
return parameters;
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
/**
* @see org.apache.wicket.request.IRequestCodingStrategy#decode(org.apache.wicket.Request)
*/
public final RequestParameters decode(final Request request)
{
final RequestParameters parameters = new RequestParameters();
final String pathInfo = getRequestPath(request);
parameters.setPath(pathInfo);
parameters.setPageMapName(request.getParameter(PAGEMAP));
addInterfaceParameters(request, parameters);
addBookmarkablePageParameters(request, parameters);
addResourceParameters(request, parameters);
if (request.getParameter(IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null)
{
parameters.setOnlyProcessIfPathActive(true);
}
Map map = request.getParameterMap();
Iterator iterator = map.keySet().iterator();
while (iterator.hasNext())
{
String key = (String)iterator.next();
if (key.startsWith(NAME_SPACE))
{
iterator.remove();
}
}
parameters.setParameters(map);
return parameters;
}
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
/**
* @return Any query parameters associated with the request for this resource
*/
protected ValueMap getParameters()
{
if (parameters.get() == null)
{
return new ValueMap(RequestCycle.get().getRequest().getRequestParameters()
.getParameters());
}
return (ValueMap)parameters.get();
}
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
.getRelativePathPrefixToContextRoot() +
redirectUrl.substring(1));
.getRelativePathPrefixToWicketHandler() +
redirectUrl);
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
/**
* @see org.apache.wicket.Request#getPath()
*/
public String getPath()
{
return realRequest.getPath();
}
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
/**
* Redirects to intercept page using the page map for the current request
*
* @param interceptPageClass
* The intercept page class to redirect to
*/
private void redirectToInterceptPage(final Class interceptPageClass)
{
final RequestCycle cycle = RequestCycle.get();
final Page requestPage = cycle.getRequest().getPage();
/*
* requestPage can be null if we throw the restart response exception before any page is
* instantiated in user's session. if this happens we switch to the pagemap of the request.
*/
final IPageMap pageMap;
if (requestPage != null)
{
pageMap = requestPage.getPageMap();
}
else
{
RequestParameters parameters = cycle.getRequest().getRequestParameters();
pageMap = PageMap.forName(parameters.getPageMapName());
}
pageMap.redirectToInterceptPage(interceptPageClass);
}
}
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
parameterMap = this.request.getParameterMap();
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
/**
* Gets the request parameters for this component as strings.
*
* @return The values in the request for this component
*/
public String[] getInputAsArray()
{
String[] values = getRequest().getParameters(getInputName());
if (!isInputNullable())
{
if (values != null && values.length == 1 && values[0] == null)
{
// we the key got passed in (otherwise values would be null),
// but the value was set to null.
// As the servlet spec isn't clear on what to do with 'empty'
// request values - most return an empty string, but some null -
// we have to workaround here and deliberately set to an empty
// string if the the component is not nullable (text components)
return EMPTY_STRING_ARRAY;
}
}
return values;
}
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
final String pathInfo = getRequestPath(request);
parameters.setPath(pathInfo);
parameters.setPageMapName(request.getParameter(PAGEMAP));
addInterfaceParameters(request, parameters);
addBookmarkablePageParameters(request, parameters);
addResourceParameters(request, parameters);
if (request.getParameter(IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME) != null)
Map<String, String[]> map = request.getParameterMap();
Iterator<String> iterator = map.keySet().iterator();
parameters.setQueryString(request.getQueryString());
return parameters;
代码示例来源:origin: org.onehippo.cms7/hippo-cms-yui
@SuppressWarnings("unchecked")
@Override
protected void respond(final AjaxRequestTarget target) {
if (!lookupDropBehavior()) {
return;
}
final IModel draggedModel = getDragModel();
if (draggedModel == null) {
return;
}
final String targetId = getComponent().getRequest().getParameter("targetId");
final Map<String, String[]> parameters = getComponent().getRequest().getParameterMap();
getComponent().getPage().visitChildren(new DropPointVisitor() {
@Override
void visit(DropBehavior dropPoint) {
if (dropPoint.getComponentMarkupId().equals(targetId)) {
dropPoint.onDrop(draggedModel, parameters, target);
}
}
});
}
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
/**
* @return Any query parameters associated with the request for this resource
*/
protected ValueMap getParameters()
{
if (parameters.get() == null)
{
return new ValueMap(RequestCycle.get()
.getRequest()
.getRequestParameters()
.getParameters());
}
return (ValueMap)parameters.get();
}
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
/**
* @see org.apache.wicket.Request#getPath()
*/
public String getPath()
{
// Hasn't changed. We only encoded the querystring
return request.getPath();
}
代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service
final Page requestPage = cycle.getRequest().getPage();
RequestParameters parameters = cycle.getRequest().getRequestParameters();
pageMap = PageMap.forName(parameters.getPageMapName());
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
parameterMap = this.request.getParameterMap();
代码示例来源:origin: org.apache.wicket/com.springsource.org.apache.wicket
/**
* Gets the request parameters for this component as strings.
*
* @return The values in the request for this component
*/
public String[] getInputAsArray()
{
String[] values = getRequest().getParameters(getInputName());
if (!isInputNullable())
{
if (values != null && values.length == 1 && values[0] == null)
{
// we the key got passed in (otherwise values would be null),
// but the value was set to null.
// As the servlet spec isn't clear on what to do with 'empty'
// request values - most return an empty string, but some null -
// we have to workaround here and deliberately set to an empty
// string if the the component is not nullable (text components)
return EMPTY_STRING_ARRAY;
}
}
return values;
}
代码示例来源:origin: org.wicketstuff/datatable-autocomplete
public boolean validate(Request request, AjaxRequestTarget target) {
String value = request.getParameter(callbackName);
return validator.validate (value, target);
}
代码示例来源:origin: org.wicketstuff/jquery
@Override
public final void respond(AjaxRequestTarget target) {
try {
Request req = RequestCycle.get().getRequest();
if (logger().isDebugEnabled()) {
logger().debug("params : {}", req.getRequestParameters());
}
onDnD(target,
//req.getParameter("itemId"),
req.getParameter("srcContainerId"),
Integer.parseInt(req.getParameter("srcPosition")),
req.getParameter("destContainerId"),
Integer.parseInt(req.getParameter("destPosition"))
);
} catch (RuntimeException exc) {
throw exc;
} catch (Exception exc) {
throw new RuntimeException("wrap: " + exc.getMessage(), exc);
}
}
内容来源于网络,如有侵权,请联系作者删除!