Example usage for javax.servlet.http HttpServletRequest getQueryString

List of usage examples for javax.servlet.http HttpServletRequest getQueryString

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getQueryString.

Prototype

public String getQueryString();

Source Link

Document

Returns the query string that is contained in the request URL after the path.

Usage

From source file:com.abc.turkey.web.unfreeze.UnfreezeController.java

@RequestMapping(value = "/cap_union_getsig_new")
public void getNewSig(HttpServletRequest request, HttpServletResponse response) {
    String url = captcha_prefix + "cap_union_getsig_new?" + request.getQueryString();
    HttpGet httpGet = new HttpGet(url);
    try {//from   w w w. j a  v a  2s. com
        CloseableHttpResponse response2 = httpClient.execute(httpGet);
        response2.getEntity().writeTo(response.getOutputStream());
        response2.close();
    } catch (Exception e) {
        throw new ServiceException(e.getMessage(), e.getCause());
    }
}

From source file:com.abc.turkey.web.unfreeze.UnfreezeController.java

@RequestMapping(value = "/cap_union_verify_new")
public void capVerify(HttpServletRequest request, HttpServletResponse response) {
    String url = captcha_prefix + "cap_union_verify_new?" + request.getQueryString();
    HttpGet httpGet = new HttpGet(url);
    try {//from  w w w .j av  a2s .com
        CloseableHttpResponse response2 = httpClient.execute(httpGet);
        response2.getEntity().writeTo(response.getOutputStream());
        response2.close();
    } catch (Exception e) {
        throw new ServiceException(e.getMessage(), e.getCause());
    }
}

From source file:com.sun.socialsite.web.filters.RedirectorFilter.java

private String getUrlAndQueryString(HttpServletRequest httpReq) {
    String uri = httpReq.getRequestURI();
    String query = httpReq.getQueryString();
    return (uri + ((query != null) ? ("?" + query) : ""));
}

From source file:net.groupbuy.plugin.yeepay.YeepayPlugin.java

@Override
public String getNotifyMessage(String sn, NotifyMethod notifyMethod, HttpServletRequest request) {
    if ("2".equals(WebUtils.getParameter(request.getQueryString(), "GBK", "r9_BType"))) {
        return "success";
    }//  w  w w.j  av a 2s  .c o  m
    return null;
}

From source file:com.lucidworks.security.authentication.server.PseudoAuthenticationHandler.java

private String getUserName(HttpServletRequest request) {
    List<NameValuePair> list = URLEncodedUtils.parse(request.getQueryString(), UTF8_CHARSET);
    if (list != null) {
        for (NameValuePair nv : list) {
            if (PseudoAuthenticator.USER_NAME.equals(nv.getName())) {
                return nv.getValue();
            }//  w  w  w  . j  av  a2 s  .c  o m
        }
    }
    return null;
}

From source file:com.xhsoft.framework.common.interceptor.AccessInterceptor.java

/**
 * <p>Description:??????</p>
 * @param entRegNO   //from  w  w  w.  ja  v  a  2s.  com
 * @param proptity   
 * @return String
 * @author wenzhi
 * @version 1.0
 * @exception Exception
 */
public String intercept(ActionInvocation invocation) throws Exception {
    logger.debug("start access privilege check...");
    HttpServletRequest request = ServletActionContext.getRequest();
    String uri = request.getServletPath();
    String url = uri;
    String queryString = request.getQueryString();

    if (StringUtils.isNotEmpty(queryString)) {
        url = uri + "?" + queryString;
    }
    logger.debug(url);
    if (url.startsWith("/admin/purview/userinfo/login.action")
            || url.startsWith("/admin/purview/userinfo/logout.action")) {
        logger.debug("login/logout request,pass request");
        return invocation.invoke();
    } else {
        /*if (!LoginUtil.isLogin(request,"login")) {//?   
           logger.debug("not login request uri=" + url);
           logger.debug("not login access,take to login tip page");
           return "invalidLogin";
        }else {
           *//**???*//*
                                                                logger.debug("have login access,pass request");
                                                                return invocation.invoke();
                                                                }*/

        return invocation.invoke();
    }
}

From source file:com.abc.turkey.web.unfreeze.UnfreezeController.java

@RequestMapping(value = "/cap_union_getcapbysig_new")
public void getCaptchaImage(HttpServletRequest request, HttpServletResponse response) {
    String url = captcha_prefix + "cap_union_getcapbysig_new?" + request.getQueryString();
    HttpGet httpGet = new HttpGet(url);
    try {/* w  ww  .  ja  va2  s  . c  om*/
        CloseableHttpResponse response2 = httpClient.execute(httpGet);
        response2.getEntity().writeTo(response.getOutputStream());
        response2.close();
    } catch (Exception e) {
        throw new ServiceException(e.getMessage(), e.getCause());
    }
}

From source file:org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler.java

private String getUserName(HttpServletRequest request) {
    String queryString = request.getQueryString();
    if (queryString == null || queryString.length() == 0) {
        return null;
    }//w ww .  jav  a 2 s.co m
    List<NameValuePair> list = URLEncodedUtils.parse(queryString, UTF8_CHARSET);
    if (list != null) {
        for (NameValuePair nv : list) {
            if (PseudoAuthenticator.USER_NAME.equals(nv.getName())) {
                return nv.getValue();
            }
        }
    }
    return null;
}

From source file:com.amazon.dtasdk.v2.signature.Request.java

private String getFullURL(HttpServletRequest request) {
    StringBuffer requestURL = request.getRequestURL();
    String queryString = request.getQueryString();

    if (StringUtils.isEmpty(queryString)) {
        return requestURL.toString();
    } else {/*from w  ww .  j  a va2s  . c o m*/
        return requestURL.append('?').append(queryString).toString();
    }
}

From source file:MyServlet.java

public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();

    out.println("Query String:");
    out.println(req.getQueryString());
    out.println();//from w ww.  j a v  a2  s .  c om

    out.println("Request Parameters:");
    Enumeration e = req.getParameterNames();
    while (e.hasMoreElements()) {
        String name = (String) e.nextElement();
        String values[] = req.getParameterValues(name);
        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                out.println(name + " (" + i + "): " + values[i]);
            }
        }
    }
}