Example usage for javax.servlet.http HttpServletRequest setAttribute

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

Introduction

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

Prototype

public void setAttribute(String name, Object o);

Source Link

Document

Stores an attribute in this request.

Usage

From source file:net.sourceforge.fenixedu.presentationTier.Action.teacher.executionCourse.EvaluationMethodDA.java

public ActionForward prepareImportEvaluationMethod(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response) {

    request.setAttribute("importContentBean", new ImportContentBean());
    return forward(request, "/teacher/executionCourse/importEvaluationMethod.jsp");
}

From source file:by.creepid.jsf.fileupload.UploadFilter.java

private void processFileField(FileItem fileField, HttpServletRequest request) {
    request.setAttribute(fileField.getFieldName(), fileField);
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.manager.ViewPersonsWithRoleDA.java

@EntryPoint
public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    request.setAttribute("roles", Bennu.getInstance().getRolesSet());
    return mapping.findForward("SelectRole");
}

From source file:org.shredzone.cilla.view.HeaderView.java

/**
 * Shows a list of all published headers.
 *//*  w  ww .  jav  a 2  s .c  o  m*/
@Framed
@View(pattern = "/header/index.html")
public String headerListView(HttpServletRequest req) throws ViewException {
    req.setAttribute("heads", headerService.getVisibleHeaders());
    return "view/headerList.jsp";
}

From source file:com.example.getstarted.basicactions.CreateBookServlet.java

@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    req.setAttribute("action", "Add"); // Part of the Header in form.jsp
    req.setAttribute("destination", "create"); // The urlPattern to invoke (this Servlet)
    req.setAttribute("page", "form"); // Tells base.jsp to include form.jsp
    req.getRequestDispatcher("/base.jsp").forward(req, resp);
}

From source file:gov.nih.nci.cabig.caaers.web.admin.AbstractDeviceTab.java

@Override
public void postProcess(HttpServletRequest request, DeviceCommand command, Errors errors) {
    super.postProcess(request, command, errors);
    request.setAttribute("flashMessage", getMessage("MSG_DEVICE.saved", null, Locale.getDefault()));
    if (request.getParameter(AbstractAjaxFacade.AJAX_REQUEST) != null)
        return;/*from  ww  w. jav a 2s. c  o m*/
}

From source file:com.zuoxiaolong.blog.common.web.AbstractController.java

/**
 * ? HttpServletRequest /* ww  w. j  a  v a  2s  .  c o m*/
 * @param name ??
 * @param value 
 */
protected void setRequestAttribute(String name, Object value) {
    HttpServletRequest request = this.getRequest();
    request.setAttribute(name, value);
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.commons.ChooseMasterDegreeToSelectCandidatesDA.java

public ActionForward chooseMasterDegree(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    request.setAttribute("jspTitle", getFromRequest("jspTitle", request));
    request.setAttribute("executionYear", getFromRequest("executionYear", request));
    request.setAttribute("degree", getFromRequest("degree", request));
    return mapping.findForward("ChooseSuccess");
}

From source file:io.github.benas.todolist.web.servlet.user.account.ChangePasswordServlet.java

private void addGlobalChangePasswordErrorAttribute(HttpServletRequest request) {
    request.setAttribute("error", resourceBundle.getString("account.password.error.global"));
}

From source file:alluxio.web.WebInterfaceConfigurationServlet.java

/**
 * Populates attributes before redirecting to a jsp.
 *
 * @param request The {@link HttpServletRequest} object
 * @param response The {@link HttpServletResponse} object
 * @throws ServletException if the target resource throws this exception
 * @throws IOException if the target resource throws this exception
 *///from  w  w  w. ja  v a  2 s.  c  o  m
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    request.setAttribute("whitelist", mFsMaster.getWhiteList());
    request.setAttribute("configuration", getSortedProperties());

    getServletContext().getRequestDispatcher("/configuration.jsp").forward(request, response);
}