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:net.sourceforge.fenixedu.presentationTier.Action.coordinator.CandidacyFilterBean.java

public void setFromRequest(HttpServletRequest request) {
    String filter = request.getParameter("filter");
    if (filter != null) {
        try {/* www  . ja v a  2 s .  c  o m*/
            CandidacyAttributionType status = CandidacyAttributionType.valueOf(filter);
            setStatus(status);
        } catch (IllegalArgumentException iae) {
        }
    }
}

From source file:com.iflytek.edu.cloud.frame.spring.rest.ServiceMethodRequestCondition.java

@Override
public ServiceMethodRequestCondition getMatchingCondition(HttpServletRequest request) {
    String _method = request.getParameter(Constants.SYS_PARAM_KEY_METHOD);
    String _version = request.getParameter(Constants.SYS_PARAM_KEY_VERSION);
    return new ServiceMethodRequestCondition(_method, _version);
}

From source file:com.swcguild.luckysevensmvc.TipCalculatorController.java

@RequestMapping(value = "payCheck", method = RequestMethod.POST)
public String payCheck(HttpServletRequest req, Model model) {

    String billAmountString = req.getParameter("billAmount");
    String perCentTipString = req.getParameter("perCentTip");

    Double billAmountDouble = Double.parseDouble(billAmountString);
    Double perCentTipDouble = Double.parseDouble(perCentTipString);

    Double totalTip = perCentTipDouble / 100 * billAmountDouble;

    Double totalBill = billAmountDouble + totalTip;

    model.addAttribute("totalTip", totalTip);
    model.addAttribute("totalBill", totalBill);
    return "tipCalculatorResult";
}

From source file:core.controller.KategoriController.java

@RequestMapping(value = "/delete", method = RequestMethod.GET)
public String delete(HttpServletRequest request) {
    long id = Long.valueOf(request.getParameter("id"));
    kategoriDAO.delete(kategoriDAO.getById(id));
    return "redirect:/kategori";
}

From source file:com.lcw.one.modules.sys.web.TagController.java

/**
 * treeselect.tag//from   www.  jav  a  2  s  . com
 */
@RequiresUser
@RequestMapping("treeselect")
public String treeselect(HttpServletRequest request, Model model) {
    model.addAttribute("url", request.getParameter("url")); // ?URL
    model.addAttribute("extId", request.getParameter("extId")); // ?ID
    model.addAttribute("checked", request.getParameter("checked")); // ???
    model.addAttribute("selectIds", request.getParameter("selectIds")); // ID
    model.addAttribute("module", request.getParameter("module")); // ?CMSCategory
    return "modules/sys/tagTreeselect";
}

From source file:com.leapfrog.lfaeventmanager.admin.controller.BookingController.java

@RequestMapping(value = "save", method = RequestMethod.POST)
public String save(@ModelAttribute(value = "booking") Booking booking, @Context HttpServletRequest request) {
    if (request.getParameter("id") != null && !request.getParameter("id").isEmpty()) {
        booking.setId(Integer.parseInt(request.getParameter("id")));
        bookingService.update(booking);/*  w w w.  j a va2 s.  co  m*/
    } else {
        bookingService.insert(booking);
    }
    return "redirect:/booking/index";
}

From source file:edu.ijse.tcd.controller.LogInController.java

@RequestMapping(value = "addLogIn", method = RequestMethod.POST)
public String addLogIn(ModelMap map, HttpServletRequest request) {

    String username = request.getParameter("username");
    String password = request.getParameter("password");

    User user = signInService.getUser(username, password);

    if (null != user) {
        HttpSession hs = request.getSession();
        hs.setAttribute("user", user);
        return "adminPannel";
    } else {/*from   ww w . jav  a 2 s. com*/
        return "login";
    }
}

From source file:za.ac.cput.project.hospitalmanagement.api.MedicineApi.java

@RequestMapping(value = "/getMedicineDetails", method = RequestMethod.GET)
public Medicine getMedicineDetails(HttpServletRequest request) {
    String medicineID = request.getParameter("medicineID");
    Long id = Long.parseLong(medicineID);
    return service.getMedicine(id);
}

From source file:com.glaf.core.web.springmvc.MxSystemMailConfigController.java

@RequestMapping("/save")
public ModelAndView save(ModelMap modelMap, HttpServletRequest request) {
    String jx_view = request.getParameter("jx_view");

    if (StringUtils.isNotEmpty(jx_view)) {
        return new ModelAndView(jx_view, modelMap);
    }/*  w w w  . ja  va 2  s.  co m*/

    String x_view = ViewProperties.getString("sys_mail.save");
    if (StringUtils.isNotEmpty(x_view)) {
        return new ModelAndView(x_view, modelMap);
    }

    return new ModelAndView("/modules/sys/mail/save", modelMap);

}

From source file:org.stockwatcher.web.BaseController.java

protected String getRequestParameter(HttpServletRequest request, String name) {
    String parameter = request.getParameter(name);
    if (parameter == null || parameter.length() == 0) {
        throw new IllegalArgumentException(parameter + " parameter is null or zero length");
    }/*w  w  w . j a  v a  2 s . c o  m*/
    return parameter;
}