Topic
  • 4 replies
  • Latest Post - ‏2012-03-05T17:57:43Z by SureshR19
SureshR19
SureshR19
11 Posts

Pinned topic Redirecting to a custom error page when HTTP 404 encountered-WPS 7.0.0.1

‏2012-02-20T13:19:19Z |
Hi,

Anybody please help me finding a solutions to my problem.

Env: WebSphere portal 7.0.0.1 with CF010 applies.

Redirecting to a custom error page when HTTP 404 Not Found encountered on non-URL resources

In my case, i have used Navigational Model SPI to form the url's to pages in my portal application.

If the user tries to access a portal page using friendly url's For Eg: http://<hostname>:<portnumber>/wps/portal/test/test1 where "test1" does not exist, as per the portals default behavior it falls back to http://<hostname>:<portnumber>/wps/portal/test/. But in cases where there is Web content viewer portlet added to a page and if the user tries access that page with a Resource URL that does not exist, Web Content Viewer portlet, handles the error and simply displays a warning message "A page context must be present when using a path info URL".

And more over, when ever this message shows up in WCM portelt due to an invalid url, All url's in my portal page which have been formed using Navigational Model SPI are getting appended with the wrong friendly URL. In my case it is "test1".

Is this relates to the fix given in PM52967 - "INCORRECT URL GENERATION IN NAVIGATION MODEL FEED" ?

Please suggest me, what is the best solution to resolve these issues in WebSphere portal 7.

1. Redirecting to a custom error page when HTTP 404 Not Found encountered on non-URL resources
2. INCORRECT URL GENERATION IN NAVIGATION MODEL FEED.

Thanks,
Suresh
Updated on 2012-03-05T17:57:43Z at 2012-03-05T17:57:43Z by SureshR19
  • Bhagwan
    Bhagwan
    11 Posts

    Re: Redirecting to a custom error page when HTTP 404 encountered-WPS 7.0.0.1

    ‏2012-02-21T11:42:35Z  
    Try mapping the context in your rendering portlet, so that it looks for the content itself rather than looking up the context url.
    For second question,
    http://www-01.ibm.com/support/docview.wss?rs=688&uid=swg21411109

    If you are using http server you can write a rewrite rule.
  • SureshR19
    SureshR19
    11 Posts

    Re: Redirecting to a custom error page when HTTP 404 encountered-WPS 7.0.0.1

    ‏2012-02-22T13:01:44Z  
    • Bhagwan
    • ‏2012-02-21T11:42:35Z
    Try mapping the context in your rendering portlet, so that it looks for the content itself rather than looking up the context url.
    For second question,
    http://www-01.ibm.com/support/docview.wss?rs=688&uid=swg21411109

    If you are using http server you can write a rewrite rule.
    Thanks for your reply Bhagwan

    1. Could you please elaborate the below statement.

    "Try mapping the context in your rendering portlet, so that it looks for the content itself rather than looking up the context url"

    Where should I map the context for rendering portlet so that my isse related to Navigational Model url construction based on the context will be resolved.

    2. http://www-01.ibm.com/support/docview.wss?rs=688&uid=swg21411109

    I read this article, but is this not talking about the default portal behavior where in Portal redirects to the first anonymous page in the Home label. So are you suggesting me to create a public page and assign my custom themes to it and place it in first position so that users will be redirected to custom page when the URL is invalid. But in this case, /wps/portal/ always point to this custom page under home label.

    Apart from the above suggested solutions, i have also tried the following.

    1. I have tried writing some serlvet filters and configured with WPS portal by adding the filter definitions in Web.xml files of wps.war and wcm.war fiels under

    C:\IBM\WebSphere\wp_profile\installedApps\<NODENAME>\wps.ear\wps.war
    C:\IBM\WebSphere\wp_profile\config\cells\<NODENAME>\applications\wps.ear\deployments\wps\wps.war\WEB-INF

    And

    C:\IBM\WebSphere\wp_profile\installedApps\<NODENAME>\wcm.ear\ilwwcm.war\WEB-INF
    C:\IBM\WebSphere\wp_profile\config\cells\<NODENAME>\applications\wcm.ear\deployments\wcm\ilwwcm.war\WEB-INF

    I did see in logs, my custom filter is getting executed, but portal is not redirecting to custom error page specified in my filter definition.

    And i also noticed, the response status code as 200/302. But never seen 404.

    2. I added the property "selection.fallback.enabled" and assigned a "false" value in WAS admin console, it dint help me.

    3. Writing rewrite rule, failed. Any help here on how to give solution to my problem is really helps.

    4. Finally, i have created one custom error Jsp file and configured with Web Content Viewer portlet. So when ever the requested URL does not exist. Web Content Viewer portlet will display the custom error page where in i have given a link for the end user to fall back to my applications home page.
    Appreciate your help.

    Thanks,
    Suresh
  • SureshR19
    SureshR19
    11 Posts

    Re: Redirecting to a custom error page when HTTP 404 encountered-WPS 7.0.0.1

    ‏2012-03-05T17:56:31Z  
    • SureshR19
    • ‏2012-02-22T13:01:44Z
    Thanks for your reply Bhagwan

    1. Could you please elaborate the below statement.

    "Try mapping the context in your rendering portlet, so that it looks for the content itself rather than looking up the context url"

    Where should I map the context for rendering portlet so that my isse related to Navigational Model url construction based on the context will be resolved.

    2. http://www-01.ibm.com/support/docview.wss?rs=688&uid=swg21411109

    I read this article, but is this not talking about the default portal behavior where in Portal redirects to the first anonymous page in the Home label. So are you suggesting me to create a public page and assign my custom themes to it and place it in first position so that users will be redirected to custom page when the URL is invalid. But in this case, /wps/portal/ always point to this custom page under home label.

    Apart from the above suggested solutions, i have also tried the following.

    1. I have tried writing some serlvet filters and configured with WPS portal by adding the filter definitions in Web.xml files of wps.war and wcm.war fiels under

    C:\IBM\WebSphere\wp_profile\installedApps\<NODENAME>\wps.ear\wps.war
    C:\IBM\WebSphere\wp_profile\config\cells\<NODENAME>\applications\wps.ear\deployments\wps\wps.war\WEB-INF

    And

    C:\IBM\WebSphere\wp_profile\installedApps\<NODENAME>\wcm.ear\ilwwcm.war\WEB-INF
    C:\IBM\WebSphere\wp_profile\config\cells\<NODENAME>\applications\wcm.ear\deployments\wcm\ilwwcm.war\WEB-INF

    I did see in logs, my custom filter is getting executed, but portal is not redirecting to custom error page specified in my filter definition.

    And i also noticed, the response status code as 200/302. But never seen 404.

    2. I added the property "selection.fallback.enabled" and assigned a "false" value in WAS admin console, it dint help me.

    3. Writing rewrite rule, failed. Any help here on how to give solution to my problem is really helps.

    4. Finally, i have created one custom error Jsp file and configured with Web Content Viewer portlet. So when ever the requested URL does not exist. Web Content Viewer portlet will display the custom error page where in i have given a link for the end user to fall back to my applications home page.
    Appreciate your help.

    Thanks,
    Suresh
    I fixed the issue by updating below preferences of Web Content Viwer Portlet in Portal admin console using configure mode of the portlet.
    1. WCM_BROADCASTS_TO

    From: WCM_LINKING_DYNAMIC

    TO: WCM_LINKING_NONE

    2. WCM_LISTENS_TO

    From: WCM_LINKING_OTHER

    To: WCM_LINKING_NONE

    Also update all navigational model tag url's to have "keepNavigationalState" attribute added and set its value to false.

    Thanks,
    Suresh Ravuru.
  • SureshR19
    SureshR19
    11 Posts

    Re: Redirecting to a custom error page when HTTP 404 encountered-WPS 7.0.0.1

    ‏2012-03-05T17:57:43Z  
    Update the web content viwer portlet preferences and add keepNavigationalState attribute by setting its value to false to all portal navigational model url tags.