The JSP compile should fail in that case. 

-----Original Message-----
From: Pitre, Russell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 14, 2004 12:38 PM
To: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] Throwing exception question....


Yah, I have my MaxNumberOfRequestsException class extending Exception
already......still not sure what it is....

Still baffled!

Russ



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian
Brock
Sent: Wednesday, January 14, 2004 2:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Throwing exception question....

You'll need:

public class MaxNumberOfRequestsException extends Exception rather than
extends RuntimeException 
or whatever you are using to avoid declaring it as being thrown.

RuntimeExceptions and Errors do not need to be handled.

Regards,
Adrian

On Wed, 2004-01-14 at 19:07, Pitre, Russell wrote:
> Hello All-
> 
>  
> 
> Using: jboss3.2.3-tomcat
> 
>  
> 
> I have a class that will throw a user defined exception.
> 
>  
> 
> My method:
> 
> public ArrayList getPersistableObjects (String className, String keys)

> {
> 
> if(cachelessKeyValues.length() > MAX_NUMBER_OF_REQUESTS) {
> 
> throw new MaxNumberOfRequestsException("Request exceeds maximum number

> of requests (" + MAX_NUMBER_OF_REQUESTS + ")");
> 
> }else{
> 
>             ....do my stuff
> 
> }
> 
> }
> 
>  
> 
> I am wrapping this class with an ejb.  I want to force my front end 
> developers to use a try catch statement to catch this exception in 
> their jsp's.  I have the remote interface and the bean class itself 
> throwing the exception up the line....
> 
>  
> 
> BEAN CLASS:
> 
>  
> 
> public ArrayList getPersistableObjects(String className, String keys) 
> throws MaxNumberOfRequestsException{
> 
> return Mule.getInstance().getPersistableObjects(className, keys);
> 
> }
> 
> INTERFACE:
> 
>  
> 
> public ArrayList getPersistableObjects (String className, String keys)

> throws MaxNumberOfRequestsException, java.rmi.RemoteException;
> 
>  
> 
>  
> 
> Everything compiles and works fine except that when the jsp compiles, 
> it does not force you to catch MaxNumberOfRequestsException
> 
>  
> 
>  
> 
> Any ideas?  I've been banging my head all day with this.....
> 
> Russ
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to