Example usage for javax.servlet.http HttpServletRequest getParameter

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

Introduction

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

Prototype

public String getParameter(String name);

Source Link

Document

Returns the value of a request parameter as a String, or null if the parameter does not exist.

Usage

From source file:com.controlj.addon.weather.service.WeatherServiceUIBase.java

public static WeatherServices getSpecifiedService(HttpServletRequest req) {
    WeatherServices result = null;/*from  w  w  w  .  j  ava 2s .c om*/

    String serviceParam = req.getParameter("service");
    if (serviceParam != null) {
        try {
            result = WeatherServices.valueOf(WeatherServices.class, serviceParam);
        } catch (IllegalArgumentException e) {
            Logging.println("Invalid service name of '" + serviceParam + "' provided");
        }
    }
    return result;
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.coordinator.SearchDegreeLogAction.java

private static String newFindDegreeCurricularPlanID(HttpServletRequest request) {
    String degreeCurricularPlanID = request.getParameter("degreeCurricularPlanID");
    if (degreeCurricularPlanID == null) {
        degreeCurricularPlanID = (String) request.getAttribute("degreeCurricularPlanID");
    }/*from  w  w  w  .ja v a 2 s. co  m*/
    return degreeCurricularPlanID;
}

From source file:com.apress.progwt.server.web.controllers.ControllerUtil.java

/**
 * /*w ww.j  a va 2s.com*/
 * @param req
 * @param userService
 * @return
 */
public static Map<String, Object> getDefaultModel(HttpServletRequest req, UserService userService) {
    Map<String, Object> model = new HashMap<String, Object>();

    User su = null;
    model.put("message", req.getParameter("message"));
    try {
        su = userService.getCurrentUser();
        model.put("user", su);
    } catch (UsernameNotFoundException e) {
        // log.debug("No user logged in.");
    }

    if (req != null) {
        // IE < 7 check. used in common.ftl PNGImage
        String userAgent = req.getHeader("User-Agent");
        if (userAgent != null && userAgent.contains("MSIE") && !userAgent.contains("MSIE 7")) {
            model.put("iePre7", true);
        }
    }

    return model;
}

From source file:com.astamuse.asta4d.web.dispatch.RedirectUtil.java

public static void restoreFlashScopeData(HttpServletRequest request) {
    String flashScopeId = request.getParameter(RedirectUtil.KEY_FLASH_SCOPE_ID);
    if (StringUtils.isEmpty(flashScopeId)) {
        return;//from   w w w .j a v  a2  s .co m
    } else {
        Map<String, Object> savedMap = WebApplicationConfiguration.getWebApplicationConfiguration()
                .getExpirableDataManager().get(flashScopeId, true);
        if (savedMap == null) {
            return;
        } else {
            WebApplicationContext context = WebApplicationContext.getCurrentThreadWebApplicationContext();
            for (Entry<String, Object> entry : savedMap.entrySet()) {
                context.setData(WebApplicationContext.SCOPE_FLASH, entry.getKey(), entry.getValue());
            }
            Map<String, RedirectInterceptor> interceptorMap = context.getData(WebApplicationContext.SCOPE_FLASH,
                    RedirectInterceptorMapKey);
            if (interceptorMap != null) {
                for (RedirectInterceptor interceptor : interceptorMap.values()) {
                    interceptor.afterRedirectDataRestore();
                }
            }
        }
    }

}

From source file:edu.cornell.mannlib.vitro.webapp.filters.ModelSwitcher.java

private static boolean isParameterPresent(HttpServletRequest req, String key) {
    return StringUtils.isNotEmpty(req.getParameter(key));
}

From source file:org.ow2.chameleon.fuchsia.push.base.hub.dto.SubscriptionConfirmationRequest.java

public static SubscriptionConfirmationRequest from(HttpServletRequest request)
        throws InvalidContentNotification {

    validateRequest(request);// w ww.ja v  a 2s . c o m

    return new SubscriptionConfirmationRequest(request.getParameter(HUB_MODE), request.getParameter(HUB_TOPIC),
            request.getParameter(HUB_CHALLENGE), request.getParameter(HUB_LEASE_SECONDS));

}

From source file:com.github.thorqin.webapi.oauth2.OAuthServer.java

public static String getResponseType(HttpServletRequest request) {
    return request.getParameter("response_type");
}

From source file:com.github.thorqin.webapi.oauth2.OAuthServer.java

public static String getGrantType(HttpServletRequest request) {
    return request.getParameter("grant_type");
}

From source file:de.thischwa.pmcms.server.ContextUtil.java

public static Class<?> getClass(HttpServletRequest req) {
    String pojoType = req.getParameter(Constants.LINK_TYPE_DESCRIPTOR);
    return getClass(pojoType);
}

From source file:de.thischwa.pmcms.server.ContextUtil.java

public static APoormansObject<?> getpo(HttpServletRequest req) {
    String idString = req.getParameter("id");
    return getpo(idString);
}