struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabe <gj...@yahoo.com>
Subject Re: [action2] Debugging interceptor for devMode
Date Sat, 01 Apr 2006 22:19:16 GMT

Don,

Sounds interesting but I wonder if it can be expanded to be made more flexible:
1) Create an XML result type (is there one already?) and a global result of that type that
is the result that the interceptor forwards to if "debug=true". This XML result type could
(eventually or now) then be used to print XML for a variety of uses (perhaps, such as creating
DWR like javascript objects for AJAX calls or outputting SOAP responses).
2) have an optional parameter to this interceptor that allows you to change the global result.
Thus, you could write your own result that dealt with the debug differently than xml.
3) I wouldn't use the parameter name 'debug' because it is generic and might be used by applications
for other things. We wouldn't want developers to have a debug=true parameter used for other
reasons and then suddenly everything is printed out as XML (maybe printForDebug=true instead?)

As an aside, another thing to consider is whether the interceptor should be part of Struts
or XWork. Since the interceptor itself doesn't really have a web specific scope, I would say
that it really belongs as a contribution to XWork. (Or at least this is the way the relationship
btw XWork and Webwork used to work). 

Gabe



----- Original Message ----
From: Don Brown <mrdon@twdata.org>
To: Struts Developers List <dev@struts.apache.org>
Sent: Friday, March 31, 2006 9:49:37 PM
Subject: [action2] Debugging interceptor for devMode

Sorry, forgot the [action2] tag...

Don Brown wrote:
> I've created an interceptor that I've found invaluable for debugging. 
> When you append "debug=true" to the query string, this interceptor 
> hijacks the normal result and instead, dumps the parameters, context, 
> session, and value stack to the response as XML. Since most browsers 
> know how to handle XML, this is a great tool for getting a view at the 
> data behind the page. The interceptor only works when devMode is set to 
> true.
> 
> I'm putting this in as a ticket[1], because I'd like some feedback 
> first. It is my intention to put this interceptor into the default 
> stack. Since it only engages when devMode is enabled, it should be safe 
> and have little effect on production applications.
> 
> Don
> 
> [1] http://issues.apache.org/struts/browse/WW-1279
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message