[cvs] expresso/expresso-web/expresso/doc/edg jsp.xml

JCorporate Ltd jcorp at jcorp2.servlets.net
Thu Jun 17 12:26:12 PDT 2004


Update of /home/javacorp/.cvs/expresso/expresso/expresso-web/expresso/doc/edg
In directory jcorp2.servlets.net:/tmp/cvs-serv10390/expresso-web/expresso/doc/edg

Modified Files:
	jsp.xml 
Log Message:
add description of shortening URLs in links


Index: jsp.xml
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/expresso/doc/edg/jsp.xml,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** jsp.xml	17 Jun 2004 16:34:05 -0000	1.17
--- jsp.xml	17 Jun 2004 19:26:10 -0000	1.18
***************
*** 632,635 ****
--- 632,684 ----
  	<para />
      <sect1>
+         <title>How to shorten URLs in links</title>
+         <indexterm>
+             <primary>Shortening URLs</primary>
+             <secondary>href</secondary>
+         </indexterm>
+ 
+         <para>
+         How to make the URLs in links shorter:
+ 
+ JSTL does this, and I added a feature to the Expresso tag library to omit
+ the controller parameter if you know you do not want it.
+ 
+ Here's the deal:
+ 
+ In JSTL, the URL is generated in whole by "fullUrl", and is
+ "optimized" to remove the controller parameter if it is unnecessary:
+ 
+ <programlisting><![CDATA[
+ <a href="<c:out value='${anAttrib.nestedMap[attribCustom].fullUrl}'/>"><small>View</small></a>
+ ]]></programlisting>
+ 
+ However, with the old Expresso tag library, links are created partly
+ from 'naked' text in the JSP and partly from the Expresso tag:
+ 
+ <programlisting><![CDATA[
+ <a href="<sri_expresso:Context/>AddNodeAction.do?<sri_expresso:TransitionParamsTag name="<%=AddNodeAction.VIEW_NODE%>"/>">blah</a></td>
+ ]]></programlisting>
+ 
+ note that we supplied the "file" part of the URL, "AddNodeAction.do" in this example.
+ 
+ I've added an option "omitControllerParam" to the
+ TransitionParamsTag that will omit the controller parameter.
+ This is appropriate for most cases where the transition is going
+ to the same controller that we manually put into the "file" section:
+ 
+ <programlisting><![CDATA[
+ <a href="<sri_expresso:Context/>/do/AddNodeAction?<sri_expresso:TransitionParamsTag omitControllerParam="true" name="<%=AddNodeAction.VIEW_NODE%>"/>">blah</a></td>
+ ]]></programlisting>
+ 
+ So to reduce the size of URLs, you can go through all the
+ TransitionParamsTag's and add this option (after confirming
+ that the destination controller is the same as the naked text),
+ or you can translate to JSTL.
+ 
+         </para>
+ 
+     </sect1>
+         <para />
+     <sect1>
          <title>Universal Dispatch</title>
          <indexterm>



More information about the cvs mailing list