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:org.ucll.ip.spring_ip_project.controller.TankController.java

@RequestMapping(method = RequestMethod.POST, value = "/{id}/delete")
public String delete(@PathVariable long id, HttpServletRequest request) {
    if (request.getParameter("submit").equals("Sure") || request.getParameter("submit").equals("Zeker")) {
        system.removeTank(id);/* w ww.  java  2 s.  c  o  m*/
        return "redirect:/player.htm";
    }
    return "redirect:/player.htm";
}

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

@RequestMapping(value = "/deleteMedicine", method = RequestMethod.GET)
public String deleteEmployee(HttpServletRequest request) {
    String medicineID = request.getParameter("medicineID");
    Long id = Long.parseLong(medicineID);
    service.deleteMedicine(id);/*from   www .j  av a  2s.c o  m*/
    return "Medicine record deleted";
}

From source file:com.glaf.dts.web.springmvc.MxDtsTaskController.java

@RequestMapping
public ModelAndView list(HttpServletRequest request, ModelMap modelMap) {
    String jx_view = request.getParameter("jx_view");
    RequestUtils.setRequestParameterToAttribute(request);
    if (StringUtils.isNotEmpty(jx_view)) {
        return new ModelAndView(jx_view, modelMap);
    }/*from w w  w  . ja va 2  s .  c o  m*/

    String x_view = ViewProperties.getString("dts_task.list");
    if (StringUtils.isNotEmpty(x_view)) {
        return new ModelAndView(x_view, modelMap);
    }
    return new ModelAndView("/bi/dts/task/list", modelMap);
}

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

@RequestMapping(value = "save", method = RequestMethod.POST)
public String save(@ModelAttribute(value = "eventlist") EventList eventList,
        @Context HttpServletRequest request) {
    if (request.getParameter("id") != null && !request.getParameter("id").isEmpty()) {
        eventList.setId(Integer.parseInt(request.getParameter("id")));
        eventList.setModifiedDate(new Date(Calendar.getInstance().getTimeInMillis()));
        eventListService.update(eventList);
    } else {//from  w  ww . java  2  s. c om
        eventListService.insert(eventList);
    }
    return "redirect:/eventlist/index";
}

From source file:com.MyHistory.Controller.EquipoController.java

@RequestMapping(value = "/ResultadoRegistroEquipo", method = RequestMethod.GET)
public ModelAndView resultadoRegistrarEquipo(HttpServletRequest pRequest) {
    String respuesta = pRequest.getParameter("respuesta");
    ModelAndView mv = new ModelAndView();
    mv.addObject("respuesta", respuesta);
    mv.setViewName("ResultadoRegistro");
    return mv;//from   w w w .j  a  v  a2 s  .c o m
}

From source file:com.opencart.controller.CategoryController.java

@RequestMapping(value = "/category/delete", method = RequestMethod.GET)
public ModelAndView deleteCategory(HttpServletRequest request) {
    int id = Integer.parseInt(request.getParameter("id").toString());
    categoryService.delete(id);/*from   w w w  .j  a va  2  s.  c o m*/
    List<Category> categories = categoryService.list();
    return new ModelAndView("admin/category", "categories", categories);
}

From source file:za.ac.cput.project.universalhardwarestore.api.UsersPage.java

@RequestMapping(value = "/saveuser", method = RequestMethod.GET)
public String SaveUsers(HttpServletRequest request) {

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

    System.out.print(username);//w w w .  ja  v a  2s  .c o m
    System.out.print(password);
    System.out.print(status);

    return service.saveUsers(username, password, status);
}

From source file:com.netsteadfast.greenstep.util.SimpleUtils.java

public static String getHttpRequestUrl(HttpServletRequest request) {
    StringBuilder url = new StringBuilder();
    url.append(request.getRequestURL().toString());
    Enumeration<String> paramNames = request.getParameterNames();
    for (int i = 0; paramNames.hasMoreElements(); i++) {
        String paramName = paramNames.nextElement();
        if (i == 0) {
            url.append("?");
        } else {//from w ww  .j  ava  2s . c om
            url.append("&");
        }
        url.append(paramName).append("=").append(request.getParameter(paramName));
    }
    return url.toString();
}

From source file:com.yahoo.dba.perf.myperf.springmvc.HelpController.java

@Override
protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse resp)
        throws Exception {

    String key = req.getParameter("key");
    if (key == null || key.trim().length() == 0)
        key = "about";
    ModelAndView mv = new ModelAndView("help/" + key);
    return mv;/*www  . ja  v a2s. co  m*/

}

From source file:core.controller.DepartemenController.java

@RequestMapping(method = RequestMethod.POST, value = "/insert")
public String insert(HttpServletRequest request) {
    String kode = request.getParameter("txtKode");
    String nama = request.getParameter("txtNama");
    Departemen dep = new Departemen();
    dep.setKode(kode);//from w  w  w.j a  v a  2 s  . c o m
    dep.setNama(nama);
    departemenDAO.insert(dep);
    return "redirect:/departemen";
}