Sun Java System Portal Server 7.1 Developer Sample Guide

ProcedureTo Add last-modified to the Search Result Display

  1. Modify searchOnly.jsp file by adding last-modified to the list of viewAttributes.

    For example:


    <search:setViewAttributes viewAttributes="hl-url,hl-title,hl-description,score,content-length,hl-classification,last-modified"/>
  2. Modify results.jsp file to display the last-modified date for document results using the SOIF getValue tag.

    For example:


    <% if (formbean.getDescription().equals("full")) { %>
        <FONT color=<%=tFontColor%> face=<%=tFontFace%>><search:getValue soifAttribute="description" escape="false"/></FONT><BR>
        <FONT color=#707070 face=<%=tFontFace%>><search:getURL escape="true"/><BR>
        <search:getValue soifAttribute="content-length" id="sz"/>
        <search:getValue soifAttribute="last-modified"/><BR>
    <% } %>
  3. Run the touch command.

    For example, type touch *.jsp.

  4. Reload the Desktop to verify the change.