Sun Java System Portal Server 7.1 Developer Sample Guide

ProcedureTo Remove content-length from Search Results

  1. (Optional) Modify searchOnly.jsp file by removing content-length from the list of viewAttributes.

    The line to modify is the following:


    <search:setViewAttributes viewAttributes="hl-url,hl-title,hl-description,score,content-length,classification hl-classification"/>

    Remove content-length from this line.

  2. Modify results.jsp file by removing the line that displays the content-length.

    Comment the lines as shown here:


    <%--
    	<search:getValue attribute="content-length" id="sz"/>
    	<jx:declare id="sz" type="java.lang.String"/>
    	<%
    		int sizek = 1;
    		try {
    			sizek = Math.max(1, (Integer.parseInt(sz) + 512)/1024 );
    		} catch (Exception e) {
    		}
    	%>
    	<i18n:message key="size" bundle="searchjsp"/>
    	<%= sizek %>k&nbsp;
    --%>"
  3. Run the touch command.

    For example, type touch *.jsp.

  4. Reload the Desktop to verify the change.