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 12:11:27 UTC

[jira] Created: (WICKET-2745) Add info about SubmittingButton to RequestLogger

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 witch 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.


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

Posted by "Fridolin Jackstadt (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Fridolin Jackstadt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833795#action_12833795 ] 

Fridolin Jackstadt commented on WICKET-2745:
--------------------------------------------

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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Fridolin Jackstadt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fridolin Jackstadt updated WICKET-2745:
---------------------------------------

    Attachment: logger.zip

> 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
>         Attachments: logger.zip
>
>
> 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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-2745:
----------------------------------

    Fix Version/s: 1.5-M1

the patch is a little too intrusive. we should see if this is cleanly solvable in 1.5

> 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
>             Fix For: 1.5-M1
>
>         Attachments: form_logging.patch, logger.zip
>
>
> 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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Jeremy Thomerson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Thomerson updated WICKET-2745:
-------------------------------------

    Fix Version/s:     (was: 1.5-M3)
                   1.5-M4

> 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
>             Fix For: 1.5-M4
>
>         Attachments: form_logging.patch, logger.zip
>
>
> 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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-2745:
----------------------------------

    Fix Version/s: 1.5-M3
                       (was: 1.5-M2)

> 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
>             Fix For: 1.5-M3
>
>         Attachments: form_logging.patch, logger.zip
>
>
> 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.


[jira] Commented: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Fridolin Jackstadt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833943#action_12833943 ] 

Fridolin Jackstadt commented on WICKET-2745:
--------------------------------------------

- The first errror occurs if the form has been replaced in the page during the onsubmit-procedure
- The second is related to multipart-forms. It is NOT reproducible with wicketTester, only directly in jetty

> 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
>         Attachments: logger.zip
>
>
> 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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Fridolin Jackstadt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fridolin Jackstadt updated WICKET-2745:
---------------------------------------

    Description: 
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("]");
		}

  was:
Most forms have cancel and submit. It would be very useful to see in the requestlog witch 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("]");
		}


> 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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Fridolin Jackstadt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fridolin Jackstadt updated WICKET-2745:
---------------------------------------

    Attachment: form_logging.patch

this patch adds a log call to the form class.
i would propose to do it that way, because the logging calls from AbstractRequestCycleProcessor are before the parsing of a multipart-request and after the event processing.
If the form is removed from page during event processing and the name of the submitting button lies in a multipart-request, i think it is not possible to get information about the submitting component to log it.

Therefore i added a call to the logger from the form class to resolve this issue.

The patch is for the 1.4.x branch

> 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
>         Attachments: form_logging.patch, logger.zip
>
>
> 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.


[jira] Commented: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833770#action_12833770 ] 

Juergen Donnerstag commented on WICKET-2745:
--------------------------------------------

your code doesn't even compile on my 1.4 trunk. What about the modified version below ...

			if (listener.getTarget() instanceof Form<?>)
			{
				sb.append(", button: ");

				Form<?> form = (Form<?>)listener.getTarget();
				IFormSubmittingComponent submittingComponent = form.findSubmittingButton();
				sb.append(submittingComponent.getInputName());
				sb.append(" (form: ");
				sb.append(form.getPageRelativePath());
				sb.append(")");
			}


> 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.


[jira] Updated: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg updated WICKET-2745:
----------------------------------

    Fix Version/s: 1.5-M2
                       (was: 1.5-M1)

> 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
>             Fix For: 1.5-M2
>
>         Attachments: form_logging.patch, logger.zip
>
>
> 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.


[jira] Commented: (WICKET-2745) Add info about SubmittingButton to RequestLogger

Posted by "Juergen Donnerstag (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12833844#action_12833844 ] 

Juergen Donnerstag commented on WICKET-2745:
--------------------------------------------

mind you creating a quickstart with junit tests for the different use cases. Thanks.

> 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.