本文整理汇总了Java中javax.portlet.PortletURL.setParameters方法的典型用法代码示例。如果您正苦于以下问题:Java PortletURL.setParameters方法的具体用法?Java PortletURL.setParameters怎么用?Java PortletURL.setParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.portlet.PortletURL
的用法示例。
在下文中一共展示了PortletURL.setParameters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLinkForOffset
import javax.portlet.PortletURL; //导入方法依赖的package包/类
public String getLinkForOffset(int newOffset, RenderResponse response) {
String thisLink;
if (response == null) {
thisLink = addParameter(link, "pagedListInfoId", String.valueOf(this.getId())) +
(getExpandedSelection() ? "&pagedListSectionId=" + this.getId() : "") +
"&offset=" + (newOffset > 0 ? newOffset : 0);
} else {
PortletURL renderURL = response.createRenderURL();
Map<String, String[]> params;
if (renderParameters == null) {
params = new HashMap<String, String[]>();
} else {
params = new HashMap<String, String[]>(renderParameters);
}
params.put("pagedListInfoId", new String[]{this.getId()});
params.put("pagedListSectionId", new String[]{this.getId()});
params.put("offset", new String[]{String.valueOf(newOffset > 0 ? newOffset : 0)});
params.put("page", new String[]{String.valueOf(newOffset > 0 ? newOffset % 10 : 0)});
renderURL.setParameters(params);
thisLink = renderURL.toString();
}
return thisLink;
}
示例2: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2PortletTests_EventPortlet_ApiEvent_processEvent */
/* Details: "Method processEvent(EventRequest, EventResponse): is */
/* called when an event is targeted to the portlet" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(
V2PORTLETTESTS_EVENTPORTLET_APIEVENT_PROCESSEVENT, aurl);
tb.writeTo(writer);
}
}
示例3: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2DispatcherTests4_SPEC2_19_ForwardServletEvent_invoke3 */
/* Details: "Parameters to the forward method for a target servlet */
/* can be wrapped request and response classes from the portlet */
/* lifecyle method initiating the include" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS4_SPEC2_19_FORWARDSERVLETEVENT_INVOKE3, aurl);
tb.writeTo(writer);
}
}
示例4: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2DispatcherTests4_SPEC2_19_ForwardJSPEvent_invoke3 */
/* Details: "Parameters to the forward method for a target servlet */
/* can be wrapped request and response classes from the portlet */
/* lifecyle method initiating the include" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS4_SPEC2_19_FORWARDJSPEVENT_INVOKE3, aurl);
tb.writeTo(writer);
}
}
示例5: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2AddlPortletTests_SPEC2_15_Event_event1 */
/* Details: "Event names are defined in the deployment descriptor" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2ADDLPORTLETTESTS_SPEC2_15_EVENT_EVENT1, aurl);
tb.writeTo(writer);
}
}
示例6: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
PortletSession ps = portletReq.getPortletSession();
String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + V2DISPATCHERTESTS3S_SPEC2_19_INCLUDESERVLETACTION_DISPATCH4);
if (msg != null) {
writer.write("<p>" + msg + "</p><br/>\n");
ps.removeAttribute(RESULT_ATTR_PREFIX + V2DISPATCHERTESTS3S_SPEC2_19_INCLUDESERVLETACTION_DISPATCH4);
}
/* TestCase: V2DispatcherTests3S_SPEC2_19_IncludeServletAction_dispatch4 */
/* Details: "The parameters associated with a request dispatcher are */
/* scoped only for the duration of the include or forward call" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS3S_SPEC2_19_INCLUDESERVLETACTION_DISPATCH4, aurl);
tb.writeTo(writer);
}
}
示例7: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2DispatcherTests3S_SPEC2_19_IncludeJSPEvent_dispatch4 */
/* Details: "The parameters associated with a request dispatcher are */
/* scoped only for the duration of the include or forward call" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS3S_SPEC2_19_INCLUDEJSPEVENT_DISPATCH4, aurl);
tb.writeTo(writer);
}
}
示例8: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2DispatcherTests3S_SPEC2_19_ForwardJSPEvent_dispatch4 */
/* Details: "The parameters associated with a request dispatcher are */
/* scoped only for the duration of the include or forward call" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS3S_SPEC2_19_FORWARDJSPEVENT_DISPATCH4, aurl);
tb.writeTo(writer);
}
}
示例9: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
/* TestCase: V2DispatcherTests3S_SPEC2_19_ForwardServletEvent_dispatch4 */
/* Details: "The parameters associated with a request dispatcher are */
/* scoped only for the duration of the include or forward call" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS3S_SPEC2_19_FORWARDSERVLETEVENT_DISPATCH4, aurl);
tb.writeTo(writer);
}
}
示例10: getRenderURL
import javax.portlet.PortletURL; //导入方法依赖的package包/类
/**
* Creates a render URL from the given request and parameters
*
* @param request
* the request
* @param parameters
* the parameters
* @return the render url
*/
public static String getRenderURL(ServletRequest request, Map<String, String[]> parameters)
{
RenderResponse renderResp = (RenderResponse) request.getAttribute("javax.portlet.response");
if (renderResp == null)
{
throw new IllegalStateException("RenderResponse object is null");
}
PortletURL url = renderResp.createRenderURL();
url.setParameters(parameters);
return url.toString();
}
示例11: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
PortletSession ps = portletReq.getPortletSession();
String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + "PortletTests_Portlet_ApiAction", APPLICATION_SCOPE);
if (msg != null) {
writer.write("<p>" + msg + "</p><br/>\n");
ps.removeAttribute(RESULT_ATTR_PREFIX + "PortletTests_Portlet_ApiAction", APPLICATION_SCOPE);
}
/* TestCase: V2PortletTests_Portlet_ApiAction_processAction */
/* Details: "Method processAction(ActionRequest, ActionResponse): is */
/* called when an action URL for the portlet is triggered" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2PORTLETTESTS_PORTLET_APIACTION_PROCESSACTION, aurl);
tb.writeTo(writer);
}
}
示例12: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
PortletSession ps = portletReq.getPortletSession();
String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + "DispatcherTests4_SPEC2_19_ForwardJSPAction",
APPLICATION_SCOPE);
if (msg != null) {
writer.write("<p>" + msg + "</p><br/>\n");
ps.removeAttribute(RESULT_ATTR_PREFIX + "DispatcherTests4_SPEC2_19_ForwardJSPAction", APPLICATION_SCOPE);
}
/* TestCase: V2DispatcherTests4_SPEC2_19_ForwardJSPAction_invoke3 */
/* Details: "Parameters to the forward method for a target servlet */
/* can be wrapped request and response classes from the portlet */
/* lifecyle method initiating the include" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERTESTS4_SPEC2_19_FORWARDJSPACTION_INVOKE3, aurl);
tb.writeTo(writer);
}
}
示例13: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
LOGGER.trace("main portlet render entry");
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
PortletSession ps = portletReq.getPortletSession();
String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + "RequestTests_ActionRequest_ApiAction", APPLICATION_SCOPE);
if (msg != null) {
writer.write("<p>" + msg + "</p><br/>\n");
ps.removeAttribute(RESULT_ATTR_PREFIX + "RequestTests_ActionRequest_ApiAction", APPLICATION_SCOPE);
}
/* TestCase: V2RequestTests_ActionRequest_ApiAction_fieldACTION_NAME */
/* Details: "Has String field ACTION_NAME with value of */
/* \"javax.portlet.action\" " */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2REQUESTTESTS_ACTIONREQUEST_APIACTION_FIELDACTION_NAME, aurl);
tb.writeTo(writer);
}
}
示例14: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
portletResp.setContentType("text/html");
PrintWriter writer = portletResp.getWriter();
writer.write("<h3>Event Companion Portlet </h3>\n");
writer.write("<p>AddlRequestTests_SPEC2_11_Event_event</p>\n");
/* TestCase: V2AddlRequestTests_SPEC2_11_Event_parameters12 */
/* Details: "If a portlet receives an event that is the result of a */
/* client request targeted to another portlet in the portal page, the */
/* parameters should be the same parameters as of the previous render */
/* request from this client" */
if (portletReq.getParameter("tr3") == null) {
PortletURL rurl = portletResp.createRenderURL();
rurl.setParameters(portletReq.getPrivateParameterMap());
rurl.setParameter("tr3", "true");
TestSetupLink tb = new TestSetupLink(V2ADDLREQUESTTESTS_SPEC2_11_EVENT_PARAMETERS12, rurl);
tb.writeTo(writer);
}
String msg = (String) portletReq.getPortletSession()
.getAttribute(RESULT_ATTR_PREFIX + "AddlRequestTests_SPEC2_11_Event", APPLICATION_SCOPE)
+ (String) portletReq.getPortletSession().getAttribute(
RESULT_ATTR_PREFIX + "AddlRequestTests_SPEC2_11_Event_event", APPLICATION_SCOPE);
msg = (msg.equals("nullnull")) ? "Not ready. click test case link." : msg;
writer.write("<p>" + msg + "</p>\n");
}
示例15: render
import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp)
throws PortletException, IOException {
long tid = Thread.currentThread().getId();
portletReq.setAttribute(THREADID_ATTR, tid);
PrintWriter writer = portletResp.getWriter();
PortletSession ps = portletReq.getPortletSession();
String msg = (String) ps.getAttribute(RESULT_ATTR_PREFIX + "DispatcherReqRespTests5S_SPEC2_19_ForwardJSPActionResponse", APPLICATION_SCOPE);
if (msg != null) {
writer.write("<p>" + msg + "</p><br/>\n");
ps.removeAttribute(RESULT_ATTR_PREFIX + "DispatcherReqRespTests5S_SPEC2_19_ForwardJSPActionResponse", APPLICATION_SCOPE);
}
/* TestCase: V2DispatcherReqRespTests5S_SPEC2_19_ForwardJSPActionResponse_sendRedirect */
/* Details: "In a target jsp of a forward in the Action phase, the */
/* method HttpServletResponse.sendRedirect must provide the same */
/* functionality as ActionResponse.sendRedirect" */
{
PortletURL aurl = portletResp.createActionURL();
aurl.setParameters(portletReq.getPrivateParameterMap());
TestButton tb = new TestButton(V2DISPATCHERREQRESPTESTS5S_SPEC2_19_FORWARDJSPACTIONRESPONSE_SENDREDIRECT, aurl);
tb.writeTo(writer);
}
}
开发者ID:apache,项目名称:portals-pluto,代码行数:29,代码来源:DispatcherReqRespTests5S_SPEC2_19_ForwardJSPActionResponse.java