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:info.jtrac.web.DefaultMultiActionController.java

public ModelAndView itemViewHandler(HttpServletRequest request, HttpServletResponse response) {
    String itemId = request.getParameter("itemId");
    return new ModelAndView("redirect:/app/item/" + itemId);
}

From source file:it.cilea.osd.jdyna.controller.TabController.java

@Override
protected ModelAndView handleDelete(HttpServletRequest request) {

    String tabId = request.getParameter("id");
    Integer paramIntegerId = Integer.parseInt(tabId);
    getApplicationService().decoupleEditTabByDisplayTab(paramIntegerId, editTabClass);
    return super.handleDelete(request);

}

From source file:org.mobile.mpos.action.user.HtmlController.java

/**
 * ???//w ww  .j  ava  2s.com
 *
 * @param request
 * @return
 */
@RequestMapping(Mapping.INTERFACE_URL_SHOWHTML)
public ModelAndView showHtml(HttpServletRequest request) {
    String name = request.getParameter("html");
    log.info("request html:/html/" + name);
    ModelAndView html = new ModelAndView("/html/" + name);
    return html;
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.vendors.VendorHelper.java

/**
 * Save the request parameters from the Basic Info page
 *///from   w ww  .  j  a v  a 2s  .  c  om
public static Rating saveRating(Rating rating, HttpServletRequest request, String userId, Task task)
        throws EnvoyServletException {
    String rate = (String) request.getParameter("ratingField");
    String comment = (String) request.getParameter("comment");
    if (rating == null) {
        rating = new Rating(Integer.parseInt(rate), userId, comment, task);
    } else {
        // if there is a task being used - must refresh it
        // and mark it and the rating as editable/clones.
        // otherwise the change will be made on the one copy in
        // the main cache. need to make the change out of the
        // cache and the commit will merge the copies.
        if (task != null) {
            try {
                // refresh it and clone it
                task = ServerProxy.getTaskManager().getTask(task.getId(), true);
                List ratings = task.getRatings();
                // refresh the rating
                rating = (Rating) ratings.get(ratings.indexOf(rating));
            } catch (Exception e) {
                throw new EnvoyServletException(e);
            }
        }
        rating.updateRating(Integer.parseInt(rate), comment, userId);
    }
    return rating;
}

From source file:com.globalsight.everest.webapp.pagehandler.administration.vendors.VendorHelper.java

/**
 * Save the request parameters from the Security page
 *//*from  www.  ja va  2 s. c o  m*/
public static void saveSecurity(FieldSecurity fs, HttpServletRequest request) throws EnvoyServletException {
    try {
        fs.put(VendorSecureFields.FIRST_NAME, request.getParameter("firstName"));
        fs.put(VendorSecureFields.LAST_NAME, request.getParameter("lastName"));
        fs.put(VendorSecureFields.TITLE, request.getParameter("title"));
        fs.put(VendorSecureFields.IS_INTERNAL, request.getParameter("isInternal"));
        fs.put(VendorSecureFields.COMPANY, request.getParameter("companyName"));
        fs.put(VendorSecureFields.NOTES, request.getParameter("notes"));
        fs.put(VendorSecureFields.AMBASSADOR_ACCESS, request.getParameter("useInAmbassador"));
        fs.put(VendorSecureFields.STATUS, request.getParameter("status"));
        fs.put(VendorSecureFields.USERNAME, request.getParameter("userName"));
        fs.put(VendorSecureFields.CUSTOM_ID, request.getParameter("customVendorId"));
        fs.put(VendorSecureFields.PASSWORD, request.getParameter("password"));
        fs.put(VendorSecureFields.CITIZENSHIP, request.getParameter("countries"));
        fs.put(VendorSecureFields.DOB, request.getParameter("dateOfBirth"));
        fs.put(VendorSecureFields.ROLES, request.getParameter("roles"));
        fs.put(VendorSecureFields.ADDRESS, request.getParameter("address"));
        fs.put(VendorSecureFields.COUNTRY, request.getParameter("country"));
        fs.put(VendorSecureFields.HOME_PHONE, request.getParameter("homePhone"));
        fs.put(VendorSecureFields.WORK_PHONE, request.getParameter("workPhone"));
        fs.put(VendorSecureFields.CELL_PHONE, request.getParameter("cellPhone"));
        fs.put(VendorSecureFields.FAX, request.getParameter("fax"));
        fs.put(VendorSecureFields.EMAIL, request.getParameter("email"));
        fs.put(VendorSecureFields.EMAIL_LANGUAGE, request.getParameter("emailLanguage"));
        fs.put(VendorSecureFields.RESUME, request.getParameter("resume"));
        fs.put(VendorSecureFields.PROJECTS, request.getParameter("projects"));
        fs.put(VendorSecureFields.CUSTOM_FIELDS, request.getParameter("customForm"));

    } catch (Exception e) {
        throw new EnvoyServletException(e);
    }
}

From source file:com.yahoo.glimmer.web.FormatParameterToViewNameTranslator.java

/**
 * Takes the named parameter from the request and returns the value appended with namePostfix.
 * If no parameter of the name is in the request a default of defaultValue is used.
 */// w w w.j  a  v a 2s. co  m
@Override
public String getViewName(HttpServletRequest request) throws Exception {
    String format = request.getParameter(parameterName);
    if (format == null) {
        format = defaultValue;
    }
    return format + namePostfix;
}

From source file:org.ucll.ip.spring_ip_project.controller.PlayerController.java

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

From source file:com.apress.progwt.server.web.filters.GWTExtendedAuthenticationProcessingFilter.java

/**
 * if there's a special gwt property, use the GWT target. Otherwise
 * just call super().//w w w. java2  s .c o  m
 */
@Override
protected String determineTargetUrl(HttpServletRequest request) {

    String gwt = request.getParameter("gwt");
    if (gwt != null) {
        return gwtLoginTargetURL;
    }

    return super.determineTargetUrl(request);
}

From source file:com.sishuok.chapter3.web.controller.chat.ChatController.java

@RequestMapping(params = "command=poll")
@ResponseBody//from   www .j  a v  a 2 s . c  o  m
public DeferredResult<String> poll(HttpServletRequest req) {
    String username = req.getParameter("username");
    if (username == null) {
        username = (String) req.getSession().getAttribute("username");
    }

    if (username != null) {
        return msgPublisher.startAsync(username);
    }
    throw new IllegalStateException("??");
}

From source file:com.stormpath.tutorial.controller.HelloController.java

@RequestMapping("/")
String home(HttpServletRequest req, Model model) {
    model.addAttribute("status", req.getParameter("status"));
    return "home";
}