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:common.cms.controller.ACmsDelegate.java

public ModelAndView doUpdate(HttpServletRequest req, HttpServletResponse resp) {
    getCommonModel(req);/*  w  ww  .j  a  v a2 s .  co  m*/
    req.setAttribute("editForm_topHeader", "");

    if (CommonActions.doUpdate(updateService, config, updateValidator, req)) {
        req.setAttribute(config.getContentUrlAttribute(), config.getContentUpdateTemplate());
        return new ModelAndView(config.getTemplateUrl());
    } else {
        return doView(req, resp);
    }
}

From source file:org.extremesite.controller.AssemblerController.java

protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    ModelAndView mv = new ModelAndView(successView);
    Assembler assembler = new Assembler();
    Object viewData = assembler.getTable(null, request);
    request.setAttribute("assembler", viewData);
    return mv;//from   ww w  . j  a  v  a2  s . c o  m
}

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

@RequestMapping
public ModelAndView edit(HttpServletRequest request, ModelMap modelMap) {
    RequestUtils.setRequestParameterToAttribute(request);

    List<Dbid> rows = tableDataService.getAllDbids();
    request.setAttribute("rows", rows);

    String jx_view = request.getParameter("jx_view");

    if (StringUtils.isNotEmpty(jx_view)) {
        return new ModelAndView(jx_view, modelMap);
    }//from  w  ww.  j a va2s.c  om

    String x_view = ViewProperties.getString("sys_sequence.edit");
    if (StringUtils.isNotEmpty(x_view)) {
        return new ModelAndView(x_view, modelMap);
    }
    return new ModelAndView("/modules/sys/sequence/edit");
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.personnelSection.ManagePeople.java

public ActionForward invalid(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    InternalPersonBean bean = getRenderedObject();
    request.setAttribute("invitedPersonBean", bean);
    return mapping.findForward("createPersonFillInfo");
}

From source file:com.benfante.minimark.ajax.MonitoringABo.java

@RemoteMethod
public void refreshAllFillingsBlocks() throws IOException, ServletException {
    final Map<Course, List<AssessmentFilling>> courseFillings = assessmentFillingBo.mapFillingsOnCourse();
    final WebContext wctx = WebContextFactory.get();
    ScriptSession session = wctx.getScriptSession();
    Browser.withSession(session.getId(), new Runnable() {

        public void run() {
            HttpServletRequest req = wctx.getHttpServletRequest();
            for (Course course : courseFillings.keySet()) {
                try {
                    req.setAttribute("blockFillings", courseFillings.get(course));
                    Util.setValue("course_" + course.getId() + "_fillings",
                            wctx.forwardToString("/WEB-INF/jsp/monitoring/fillingBlock.jsp"), false);
                } catch (Exception ex) {
                    logger.error("Error refreshing the block fillings for course " + course.getId(), ex);
                    Util.setValue("course_" + course.getId() + "_fillings", ex.getMessage());
                }/*from  w  w  w .  ja v  a  2  s .c o  m*/
            }
        }
    });
}

From source file:com.netcracker.financeapp.controller.type.TypeDeleteServlet.java

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    ArrayList<String> typeList = typeService.getIncomeTypeNames();
    typeList.addAll(typeService.getSpendingTypeNames());
    request.setAttribute("typeList", typeList);

    request.setAttribute("clearType", "Select Type");
    request.getRequestDispatcher("type/typeDelete.jsp").forward(request, response);

}

From source file:org.covito.kit.web.springmvc.controller.BaseController.java

/** 
 * ?reuqest//from   w w  w.  j  a va2  s .co  m
 * <p>??</p>
 *
 * @author  covito
 * @param request
 * @param name
 * @param obj ?set
 * @return
 */
protected <T> T getOrCreateRequestAttribute(HttpServletRequest request, String name, T obj) {
    T value = (T) request.getAttribute(name);
    if (value == null) {
        value = obj;
        request.setAttribute(name, value);
    }
    return value;
}

From source file:architecture.ee.web.servlet.ViewRendererServlet.java

protected final void processRequest(HttpServletRequest httpservletrequest,
        HttpServletResponse httpservletresponse) throws ServletException, IOException {
    try {//w  w w  . j a v  a  2 s . c  om
        httpservletrequest.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE,
                WebApplicationContextUtils.getWebApplicationContext(getServletContext()));
        renderView(httpservletrequest, httpservletresponse);
    } catch (ServletException servletexception) {
        throw servletexception;
    } catch (IOException ioexception) {
        throw ioexception;
    } catch (Exception exception) {
        throw new NestedServletException("View rendering failed", exception);
    }
}

From source file:module.mission.presentationTier.action.SearchMissionsAction.java

@EntryPoint
public ActionForward prepare(final ActionMapping mapping, final ActionForm form,
        final HttpServletRequest request, final HttpServletResponse response) {
    request.setAttribute("searchBean", new SearchMissionsDTO());
    return forward("/mission/searchMissions.jsp");
}

From source file:com.esd.cs.audit.QueryAuditController.java

/**
 * ?//from   w w  w  .  j a v  a 2s . c om
 * 
 * @param request
 * @return
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ModelAndView queryAuditList(HttpServletRequest request, HttpSession session) {
    String nowYear = (String) session.getAttribute(Constants.YEAR);
    request.setAttribute("nowYear", nowYear);
    return new ModelAndView("query/audit");
}