Three navigational tags apply to virtually every JSP file in the three sample applications: <util:url>, <util:link>, and <util:forward>. A fourth tag, <util:include>, affects the visible content on pages.
Specific resource lookup rules apply when the comp and file attributes are used in conjunction with the url, include, and forward tags. The comp and file attributes are parameters to the lookup process. See the Utility Tag Library (util) in the Sun Java System Portal Server Mobile Access 7.1 Tag Library Reference guide for more information on these resource lookup rules.
This tag facilitates the construction of context-sensitive URL values. This tag is used in both the AML-based and WML-based versions of all three mobile applications.
<util:url file=”someFile.jsp” comp=”cal”/>
In this example, the URL specifies a file named someFile.jsp, and associates the file with the mobile calendar application.
This tag generates a compressed URL, which can complicate the process of looking at the generated markup to discern the target. Developers wishing to debug the application JSP pages might wish to disable URL compression in the following manner:
Edit the file:
/var/opt/SUNWportal/MAConfig.properties
and set the ma.compressor.enable property to false.
This tag facilitates the construction of link-type tags (in this guide, link-type items on a mobile device’s browser are referred to as options), whose content is dynamically generated. Each tag contains a tagstart and tagend attribute for specifying what appears at the start and end of the generated option:
<util:link tagstart=”<a” tagend=”>”> <util:attr attr=”href”> <util:url file=”someFile.jsp” comp=”cal”> ... other parameters... </util:url> </util:attr> </util:link> |
The forward tag forwards the request to the specified page:
<util:forward comp=”cal” file=”calHome.jsp>
The comp attribute associates the named file with a particular mobile application. In the preceding case, cal is an abbreviation for “calendar”.
URL forwarding will be required to minimize URL length for desktop and phone users.
You can use redirection to seamlessly send users requesting a document on one server to another document on another server.
For example, if the user types:
http://home.suncom.net |
It is without a destination URI. This prefix is not interpreted and translated in the web server administration console as Prefix: /index.html to fixed URL as:
http://home.suncom.net/amserver/UILogin?module=MSISDN. |
The web server will forward all Portal URLs with an URI /index.html to the fixed URL. Check the web server instance obj.conf file for this entry:
NameTrans fn=”redirect” from=”/index.html” url-prefix=”http://portal.mobile.suncom.net/amserver/UI/Login?module=MSISDN” |
This tag performs an include operation, similar to <jsp:include>, but constructs the resource name in one of two ways: with a path attribute, or with a combination of file and comp attributes. Certain JSP files use this tag to include reusable GUI elements in their output.
For more information regarding <util:url>, <util:link>, <util:forward>, and <util:include>, see the Sun Java System Portal Server Mobile Access 7.1 Tag Library Reference guide.