📄 strutsviewcommand.html
字号:
<BR> Saves attributes from the request by name for later restoral when the command is executed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#saveCommand(javax.portlet.PortletRequest, javax.portlet.PortletResponse)">saveCommand</A></B>(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response)</CODE><BR> Saves the current command using the Command Manager Factory.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#saveCommand(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.String)">saveCommand</A></B>(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, java.lang.String commandPrefix)</CODE><BR> Saves the current command using the Command Manager Factory.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#setContentType(javax.portlet.PortletRequest)">setContentType</A></B>(javax.portlet.PortletRequest request)</CODE><BR> Sets the content type.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#setContentType(javax.portlet.PortletRequest, java.lang.String)">setContentType</A></B>(javax.portlet.PortletRequest request, java.lang.String contentType)</CODE><BR> Sets the content type associated with this command.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#setPrefix(javax.portlet.PortletRequest, java.lang.String)">setPrefix</A></B>(javax.portlet.PortletRequest request, java.lang.String prefix)</CODE><BR> Sets the prefix associated with this command.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#setRemoveOnModeChange(boolean)">setRemoveOnModeChange</A></B>(boolean value)</CODE><BR> Allows setting a flag so that this command is removed when the Portal mode changes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/command/StrutsViewCommand.html#setSavedAttributes(java.util.Map)">setSavedAttributes</A></B>(java.util.Map attributeMap)</CODE><BR> Sets the saved attributes map.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="CONTENT_TYPE"><!-- --></A><H3>CONTENT_TYPE</H3><PRE>protected static final java.lang.String <B>CONTENT_TYPE</B></PRE><DL><DD>Request attribute name for the content type.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.ibm.portal.struts.command.StrutsViewCommand.CONTENT_TYPE">Constant Field Values</A></DL></DL><HR><A NAME="PREFIX"><!-- --></A><H3>PREFIX</H3><PRE>protected static final java.lang.String <B>PREFIX</B></PRE><DL><DD>Request attribute name for the prefix.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#com.ibm.portal.struts.command.StrutsViewCommand.PREFIX">Constant Field Values</A></DL></DL><HR><A NAME="messages"><!-- --></A><H3>messages</H3><PRE>protected static org.apache.struts.util.MessageResources <B>messages</B></PRE><DL><DD>The message resources for the Struts Portlet Framework.<P><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="StrutsViewCommand()"><!-- --></A><H3>StrutsViewCommand</H3><PRE>public <B>StrutsViewCommand</B>()</PRE><DL><DD>Default constructor. If this constructor is used, the setPrefix method must be called to set the module prefix. Commands must save the module prefix so that the correct Struts module config can be set in the render phase of portal.<P></DL><HR><A NAME="StrutsViewCommand(javax.portlet.PortletRequest)"><!-- --></A><H3>StrutsViewCommand</H3><PRE>public <B>StrutsViewCommand</B>(javax.portlet.PortletRequest request)</PRE><DL><DD>Constructs the StrutsViewCommand object. The module prefix will be determined from the request object. The <code>StrutsViewCommand</code> is typically created in the action phase of Portal, so the interface expects a PortletRequest.<P><DT><B>Parameters:</B><DD><CODE>request</CODE> - The request object to save context information from</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="addAttributeNameToSave(java.lang.String)"><!-- --></A><H3>addAttributeNameToSave</H3><PRE>public static void <B>addAttributeNameToSave</B>(java.lang.String attributeName)</PRE><DL><DD>Adds the name of an attribute from the object request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name of the attribute</DL></DD></DL><HR><A NAME="removeAttributeNameToSave(java.lang.String)"><!-- --></A><H3>removeAttributeNameToSave</H3><PRE>public static void <B>removeAttributeNameToSave</B>(java.lang.String attributeName)</PRE><DL><DD>Removes the name of an attribute from the list of attribute names to save.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attributeName</CODE> - the name of the attribute</DL></DD></DL><HR><A NAME="addAttributeTypeToSave(java.lang.Class)"><!-- --></A><H3>addAttributeTypeToSave</H3><PRE>public static void <B>addAttributeTypeToSave</B>(java.lang.Class attributeType)</PRE><DL><DD>Adds the class type of an attribute from the object request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attributeType</CODE> - the attribute type</DL></DD></DL><HR><A NAME="removeAttributeTypeToSave(java.lang.Class)"><!-- --></A><H3>removeAttributeTypeToSave</H3><PRE>public static void <B>removeAttributeTypeToSave</B>(java.lang.Class attributeType)</PRE><DL><DD>Removes the class type of the request attribute from the list of attributes to save.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attributeType</CODE> - the attribute type</DL></DD></DL><HR><A NAME="getSavedCommand(javax.portlet.PortletRequest, javax.portlet.PortletResponse, com.ibm.portal.struts.command.ViewCommandExecutionContext)"><!-- --></A><H3>getSavedCommand</H3><PRE>public static <A HREF="../../../../../com/ibm/portal/struts/command/IViewCommand.html" title="interface in com.ibm.portal.struts.command">IViewCommand</A> <B>getSavedCommand</B>(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, <A HREF="../../../../../com/ibm/portal/struts/command/ViewCommandExecutionContext.html" title="class in com.ibm.portal.struts.command">ViewCommandExecutionContext</A> context) throws javax.portlet.PortletException</PRE><DL><DD>Gets the saved command from the Command Manager Factory.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>request</CODE> - the portlet request object<DD><CODE>response</CODE> - the portlet response object<DD><CODE>context</CODE> - the view command execution context<DT><B>Returns:</B><DD>returns the saved IViewCommand object<DT><B>Throws:</B><DD><CODE>javax.portlet.PortletException</CODE> - if the request cannot fulfilled</DL></DD></DL><HR><A NAME="saveCommand(javax.portlet.PortletRequest, javax.portlet.PortletResponse)"><!-- --></A><H3>saveCommand</H3><PRE>public void <B>saveCommand</B>(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response) throws javax.portlet.PortletException</PRE><DL><DD>Saves the current command using the Command Manager Factory.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>request</CODE> - The request object<DD><CODE>response</CODE> - the response object<DT><B>Throws:</B><DD><CODE>javax.portlet.PortletException</CODE></DL></DD></DL><HR><A NAME="saveCommand(javax.portlet.PortletRequest, javax.portlet.PortletResponse, java.lang.String)"><!-- --></A><H3>saveCommand</H3><PRE>public void <B>saveCommand</B>(javax.portlet.PortletRequest request, javax.portlet.PortletResponse response, java.lang.String commandPrefix) throws javax.portlet.PortletException</PRE><DL><DD>Saves the current command using the Command Manager Factory.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>request</CODE> - The request object<DD><CODE>response</CODE> - the response object<DD><CODE>commandPrefix</CODE> - the prefix to store the command<DT><B>Throws:</B><DD><CODE>javax.portlet.PortletException</CODE></DL></DD></DL><HR><A NAME="setContentType(javax.portlet.PortletRequest)"><!-- --></A><H3>setContentType</H3><PRE>public void <B>setContentType</B>(javax.portlet.PortletRequest request)</PRE><DL><DD>Sets the content type. This method will determine the content type from the request object if the request object is an ActionRequest object.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>request</CODE> - the portlet request object</DL></DD></DL><HR><A NAME="repopulateRequest(javax.portlet.RenderRequest)"><!-- --></A><H3>repopulateRequest</H3><PRE>protected void <B>repopulateRequest</B>(javax.portlet.RenderRequest request)</PRE><DL><DD>Repopulates the given request from saved values. The request attributes that were saved as part of the saveAttributes call are repopulated in the render phase of Portal. This method should only be called from this class's execute method.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>request</CODE> - The request object to repopulate</DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -