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:com.wx.spring.controller.SalesController.java

@RequestMapping(value = "/eidtSaleRecord", method = RequestMethod.GET)
public String editSalesRecord(@RequestParam String SaleRecordId, @ModelAttribute SaleInfoBean saleInfoBean,
        HttpServletRequest request) {
    System.out.println("Enter:Run at Controller: editSalesRecord");

    System.out.println("recId:" + SaleRecordId);

    request.setAttribute("saleRec", saleService.findSalesRecordById(SaleRecordId));

    System.out.println("Outer:Run at Controller: editSalesRecord");
    return "Sale/editSale";

}

From source file:com.gp.cong.logisoft.struts.action.SedFilingAction.java

public void editMethod(String trnref, HttpServletRequest request) throws Exception {
    if (null != trnref) {
        request.setAttribute("schedList", new SedSchedulebDetailsDAO().findByTrnref(trnref));
        request.setAttribute("index", request.getParameter("index"));
    }/*from   w  w  w.ja  v  a2  s .com*/
}

From source file:com.xdtech.report.controller.ReadReportController.java

@RequestMapping(params = "exportWin")
public ModelAndView exportWin(HttpServletRequest request, Long configId) {
    if (configId != null) {
        request.setAttribute("configItem", configService.loadConfigItem(configId));
    }/* ww w.  j av  a2s . c o  m*/
    return new ModelAndView("report/read/exportReportWin_ftl");
}

From source file:de.betterform.agent.web.servlet.XFormsServlet.java

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    req.setAttribute(WebFactory.XFORMS_INPUTSTREAM, req.getInputStream());
    req.setAttribute(XFormsPostServlet.INIT_BY_POST, true);
    doGet(req, resp);//from ww  w .  j  a  va2  s  .co  m
}

From source file:gallery.web.controller.pages.types.WallpaperAddType.java

@Override
public UrlBean execute(HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
        throws Exception {
    request.setAttribute(CATEGORIES_ATTR,
            pagesService.getAllCombobox(Boolean.TRUE, Boolean.TRUE, WallpaperGalleryType.TYPE));

    String action = request.getParameter(gallery.web.controller.Config.ACTION_PARAM_NAME);
    /** bind command */
    Wallpaper command = new Wallpaper();
    if ("addWallpaper".equals(action)) {
        BindingResult res = validator.bindAndValidate(command, request);
        if (res.hasErrors() || !wallpaperService.getImage(command)) {
            //m.putAll(res.getModel());
            request.setAttribute(res.MODEL_KEY_PREFIX + "command", res);
            request.setAttribute("command", command);
            common.CommonAttributes.addErrorMessage("form_errors", request);
        } else {// w w  w.  j  a va 2 s  .c  o  m
            //command.setUser(security.Utils.getCurrentUser(request));
            wallpaperService.save(command);
            request.setAttribute("command", new Wallpaper());
            common.CommonAttributes.addHelpMessage("operation_succeed", request);
        }
    } else {
        request.setAttribute("command", command);
    }

    UrlBean url = new UrlBean();
    url.setContent(contentUrl);

    return url;
}

From source file:de.uni_koeln.spinfo.maalr.webapp.util.DebugInterceptor.java

public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
        throws Exception {
    if (enabled) {
        long startTime = System.currentTimeMillis();
        request.setAttribute("startTime", startTime);
    }//w  w w .ja v  a  2  s.com
    return true;
}

From source file:com.wx.spring.controller.SalesController.java

@RequestMapping(value = "/submitSaleRecord", method = RequestMethod.POST)
public String submitSalesRecord(@ModelAttribute SaleInfoBean saleInfoBean, HttpServletRequest request) {
    System.out.println("Enter:Run at Controller: submitSalesRecord");

    System.out.println(saleInfoBean.getUnitPrice());
    request.setAttribute("totalSalesCls", 100);
    request.setAttribute("totalUsedCls", 40);
    System.out.println("Outer:Run at Controller: submitSalesRecord");
    return "Sale/viewSale";

}

From source file:org.ihtsdo.otf.refset.interceptor.RequestProcessingTimeInterceptor.java

@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object arg2) throws Exception {

    if (isEnabled) {

        LOGGER.debug("preHandle");

        req.setAttribute(START_TIME, System.currentTimeMillis());

    }/*from  w ww.java 2s  .c  o  m*/
    return true;
}

From source file:org.sarons.spring4me.web.servlet.DispatcherServlet.java

private void exportContextPath(HttpServletRequest request, ModelAndView mv) {
    mv.addObject(Keys.REQUEST_KEY_BASE, request.getContextPath());
    request.setAttribute(Keys.REQUEST_KEY_BASE, request.getContextPath());
}

From source file:com.netcracker.financeapp.controller.bank_card.BankCardDeleteServlet.java

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    ArrayList<String> cardList = bankCardService.getBankCardNumbers();
    request.setAttribute("cardList", cardList);

    request.setAttribute("clearCard", "Select Card");
    request.getRequestDispatcher("bankCard/bankCardDelete.jsp").forward(request, response);

}