shale-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "lily (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SHALE-250) Custom Error Page doesn't work when used with Clay
Date Wed, 16 Aug 2006 07:27:30 GMT
    [ http://issues.apache.org/struts/browse/SHALE-250?page=comments#action_37964 ] 
            
lily commented on SHALE-250:
----------------------------

Thank you for your help, Gary. It works now.  I started with shale-clay-usecases-20060809(nightly
build) ,  My web.xml which doesn't work is like this:

<?xml version="1.0" encoding="UTF-8"?>
<!--

 Copyright 2004-2005 The Apache Software Foundation.
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 
      http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

-->
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee                      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  <display-name>Shale Clay Usecases App</display-name>

 
  <!-- JSF RI verify objects at start -->
  <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>true</param-value>
  </context-param>

  <!-- Select JSF State Saving Mode -->
 <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>

  <!-- Commons Chain Configuration Resources -->
  <context-param>
    <param-name>org.apache.commons.chain.CONFIG_WEB_RESOURCE</param-name>
    <param-value>/WEB-INF/chain-config.xml</param-value>
  </context-param>


  
   <!-- Clay Common Configuration Resources -->
   <context-param>
      <param-name>org.apache.shale.clay.COMMON_CONFIG_FILES</param-name>
      <param-value>/WEB-INF/clay-config.xml</param-value>
   </context-param>

  
  
  <!-- Shale Application Controller Filter -->
  <filter>
    <filter-name>shale</filter-name>
    <filter-class>
      org.apache.shale.faces.ShaleApplicationFilter
    </filter-class>
  </filter>
 

  <!-- Shale Application Controller Filter Mapping -->
  <filter-mapping>
    <filter-name>shale</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>


  <!-- Commons Chain Configuration Listener -->
  <listener>
    <listener-class>
      org.apache.commons.chain.web.ChainListener
    </listener-class>
  </listener>



  <!-- JavaServer Faces Servlet Configuration -->
  <servlet>
    <servlet-name>faces</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>


  <!-- JavaServer Faces Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>

  <!-- JavaServer Faces Servlet Mapping for Clay HTML Full View --> 
  <servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>

  <!-- JavaServer Faces Servlet Mapping for Clay XML Full View --> 
  <servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.xml</url-pattern>
  </servlet-mapping>

  <!-- Welcome File List -->
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>

 
	

  <error-page>
    <error-code>404</error-code>
    <location>/html/main/error.html</location>
  </error-page>

 
</web-app>



I didn't set javax.faces.DEFAULT_SUFFIX. Now, I add the following to web.xml

 <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.html</param-value>
  </context-param>

Then it works.


> Custom Error Page doesn't work when used with Clay
> --------------------------------------------------
>
>                 Key: SHALE-250
>                 URL: http://issues.apache.org/struts/browse/SHALE-250
>             Project: Shale
>          Issue Type: Bug
>          Components: Clay
>    Affects Versions: 1.0.3-SNAPSHOT
>         Environment: jboss4.0.1sp1
>            Reporter: lily
>
> If the cutom error page defined in web.xml ends with suffixes that match clay template
suffixes, it can't display.
> Maybe it's because ClayViewHandlerCommand doesn't execute so that the request attribute
Globals.CLAY_FULL_VIEW_SUFFIX can't be set when web server redirects to  custom error page.
> If My custom error page is defined like this:
>  <servlet-mapping>
>     <servlet-name>faces</servlet-name>
>     <url-pattern>*.html</url-pattern>
>   </servlet-mapping>
>     <servlet-mapping>
>     <servlet-name>faces</servlet-name>
>     <url-pattern>*.xml</url-pattern>
>   </servlet-mapping>
>    
>    <error-code>404</error-code>
>     <location>/error.jsp</location>
>   </error-page>
> The error page can display, but if I replace the error.jsp with "/error.html", it can't
 disply

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message