本文整理汇总了Java中javax.portlet.RenderRequest.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java RenderRequest.setAttribute方法的具体用法?Java RenderRequest.setAttribute怎么用?Java RenderRequest.setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.portlet.RenderRequest
的用法示例。
在下文中一共展示了RenderRequest.setAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {
_log.info("render()");
try {
TaskRecord taskRecord = ActionUtil.getTaskRecord(renderRequest);
renderRequest.setAttribute(TimetrackerWebKeys.TASK_RECORD, taskRecord);
} catch (Exception e) {
if (e instanceof NoSuchTaskRecordException || e instanceof PrincipalException) {
SessionErrors.add(renderRequest, e.getClass());
return "/error.jsp";
} else {
throw new PortletException(e);
}
}
return getPath();
}
示例2: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {
_log.info("render()");
try {
Contact contact = ActionUtil.getContact(renderRequest);
renderRequest.setAttribute(ContactManagerWebKeys.CONTACT, contact);
} catch (Exception e) {
if (e instanceof NoSuchContactException || e instanceof PrincipalException) {
SessionErrors.add(renderRequest, e.getClass());
return "/error.jsp";
} else {
throw new PortletException(e);
}
}
return getPath();
}
示例3: renderFromMobilink
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
private void renderFromMobilink(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
renderFrontendWebEmployeePortlet(renderRequest, renderResponse);
renderFrontendWebJobposPortlet(renderRequest, renderResponse);
renderFrontendWebAdminPortlet(renderRequest, renderResponse);
renderFrontendWebWorkingUnitPortlet(renderRequest, renderResponse);
renderFrontendWebNotificationPortlet(renderRequest, renderResponse);
renderRequest.setAttribute(
"url", generateURLCommon(renderRequest, renderResponse));
renderRequest.setAttribute("constants", generalConstantsCommon(renderRequest));
renderRequest.setAttribute("param", generalParamsCommon(renderRequest));
}
示例4: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {
// Get Mode
String mode = ParamUtil.getString(
renderRequest,
LDFPortletKeys.MODE,
LDFPortletKeys.MODE_ORGANIZAION);
// Carry around mode
renderRequest.setAttribute(LDFPortletKeys.MODE, mode);
if(_log.isDebugEnabled()) {
_log.debug("mode <" + mode + ">");
_log.debug("jsp <" + _commonUtil
.getPageFromMode()
.getOrDefault(mode, LDFPortletKeys.JSP_ORGANIZAION) + ">");
}
return _commonUtil
.getPageFromMode()
.getOrDefault(mode, LDFPortletKeys.JSP_ORGANIZAION);
}
示例5: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {
_log.info("render()");
try {
Measurement measurement = ActionUtil.getMeasurement(renderRequest);
renderRequest.setAttribute(DataManagerWebKeys.MEASUREMENT, measurement);
} catch (Exception e) {
if (e instanceof NoSuchMeasurementException || e instanceof PrincipalException) {
SessionErrors.add(renderRequest, e.getClass());
return "/error.jsp";
} else {
throw new PortletException(e);
}
}
return getPath();
}
示例6: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierInfoURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierInfoURL.setPortletMode(PortletMode.VIEW);
dossierInfoURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierInfoURL.setParameter(
"mvcPath", "/templates/lookup_dossier/dossierinfo.ftl");
urlObject.put("dossierinfo", dossierInfoURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例7: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL registerResultURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
registerResultURL.setPortletMode(PortletMode.VIEW);
registerResultURL.setWindowState(LiferayWindowState.EXCLUSIVE);
registerResultURL.setParameter(
"mvcPath", "/templates/applicant/register_result.ftl");
urlObject.put("register_result", registerResultURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例8: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL confirmPasswordURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
confirmPasswordURL.setPortletMode(PortletMode.VIEW);
confirmPasswordURL.setWindowState(LiferayWindowState.EXCLUSIVE);
confirmPasswordURL.setParameter(
"mvcPath", "/templates/applicant/confirm_password.ftl");
urlObject.put("confirm_password", confirmPasswordURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例9: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL serviceInfoLookupURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
serviceInfoLookupURL.setPortletMode(PortletMode.VIEW);
serviceInfoLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
serviceInfoLookupURL.setParameter(
"mvcPath", "/templates/homepage/serviceinfo_lookup.ftl");
urlObject.put("serviceinfo_lookup", serviceInfoLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例10: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay =
(ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierLookupURL = PortletURLFactoryUtil.create(
renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierLookupURL.setPortletMode(PortletMode.VIEW);
dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierLookupURL.setParameter(
"mvcPath", "/templates/homepage/dossier_lookup.ftl");
urlObject.put("dossier_lookup", dossierLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put(
"portletNamespace",
themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例11: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierLookupURL = PortletURLFactoryUtil.create(renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierLookupURL.setPortletMode(PortletMode.VIEW);
dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierLookupURL.setParameter("mvcPath", "/templates/homepage/search_serviceinfo.ftl");
urlObject.put("dossier_lookup", dossierLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put("portletNamespace", themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例12: render
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void render(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
String portletId = portletDisplay.getId();
JSONObject urlObject = JSONFactoryUtil.createJSONObject();
JSONObject apiObject = JSONFactoryUtil.createJSONObject();
// url
PortletURL dossierLookupURL = PortletURLFactoryUtil.create(renderRequest, portletId, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
dossierLookupURL.setPortletMode(PortletMode.VIEW);
dossierLookupURL.setWindowState(LiferayWindowState.EXCLUSIVE);
dossierLookupURL.setParameter("mvcPath", "/templates/homepage/dossier_lookup.ftl");
urlObject.put("dossier_lookup", dossierLookupURL.toString());
// api
apiObject.put("server", themeDisplay.getPortalURL() + "/o/rest/v2");
apiObject.put("portletNamespace", themeDisplay.getPortletDisplay().getNamespace());
// set varible
renderRequest.setAttribute("ajax", urlObject);
renderRequest.setAttribute("api", apiObject);
super.render(renderRequest, renderResponse);
}
示例13: doView
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public void doView(RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
renderRequest.setAttribute(DummyFactoryConfiguration.class.getName(), _dummyFactoryConfiguration);
super.doView(renderRequest, renderResponse);
}
示例14: doDispatch
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
protected void doDispatch(
RenderRequest renderRequest, RenderResponse renderResponse)
throws IOException, PortletException {
renderRequest.setAttribute(DummyFactoryConfiguration.class.getName(), _dummyFactoryConfiguration);
super.doDispatch(renderRequest, renderResponse);
}
示例15: preHandleRender
import javax.portlet.RenderRequest; //导入方法依赖的package包/类
@Override
public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler)
throws PortletException {
if (request.getAttribute("test2-remove-never") != null) {
throw new PortletException("Wrong interceptor order");
}
request.setAttribute("test1-remove-never", "test1-remove-never");
request.setAttribute("test1-remove-post", "test1-remove-post");
request.setAttribute("test1-remove-after", "test1-remove-after");
return true;
}