Most likely the error wasn't detected until the page had been
"committed".  Once the headers and the first part of the page have
been sent to the browser, there's no way to "recall" them to display
the error page, so the best that can be done is adding the error to
the bottom.

One way to prevent this is to do things that are likely to fail near
in the Action and just make the data available to the view.  Or by
doing things that might fail near the top of the page, can sometimes
help as well.
  (*Chris*)

On 10/5/07, josephcjis <[EMAIL PROTECTED]> wrote:
>
> In my web.xml I have this mapping:
>
> <error-page>
>    <exception-type>java.lang.Throwable</exception-type>
>    <location>/error.jsp</location>
> </error-page>
>
> However, sometimes when an exception occurs while trying to access some
> property on the ognl stack (in this case a
> org.hibernate.LazyInitializationException caused when I do <s:iterator>) the
> error page is appended to my jsp from the point where the <s:iterator> tag
> is rather than forwarding to error.jsp like I think it should.  At first I
> thought the problem could be that the exception wasnt being thrown until the
> response was already committed but I followed the advice at
> (http://scriptlandia.blogspot.com/2006/06/how-to-handle-jsp-error-page.html)
> to set the <%@ page buffer="1024kb"%> and <%@ page autoFlush="false"%> and
> this made no difference.
>
> I have included my complete web.xml
>
> Thanks for your insights
>
> -joseph
>
> -------------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="person" 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";>
>
>   <context-param>
>     <param-name>contextConfigLocation</param-name>
>
> <param-value>classpath:spring_config/applicationContext.xml</param-value>
>   </context-param>
>
>   <filter>
>     <filter-name>struts2</filter-name>
>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>   </filter>
>
>   <filter>
>     <filter-name>entityManager</filter-name>
>
> <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
>   </filter>
>
>   <filter-mapping>
>     <filter-name>entityManager</filter-name>
>     <url-pattern>*.action</url-pattern>
>   </filter-mapping>
>
>   <filter-mapping>
>     <filter-name>struts2</filter-name>
>     <url-pattern>*.action</url-pattern>
>   </filter-mapping>
>
>   <listener>
>
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>   </listener>
>
>   <welcome-file-list>
>     <welcome-file>home.action</welcome-file>
>     <welcome-file>redirect.html</welcome-file>
>   </welcome-file-list>
>
>   <error-page>
>     <exception-type>java.lang.Throwable</exception-type>
>     <location>/error.jsp</location>
>   </error-page>
>
>   <jsp-config>
>     <taglib>
>       <taglib-uri>struts-tags</taglib-uri>
>       <taglib-location>/WEB-INF/struts-tags.tld</taglib-location>
>     </taglib>
>   </jsp-config>
>
>   <resource-ref>
>     <res-ref-name>jdbc/IPTracker_DS</res-ref-name>
>     <res-type>javax.sql.DataSource</res-type>
>     <res-auth>Container</res-auth>
>   </resource-ref>
>
>   <security-constraint>
>     <web-resource-collection>
>         <web-resource-name>readonlyaction</web-resource-name>
>         <url-pattern>home.action</url-pattern>
>         <url-pattern>listSegmentPurposes.action</url-pattern>
>         <url-pattern>listSegmentsForPurpose.action</url-pattern>
>         <url-pattern>viewSegment.action</url-pattern>
>         <url-pattern>editAddresses.action</url-pattern>
>         <url-pattern>searchForAddress.action</url-pattern>
>         <url-pattern>*.html</url-pattern>
>     </web-resource-collection>
>      <auth-constraint>
>       <role-name>Readonly</role-name>
>       <role-name>Admin</role-name>
>     </auth-constraint>
>   </security-constraint>
>
>   <security-constraint>
>     <web-resource-collection>
>         <web-resource-name>adminaction</web-resource-name>
>         <url-pattern>*.action</url-pattern>
>         <url-pattern>*.html</url-pattern>
>     </web-resource-collection>
>      <auth-constraint>
>       <role-name>Admin</role-name>
>     </auth-constraint>
>   </security-constraint>
>
>   <login-config>
>     <auth-method>FORM</auth-method>
>     <form-login-config>
>       <form-login-page>/login.html</form-login-page>
>       <form-error-page>/loginError.html</form-error-page>
>     </form-login-config>
>   </login-config>
>
>    <security-role>
>     <role-name>Readonly</role-name>
>   </security-role>
>
>   <security-role>
>     <role-name>Admin</role-name>
>   </security-role>
>
>   <security-role>
>     <role-name>SysAdmin</role-name>
>   </security-role>
>
> </web-app>
> --
> View this message in context: 
> http://www.nabble.com/why-would-error-page-be-*appended*-to-my-jsp--tf4577992.html#a13068496
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to