Hy there,

Yes I know I have posted about this problem earlier in this thread but our 
project will end soon and the problem still is present:

The problem is that the output encoding of the exception page rendered by the 
ExceptionPresenter is broken. Following situation (code below):

When an exception occurs in a listener method, we catch it and throw a 
PageRedirectException to the err page of our application. Everything is fine. 
But when the exception occurs in the getModel() method (e.g. when the page is 
initially called), the PageRedirectException thrown is wrapped into a 
BindingException. This exception goes further on and is handled by the tapestry 
exception presenter. 

I have taken the source of the tapestry exception presenter and implemented an 
custom class. Then I configured hivemind to use this custom exception presenter 
(via infrastructure overrides). The code og the custom exception presenter is 
100% the same to that of Howard I only put some debug output to it before 
responseRenderer.renderResponse( cycle ) is called.
        
        ContentType type = errPage.getResponseContentType();
        
        System.out.println( "1> " + cycle.getEngine().getOutputEncoding() );
        System.out.println( "2> " + type.getParameter( CHARSET_PARAM_NAME ) );

        CONSOLE-OUTPUT:
                1> UTF-8
                2> null
                
The BindingException now handled by the custom ExceptionPresenter (or the 
tapestry ExceptionPresenter, which makes no difference) renders the ErrPage. 
Problem is that this this ErrPage is not rendered in UTF-8. It is rendered in 
ISO-8859-1, so all german special chars are broken, which means a really ugly 
picture on the browser, because we do not use @Shell component and output 
encoding 
        
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

is hard coded in HTML Template.

Any ideas where to go????

-------------------------------------------------------------

(1) Page spec
<page>
        ...
        
        <component type="PropertySelection">
                <binding name="model" value="getModel()" />
        </component>

        ...
</page>

-------------------------------------------------------------

(2) In Java class

public void someListener()
{
        try
        {
                // do something
        }
        catch( Exception e )
        {
                ErrPage errPage = getErrPage();
                errPage.setErr( e );

                throw PageRedirectException( errPage );
        }
}

@InjectPage( "ErrPage" )
public abstract ErrPage getErrPage();

public IPropertySelectionModel getModel()
{
        try
        {
                // init and return model
        }
        catch ( Exception e )
        {
                ErrPage errPage = getErrPage();
                errPage.setErr( e );

                throw PageRedirectException( errPage );
        }
}

-------------------------------------------------------------


Mit lieben Grüßen aus dem eWerk

  |  Holger Stolzenberg
  |  Softwareentwickler
  |
  |  Geschäftsführer: 
  |  Frank Richter, Erik Wende, Hendrik Schubert
  |
  |  eWerk IT GmbH
  |  Markt 16
  |  Leipzig 04109
  |  http://www.ewerk.com
  |  HRB 9065, AG Leipzig
  |  Hauptniederlassung Leipzig
  |
  |  fon +49.341.4 26 49-0
  |  fax +49.341.4 26 49-88
  |  mailto:[EMAIL PROTECTED]
  |
  |  Support:
  |  fon 0700 CALLME24 (0700 22556324)
  |  fax 0700 CALLME24 (0700 22556324)
  |
  | Auskünfte und Angebote per Mail
  | sind freibleibend und unverbindlich. 

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

Reply via email to