List of usage examples for javax.servlet.http HttpServletRequest setAttribute
public void setAttribute(String name, Object o);
From source file:com.netflix.spinnaker.kork.web.interceptors.MetricsInterceptor.java
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { request.setAttribute(TIMER_ATTRIBUTE, getNanoTime()); return true;/* w w w . j a v a2s . co m*/ }
From source file:net.sourceforge.fenixedu.presentationTier.Action.webSiteManager.ResearchUnitSiteManagementDA.java
@Override protected void setContext(HttpServletRequest request) { request.setAttribute("siteActionName", "/manageResearchUnitSite.do"); request.setAttribute("siteContextParam", "oid"); request.setAttribute("siteContextParamValue", getSite(request).getExternalId()); request.setAttribute("siteId", getSite(request).getExternalId()); request.setAttribute("announcementsActionName", "/manageResearchUnitAnnouncements.do"); request.setAttribute("researchUnit", true); }
From source file:eionet.gdem.web.struts.qascript.QAScriptListAction.java
@Override public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { ActionMessages errors = new ActionMessages(); try {//ww w. j a va 2 s .co m httpServletRequest.setAttribute(QAScriptListLoader.QASCRIPT_LIST_ATTR, QAScriptListLoader.getList(httpServletRequest)); } catch (DCMException e) { e.printStackTrace(); LOGGER.error("Error getting QA scripts list", e); errors.add("schema", new ActionMessage("label.exception.unknown")); saveErrors(httpServletRequest, errors); } return actionMapping.findForward("success"); }
From source file:eionet.gdem.web.struts.stylesheet.GeneratedStylesheetListAction.java
@Override public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { ActionMessages errors = new ActionMessages(); try {//from w ww . ja v a 2s . c om httpServletRequest.setAttribute(StylesheetListLoader.STYLESHEET_GENERATED_LIST_ATTR, StylesheetListLoader.getGeneratedList(httpServletRequest)); } catch (DCMException e) { e.printStackTrace(); LOGGER.error("Error getting stylesheet list", e); errors.add("schema", new ActionMessage("label.exception.unknown")); saveErrors(httpServletRequest, errors); } return actionMapping.findForward("success"); }
From source file:eionet.gdem.web.struts.stylesheet.StylesheetListAction.java
@Override public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { ActionMessages errors = new ActionMessages(); try {/*from w w w . ja va 2 s. c o m*/ httpServletRequest.setAttribute(StylesheetListLoader.STYLESHEET_LIST_ATTR, StylesheetListLoader.getStylesheetList(httpServletRequest)); } catch (DCMException e) { e.printStackTrace(); LOGGER.error("Error getting stylesheet list", e); errors.add("schema", new ActionMessage("label.exception.unknown")); saveErrors(httpServletRequest, errors); } return actionMapping.findForward("success"); }
From source file:com.adito.extensions.actions.GetExtensionDescriptorAction.java
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { request.setAttribute(Constants.REQ_ATTR_COMPRESS, Boolean.FALSE); String ticket = request.getParameter("ticket"); String id = request.getParameter("id"); if (id == null) { throw new Exception("No id"); }/*from www . j a v a 2 s.c om*/ ExtensionDescriptor app = ExtensionStore.getInstance().getExtensionDescriptor(id); if (app == null) { throw new Exception("No extension with id of " + id); } Properties properties = new Properties(); for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) { String name = (String) e.nextElement(); String val = request.getParameter(name); if (name.equals("ticket") || name.equals("id") || name.equals("name")) { continue; } else { properties.put(name, val); } } processApplicationRequest(app, ticket, request, response, properties); return null; }
From source file:com.benfante.minimark.ajax.QuestionABo.java
private void refreshAssessmentQuestions(final Long assessmentId) throws UnsupportedOperationException { final WebContext ctx = WebContextFactory.get(); ScriptSession scriptSession = ctx.getScriptSession(); Browser.withSession(scriptSession.getId(), new Runnable() { public void run() { try { HttpServletRequest req = ctx.getHttpServletRequest(); req.setAttribute(AssessmentController.ASSESSMENT_QUESTIONS_ATTR_NAME, assessmentQuestionDao.findByAssessmentId(assessmentId)); Util.setValue("assessmentQuestions", ctx.forwardToString("/WEB-INF/jsp/assessment/assessmentQuestions.jsp"), false); } catch (Exception ex) { Util.setValue("assessmentQuestions", ex.getMessage()); }//from w w w . ja va2s . c o m } }); }
From source file:cn.vlabs.umt.ui.actions.FindPasswordAction.java
/** * ?//from w ww . j a va 2s .co m * */ public ActionForward submitStepOne(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { request.setAttribute("isStatic", "true"); ErrorMsgs msgs = new RemindPasswordFormValidator(request).validateForm(); if (!msgs.isPass()) { return mapping.findForward("find.password.stepOne"); } String loginEmail = request.getParameter("loginEmail"); User user = getUserService().getUserByLoginName(loginEmail); SessionUtils.setSessionVar(request, "findPswUserId", user.getId()); response.sendRedirect(RequestUtil.getContextPath(request) + "/findPsw.do?act=stepTwo"); return null; }
From source file:com.benfante.minimark.ajax.QuestionABo.java
@RemoteMethod public void updateQuestionSearchResult(final QuestionBean questionBean) { final WebContext ctx = WebContextFactory.get(); ScriptSession scriptSession = ctx.getScriptSession(); Browser.withSession(scriptSession.getId(), new Runnable() { public void run() { try { HttpServletRequest req = ctx.getHttpServletRequest(); req.setAttribute(AssessmentController.QUESTION_SEARCH_RESULT_ATTR_NAME, questionBo.search(questionBean)); Util.setValue("searchResult", ctx.forwardToString("/WEB-INF/jsp/assessment/questionSearchResult.jsp"), false); } catch (Exception ex) { Util.setValue("searchResult", ex.getMessage()); }//ww w . j a v a 2 s.c o m } }); }
From source file:controller.GuestController.java
@RequestMapping(value = "/guestmanager", method = RequestMethod.GET) public String guestManager(HttpServletRequest request) { User user = new GeneralUser(); if (user.checkSession(request.getSession())) { request.setAttribute("mssv", new Student().getMSSV()); request.setAttribute("makhach", new Guest().getMaKhach()); request.setAttribute("listGuest", new Guest().getListKhach()); return "quanlykhach"; } else {//from w w w .j a v a 2s . c o m request.setAttribute("message", "Vui lng ng nhp!!"); return "dangnhap"; } }