|
From: Rogan D. <ro...@da...> - 2008-01-30 10:38:24
|
Jan Hoskens wrote: > Normally when any Exception pops up during the setting of a value, the > exception is caught by the DefaultFormModel.ValidatingFormValueModel > class and transformed to a bindingError. So if you get a error in your > message area, it probably came from there. Note that there are some > issues here: all listeners attached to the value change may also throw > exceptions that are handled in the same manner. I did suggest a change > here to provide an explicit binding exception that can be thrown in the > accessStrategy to separate the good from the bad (so to speak). Normally > this error should disappear if the value being set doesn't generate any > exception. Does this work as expected? Yes, the methodInvocation comes and goes as I type valid and invalid input. > The getting of a value is another story. I don't think any handling is > available at that point so an exception will probably be caught by the > ExceptionHandler that you provide in your context. Mmm. I guess I should rather return "null", instead of throwing the exception. This would fit in with the PropertyChangeEvent I fire when someone changes the "rawBody" in such a way as to make "getDecodedBody()" throw an exception. > The developer blog was started by Peter. He could add you as a writer to > the blog or we could post it in your name after a quick review. It would > be nice to see some more stuff explained there. Either way would be good, although perhaps putting it up on the website is a better idea, as suggested. (Probably the "quick review" would be a good idea!) > Additionally I've checked your project's website. It seems to be open > source so I'm thinking of checking it out. It would be easier to > actually see the problem than to write about it. I guess this isn't a > problem? This particular piece of code has not been published yet, of course. And in fact, I am working on reimplementing the underpinnings (i.e. rewriting the Message/Request/Response objects) at the moment, which will eventually make its way into the mainline. Of course, I'd love to get feedback on how I've done various things such as constructing custom forms, etc. e.g. in one form I present the Request as a TreeModel, with the request line and subsequent headers as top level nodes (root is hidden), and the ability to expand the requestLine to see/modify the values of any URL parameters, and similarly for any Cookie headers (which often have more than one cookie in a single header). You can browse the code using gitweb (http://dawes.za.net/gitweb.cgi?p=rogan/webscarab-ng/webscarab-ng.git) then follow the "tree" link). The "Request as a Tree" form is at: <http://dawes.za.net/gitweb.cgi?p=rogan/webscarab-ng/webscarab-ng.git;a=blob;f=src/main/java/org/owasp/webscarab/ui/rcp/forms/ParsedRequestForm.java;h=db2769a1c73ddb680cdf4bf0ce4b43a28e1076b3;hb=HEAD> if you want to see some seriously kludgy code :-) Suggestions much appreciated! Rogan |