Issue 1:
Matthew Sgarlata opened SPR-860 and commented

I want to be able to see the arguments to and return values of the methods in my service and DAO objects. The TraceInterceptor did not support this functionality, so I wrote it and prepared a patch for potential inclusion in Spring. With no configuration parameters specified, log messages will appear as they did in Spring 1.0.2. The new enterMessageTemplate and exitMessageTemplate properties allow for customization.

In my application I set my enterMessageTemplate to "Entering $unqualifiedTargetClassName.$methodName($arguments)" and my exitMessageTemplate to "$unqualifiedTargetClassName.$methodName($arguments) returned $returnValue". This results in log output such as:

DEBUG (TraceInterceptor:invoke) - Entering OwnerUpdaterServiceImpl.getOwnerMetricsByUser(39,-1,5,database1110394538812,org.apache.catalina.session.StandardSessionFacade@1dbe1c9)

DEBUG (TraceInterceptor:invoke) - Entering OwnerUpdaterDAOImpl.getOwnerMetricsByUser(39,-1,5,database1110394538812)

DEBUG (JdbcTemplate:query) - Executing SQL query [select mc.metricid, mc.scorecardnodeid, mc.updatetype, mc.datatype, mc.aggregationtype, mc.equation, mc.lastreminded, mc.calendarid, sn.scorecardnodename, sn.scorecardrootnodeid, mc.calendarperiodid, ms.score, mv.actualvalue, sn.weighting, mv.goal, mc.goal as mgoal, mv.base, mc.base as mbase, mv.metricvalueid, s.organizationnodeid, mc.periodalias, mc.startdate, mc.enddate, cal.calendarname from ((((((select m.*, cp1.calendarperiodid, cp1.startdate, cp1.enddate, cp1.periodalias from metrics m, calendarperiods cp1, calendarperiods cp2 where m.calendarid = cp1.calendarid and cp2.calendarperiodid=? and ( (cp1.startdate >= cp2.startdate and cp1.startdate <= cp2.enddate) or (cp1.enddate >= cp2.startdate and cp1.enddate <= cp2.enddate) or (cp1.startdate < cp2.startdate and cp1.enddate > cp2.enddate) ) ) mc left outer join metricvalues mv on (mc.metricid = mv.metricid and mc.calendarperiodid = mv.calendarperiodid)) left outer join metricscores ms on (mc.metricid = ms.metricid and mc.calendarperiodid = ms.calendarperiodid)) left join scorecardnodes sn on (mc.scorecardnodeid = sn.scorecardnodeid)) left join scorecards s on (sn.scorecardrootnodeid = s.scorecardrootnodeid)) left join scorecardnodeownerusers sou on (mc.scorecardnodeid = sou.scorecardnodeid)) left join calendars cal on (mc.calendarid = cal.calendarid) where sou.userid = ? order by sn.scorecardnodename]

DEBUG (StatementCreatorUtils:setParameterValue) - Setting SQL statement parameter value: columnIndex 1, parameter value [39], valueClass [java.lang.Integer], sqlType unknown

DEBUG (StatementCreatorUtils:setParameterValue) - Setting SQL statement parameter value: columnIndex 2, parameter value [-1], valueClass [java.lang.Integer], sqlType unknown

DEBUG (TraceInterceptor:invoke) - OwnerUpdaterDAOImpl.getOwnerMetricsByUser(39,-1,5,database1110394538812) returned []

DEBUG (TraceInterceptor:invoke) - OwnerUpdaterServiceImpl.getOwnerMetricsByUser(39,-1,5,database1110394538812,org.apache.catalina.session.StandardSessionFacade@1dbe1c9) returned []

PS - I know service objects shouldn't have HttpSessions passed to them, I just haven't had time to factor that out of the code at my new company yet!

Affects: 1.2 RC1

Attachments:

TraceInterceptorPatch.txt (7.07 kB)

Issue Links:

#5329 TraceInterceptor enhancements ("duplicates")

1 votes, 2 watchers

Issue 2:
Joseph Vychtrle opened SPR-7910 and commented

Hi,

I've been thinking if it is possible to handle Multipart request that is not an Action request. There is a reason why it seems impossible to me :

only ActionRequest implements getFile() kind of methods

What if I don't use a html form to upload a file and I don't want a view to be rendered after action request, which happens always after the action phase.

What if I want to create a post request (with file(s)) by ajax and use @ResourceMapping handler. How do I get it out of ResourceRequest ?

Thank you very much for your thoughts.

Affects: 3.0.5

Reference URL: http://forum.springsource.org/showthread.php?p=341724

Issue Links:

#12318 Add multipart request support to portlet resource requests ("duplicates")

1 votes, 0 watchers