Author: mmcallis
Date: 2008-02-14 19:57:45 -0500 (Thu, 14 Feb 2008)
New Revision: 9980
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
Log:
5.2.2.4. JSP Files and the Portlet Taglib
minor revision, replacing itemizedlist with
variablelist
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml
===================================================================
---
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-15
00:54:09 UTC (rev 9979)
+++
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/tutorials.xml 2008-02-15
00:57:45 UTC (rev 9980)
@@ -754,7 +754,7 @@
</screen></term>
<listitem>
<para>
- This method is triggered when a user clicks on an
<computeroutput>actionURL</computeroutput>, which is defined in the
<filename>HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp</filename> file. This
retrieves <computeroutput>yourname</computeroutput> from the HTML form, and
passes it as a <literal>renderParameter</literal> to the
<literal>doView()</literal> method.
+ This method is triggered when a user clicks on an
<computeroutput>actionURL</computeroutput>, which is defined in the
<filename>HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp</filename> file. This
retrieves <computeroutput>yourname</computeroutput> from the HTML form, and
passes it as a <computeroutput>aResponse.setRenderParameter</computeroutput>
to the <literal>doView()</literal> method.
</para>
</listitem>
</varlistentry>
@@ -781,22 +781,23 @@
</para>
</sect3>
<sect3>
- <title>JSP files and the portlet taglib</title>
+ <title>JSP Files and the Portlet Taglib</title>
<para>
- Of importance in this tutorial are the two view JSPs. The first,
<literal>view.jsp</literal>, allows the
- user to input his name, which is then posted to the
<literal>processAction</literal> method in our
- portlet class, set as a <literal>renderParameter</literal>,
then the <literal>render</literal> method is
- invoked (in our case, <literal>doView</literal>, which then
dispatches to our
- <literal>view2.jsp</literal>).
+ The <filename>HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp</filename> and
<filename>HelloWorldJSPPortlet/WEB-INF/jsp/view2.jsp</filename> JSP files are
included in the HelloWorldJSPPortlet portlet. The first,
<filename>view.jsp</filename>, allows a user to input their name. This is then
posted to the <computeroutput>processAction</computeroutput> method in the
portlet class, which is set in the
<computeroutput>aResponse.setRenderParameter</computeroutput>. The
<literal>render</literal> method,
<computeroutput>doView</computeroutput>, is invoked, which dispatches to the
<filename>view2.jsp</filename> JSP:
+ </para>
+ <para>
<mediaobject>
<imageobject>
<imagedata align="center"
fileref="images/tutorials/jsp_portlet/process.gif"
valign="middle"/>
</imageobject>
</mediaobject>
- Now let's have a look at our <literal>view.jsp</literal>:
</para>
+ <para>
+ The following is an example of the
<filename>HelloWorldJSPPortlet/WEB-INF/jsp/view.jsp</filename> file:
+ </para>
<para>
- <programlisting><![CDATA[<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet" %>
+<screen><![CDATA[
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
<portlet:defineObjects/>
@@ -814,42 +815,57 @@
You can also link to other pages, using a renderURL, like <a
href="<portlet:renderURL><portlet:param name="yourname"
value="Roy Russo">
</portlet:param></portlet:renderURL>">this</a>.
-</div>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>
- <programlisting><![CDATA[<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>]]></programlisting>
- Define the portlet taglib. You do
<emphasis>NOT</emphasis> need to bundle the portlet taglib,
- JBoss Portal will handle that for you.
- </para>
- </listitem>
- <listitem>
- <para>
-
<programlisting><![CDATA[<portlet:defineObjects/>]]></programlisting>
- Calling <literal>defineObjects</literal> makes
available implicit objects, such as
- <literal>renderRequest, actionRequest,
portletConfig</literal>, in this JSP.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<form
action="<portlet:actionURL><portlet:param name="page"
value="mainview"/>
- </portlet:actionURL>"
method="POST">]]></programlisting>
- We create an HTML form, but generate the URL it will post to
using the portlet tag library. In
- this case, notice how we are creating an
<literal>actionURL</literal>, which will activate our
- <literal>processAction</literal> method, passing in
any input parameters in the form.
- </para>
- </listitem>
- <listitem>
- <para>
- <programlisting><![CDATA[<a
href="<portlet:renderURL><portlet:param name="yourname"
value="Roy Russo">
-</portlet:param></portlet:renderURL>">]]></programlisting>
- Likewise, we are able to create a link to our
<literal>doView</literal> method, by simply
- creating it with a <literal>renderURL</literal>, that
passes in our <literal>yourname</literal>
- parameter.
- </para>
- </listitem>
- </itemizedlist>
- </para>
+</div>]]>
+</screen>
+</para>
+<para>
+<variablelist>
+ <varlistentry><term><screen><![CDATA[
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>]]>
+</screen></term>
+<listitem>
+ <para>
+ Define the portlet taglib. You do <emphasis>NOT</emphasis> need to bundle
the portlet taglib,
+ JBoss Portal will handle that for you.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<portlet:defineObjects/>]]>
+</screen></term>
+<listitem>
+ <para>
+ Calling <literal>defineObjects</literal> makes available implicit objects,
such as
+ <literal>renderRequest, actionRequest, portletConfig</literal>, in this
JSP.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<form action="<portlet:actionURL><portlet:param name="page"
value="mainview"/>
+ </portlet:actionURL>" method="POST">]]>
+</screen></term>
+<listitem>
+ <para>
+ We create an HTML form, but generate the URL it will post to using the portlet tag
library. In
+ this case, notice how we are creating an <literal>actionURL</literal>,
which will activate our
+ <literal>processAction</literal> method, passing in any input parameters in
the form.
+ </para>
+</listitem>
+</varlistentry>
+<varlistentry><term><screen><![CDATA[
+<a href="<portlet:renderURL><portlet:param name="yourname"
value="Roy Russo">
+</portlet:param></portlet:renderURL>">]]>
+</screen></term>
+<listitem>
+ <para>
+ Likewise, we are able to create a link to our <literal>doView</literal>
method, by simply
+ creating it with a <literal>renderURL</literal>, that passes in our
<literal>yourname</literal>
+ parameter.
+ </para>
+</listitem>
+</varlistentry>
+</variablelist>
+</para>
</sect3>
<sect3>
<title>Building and deploying your portlet</title>