You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Fridolin Jackstadt (JIRA)" <ji...@apache.org> on 2010/02/15 14:39:28 UTC

[jira] Issue Comment Edited: (WICKET-2745) Add info about SubmittingButton to RequestLogger

    [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833795#action_12833795 ] 

Fridolin Jackstadt edited comment on WICKET-2745 at 2/15/10 1:38 PM:
---------------------------------------------------------------------

There are still two problems with this solution:

java.lang.IllegalStateException: No Page found for component
at org.apache.wicket.Component.getPage(Component.java:1756)
	at org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:593)
	at org.apache.wicket.protocol.http.RequestLogger.getRequestTargetString(CustomRequestLogger.java:399)
	at org.apache.wicket.protocol.http.RequestLogger.logResponseTarget(CustomRequestLogger.java:364)
	at org.apache.wicket.protocol.http.WebApplication.logResponseTarget(WebApplication.java:304)
	at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
	at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
	at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
	at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
	at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

the other one occurs for multipart forms because findSubmittingButton returns null.

      was (Author: frido-lbm):
    There are still two problems with this solution:

java.lang.IllegalStateException: No Page found for component
at org.apache.wicket.Component.getPage(Component.java:1756)
	at org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:593)
	at de.disy.teleconf.management.wicket.application.CustomRequestLogger.getRequestTargetString(CustomRequestLogger.java:399)
	at de.disy.teleconf.management.wicket.application.CustomRequestLogger.logResponseTarget(CustomRequestLogger.java:364)
	at org.apache.wicket.protocol.http.WebApplication.logResponseTarget(WebApplication.java:304)
	at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
	at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
	at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
	at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
	at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

the other one occurs for multipart forms because findSubmittingButton returns null.
  
> Add info about SubmittingButton to RequestLogger
> ------------------------------------------------
>
>                 Key: WICKET-2745
>                 URL: https://issues.apache.org/jira/browse/WICKET-2745
>             Project: Wicket
>          Issue Type: Improvement
>            Reporter: Fridolin Jackstadt
>
> Most forms have cancel and submit. It would be very useful to see in the requestlog which one has been clicked.
> I tryed something like this but i got an IllegalStateException.
> Is there a chance to fix it?
> if (target instanceof IListenerInterfaceRequestTarget)
> 		{
> 			IListenerInterfaceRequestTarget listener = (IListenerInterfaceRequestTarget)target;
> 			sb.append("Interface[target:");
> 			sb.append(Classes.simpleName(listener.getTarget().getClass()));
> 			sb.append("(");
> 			sb.append(listener.getTarget().getPageRelativePath());
> 			sb.append("), page: ");
> 			sb.append(listener.getPage().getClass().getName());
> 			sb.append("(");
> 			sb.append(listener.getPage().getId());
> 			sb.append("), interface: ");
> 			sb.append(listener.getRequestListenerInterface().getName());
> 			sb.append(".");
> 			sb.append(listener.getRequestListenerInterface().getMethod().getName());
> 			sb.append("- via button ");
> 			if (listener.getTarget() instanceof Form<?>) {
> 			  Form<?> form = (Form<?>) listener.getTarget();
> 			  sb.append(form.findSubmittingButton().getPageRelativePath());
> 			}
> 			sb.append("]");
> 		}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.