Saturday, June 20, 2009

How to forward search requests to the Search Center Portlet

This technote discusses how to create a search box that will forward search requests to the Search Center Portlet.

Resolving the problem
Search functionality is often crucial but there are times when placing the default Search Center portlet on a page does not fit with the plan and design of a portal. The solution is to write a simple search box that can be conveniently put on your Portal page that will forward the query to the complete Search Center Portlet on a new page.
In IBM WebSphere Portal 6.1, this can be accomplished with code similar to the following.

Add the code to the banner_searchControl.jspf file (located in \profiles\wp_profile\installedApps\\wps.ear\wps.war\themes\html\):

<%@taglib uri="/WEB-INF/tld/portal.tld" prefix="wps"%>