Step by step creating a Portal filter

0 comments

Following are the simple steps for creating a Portal Filter.
  1. Using your preferred IDE, create a simple java project named portalFilterProject.
  2. In this project, create a simple java class which will act as a filter class with below line of code. System.out.println("My First Portal Filter");
  3. Export the new created filter project as .jar file.
  4. Copy the exported portal .jar file to following location  \IBM\WebSphere\PortalServer\shared\app
  5. Now, navigate to following directory \IBM\WebSphere\wp_profile\config\cells\DefaultNode\applications\wps.ear\deployments\wps\wps.war\WEB-INF
  6. Add the following entries to the web.xml at the end of all filter entries in the file. Filters take precedence as the order they are added. It is advisable to keep the backup of web.xml before making these changes.
<filter>
<filter-name>Portal Filter</filter-name>
<filter-class>com.test.portal.filter</filter-class>
</filter>

<filter-mapping>
<filter-name>Portal Filter</filter-name>
<url-pattern>/myportal/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>Portal Filter</filter-name>
<url-pattern>/portal/*</url-pattern>
</filter-mapping>

Now restart the portal server, you will see the message "My First Portal Filter" you placed in the portal filter class for the each request in logs. If the message is coming that means you have successfully implemented the Portal Filter.

Useful links:

No comments:

Post a Comment

Recent Posts

Reader Comments

Popular Posts

© 2011-2014 Web Portal Club