Jasper error handling extensions

2002-02-12 Thread Martin Kahr

Hi.
 
I want to implement a simple jsp compiler plugin for the eclipse IDE.
After 1 day analyzing the current (tomcat 4.0.2) jasper code I have not
found any hooks where I can install my code to get the jasper error
messages.
Of course I can parse the text message of the exceptions thrown during
parsing and compilation but I think there should be a better way.
 
I think about an special ErrorHandler Interface with a concrete
implementation which provides the same error handling (exception
generation) as the current jasper code (leads to minimal code change and
no change of the current interface).
This Error Handler objects are plugged into the parser eigther through
the Options or JspCompilationContext object. (I think Options is the
better one because the ErrorHandler will not change between 2 jsp files)
 
With this I will be able to implement a special Error Handler (extending
the default one) for my plugin.
 
Possible Interface (first draft):
public interface JasperErrorHandler {
public void handleParseError(Mark mark, String msg) throws
JasperException;
public void handleCompileError(String msg, JspLineMap map) throws
JasperException;
}
 
I looked at the code of some IDE which integrate the jasper compiler.
They are duplicating a large number of the orignal jasper code to get
access to the error messages. I think they have the same problems as I
have.
The problem with this is that on each new Tomcat release (with Jasper
code changes) they have to adopt their code :-(
 
What do you think about this idea ?
 
nice greetings from vienna
 Martin Kahr



Re: Jasper error handling extensions

2002-02-12 Thread Kin-Man Chung

I am in the process of rewriting much of Jasper, and am using an error
handling mechanism very similar in idea to the one you just proposed.
The new jasper would alos support JSR45, which is an interface for source
mapping.  The error handler (and other compiler plugins) can be configured
with a configuration file.

Since the compiler is still in the early implementation stage, I'm open
to any suggestions/requirements that you may have, from IDE integration
point of view.  Thanks.


 Date: Tue, 12 Feb 2002 13:50:07 +0100
 From: Martin Kahr [EMAIL PROTECTED]
 Subject: Jasper error handling extensions
 To: [EMAIL PROTECTED]
 MIME-version: 1.0
 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.
 Importance: Normal
 X-Priority: 3 (Normal)
 X-MSMail-priority: Normal
 Delivered-to: mailing list [EMAIL PROTECTED]
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
 List-Post: mailto:[EMAIL PROTECTED]
 List-Subscribe: mailto:[EMAIL PROTECTED]
 List-Unsubscribe: mailto:[EMAIL PROTECTED]
 List-Help: mailto:[EMAIL PROTECTED]
 List-Id: Tomcat Developers List tomcat-dev.jakarta.apache.org
 
 Hi.
  
 I want to implement a simple jsp compiler plugin for the eclipse IDE.
 After 1 day analyzing the current (tomcat 4.0.2) jasper code I have not
 found any hooks where I can install my code to get the jasper error
 messages.
 Of course I can parse the text message of the exceptions thrown during
 parsing and compilation but I think there should be a better way.
  
 I think about an special ErrorHandler Interface with a concrete
 implementation which provides the same error handling (exception
 generation) as the current jasper code (leads to minimal code change and
 no change of the current interface).
 This Error Handler objects are plugged into the parser eigther through
 the Options or JspCompilationContext object. (I think Options is the
 better one because the ErrorHandler will not change between 2 jsp files)
  
 With this I will be able to implement a special Error Handler (extending
 the default one) for my plugin.
  
 Possible Interface (first draft):
 public interface JasperErrorHandler {
 public void handleParseError(Mark mark, String msg) throws
 JasperException;
 public void handleCompileError(String msg, JspLineMap map) throws
 JasperException;
 }
  
 I looked at the code of some IDE which integrate the jasper compiler.
 They are duplicating a large number of the orignal jasper code to get
 access to the error messages. I think they have the same problems as I
 have.
 The problem with this is that on each new Tomcat release (with Jasper
 code changes) they have to adopt their code :-(
  
 What do you think about this idea ?
  
 nice greetings from vienna
  Martin Kahr


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