You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Skondras Panagiotis <pa...@acn.gr> on 2001/04/23 11:12:47 UTC

Excpeption Handling

Hello i am trying to catch an Exception and show a Screen
I have set the Template.error and screen.error in the TR.props
i have created the java stuff.
When i cause an Exception by mispeling a template i go to my screen
when i throw an Exception from code i get a white screen
and nothing else
and  my Error.java screen is never executed because i have put a
System.err
any ideas


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Excpeption Handling

Posted by Skondras Panagiotis <pa...@acn.gr>.

Here is a chunk of code
the TR.props looks like this

# This is the template that is used by the respective Template based
# ErrorScreen for displaying the error. If you are not using a Template
based
# ErrorScreen, then this is ignored.
#
# Default: /Error.vm

#template.error=/Error.vm

# This is the default error screen.
#
# Default: VelocityErrorScreen

screen.error=error.Error

---------------------------------
The Error Screen looks like this

package something.screens.error;

 public void doBuildTemplate( RunData data, Context context )throws
Exception{
        System.err.println("IN ERROR PAGE ");
        data.setMessage("This is an Error");
        this.doRedirect(data,"error/Error1.vm");
    }
-------------------------------
The Error1.vm looks like this
is in screens.error

$data.getMessage()<br>
ERROR PAGE 1





John McNally wrote:

> I did not follow the logic all the way through, but I did get an
> Error.java screen working you; just
> need to NOT also define the template.error property.  If you are wanting
> to use a template error screen, and it requires that data be placed into
> the context by a java class, you need to follow the naming convention

What is the naming convention?

>
> (or possibly a bug needs fixed.)
>

The same stuff was working with tdk1.10 because i have implemented
something else there and it was working

>
> john mcnally
>

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Excpeption Handling

Posted by John McNally <jm...@collab.net>.
I did not follow the logic all the way through, but I did get an
Error.java screen working you; just
need to NOT also define the template.error property.  If you are wanting
to use a template error screen, and it requires that data be placed into
the context by a java class, you need to follow the naming convention
(or possibly a bug needs fixed.)

john mcnally

Skondras Panagiotis wrote:
> 
> Hello i am trying to catch an Exception and show a Screen
> I have set the Template.error and screen.error in the TR.props
> i have created the java stuff.
> When i cause an Exception by mispeling a template i go to my screen
> when i throw an Exception from code i get a white screen
> and nothing else
> and  my Error.java screen is never executed because i have put a
> System.err
> any ideas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org