[xwiki-users] Problem with action_xyz parameter in URL

2013-09-30 Thread Edo Beutler
Hi

I have a problem with a URL containing a parameter of the form
action_...=... The page does not load with this parameter. For an example
see the xwiki.org start page (
http://www.xwiki.org/xwiki/bin/view/Main/WebHome?action_xyz).
The parameter action_... seems to be used for something, but I couldn't
find anything on what exactly and on how I can work around that.
Unfortunately this URL is created by an external source (Facebook), so I
can't change it.

Can somebody point me in the right direction?

Thanks,
Edo
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Problem with action_xyz parameter in URL

2013-09-30 Thread Vincent Massol
Hi,

On Sep 30, 2013, at 3:06 PM, Edo Beutler ebeut...@synventis.com wrote:

 Hi
 
 I have a problem with a URL containing a parameter of the form
 action_...=... The page does not load with this parameter. For an example
 see the xwiki.org start page (
 http://www.xwiki.org/xwiki/bin/view/Main/WebHome?action_xyz).
 The parameter action_... seems to be used for something, but I couldn't
 find anything on what exactly and on how I can work around that.
 Unfortunately this URL is created by an external source (Facebook), so I
 can't change it.
 
 Can somebody point me in the right direction?

I've just grepped the whole source code and I've found this:

In ActionFilter.java:

...
if (parameter.startsWith(ACTION_PREFIX)) {
…

where:

/** The query property name prefix that indicates the target action. */
private static final String ACTION_PREFIX = action_;

This code is in a Filter. FTR here's its javadoc:

 * A filter that dispatches requests to the right action, depending on the 
button that was pressed in the editing form.
 * This is needed since the browser cannot send the form data to different URLs 
depending on the button pressed, and an
 * XHTML form has only one target URL. In previous versions of XWiki this was 
accomplished using javascript code, with a
 * fall-back on a pseudo-dispatcher inside the {@link PreviewAction}, which was 
on obvious case of bad code design.
 * /p
 * p
 * The filter dispatches requests based on the presence of a request parameter 
starting with ttaction_/tt followed
 * by the name of the struts action that should actually process the request. 
For example, the button that does
 * ttSave and Continue/tt looks like:
 * 
 * pre
 * lt;input type=quot;submitquot; name=quot;action_saveandcontinuequot; 
value=quot;...quot;/gt;
 * /pre
 * 
 * As a result, when clicking the button, the request is not sent to the form's 
target (ttpreview/tt), but is
 * actually forwarded internally to tt/bin/saveandcontinue/The/Document/tt.
 * /p


Hope it helps,
-Vincent

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Problem with action_xyz parameter in URL

2013-09-30 Thread Edo Beutler
Thank you Vincent

Since I was not sure if this comes from XWiki or somewhere below I forgot
the obvious solution - to search the source.



On Mon, Sep 30, 2013 at 3:17 PM, Vincent Massol vinc...@massol.net wrote:

 Hi,

 On Sep 30, 2013, at 3:06 PM, Edo Beutler ebeut...@synventis.com wrote:

  Hi
 
  I have a problem with a URL containing a parameter of the form
  action_...=... The page does not load with this parameter. For an example
  see the xwiki.org start page (
  http://www.xwiki.org/xwiki/bin/view/Main/WebHome?action_xyz).
  The parameter action_... seems to be used for something, but I couldn't
  find anything on what exactly and on how I can work around that.
  Unfortunately this URL is created by an external source (Facebook), so I
  can't change it.
 
  Can somebody point me in the right direction?

 I've just grepped the whole source code and I've found this:

 In ActionFilter.java:

 ...
 if (parameter.startsWith(ACTION_PREFIX)) {
 …

 where:

 /** The query property name prefix that indicates the target action. */
 private static final String ACTION_PREFIX = action_;

 This code is in a Filter. FTR here's its javadoc:

  * A filter that dispatches requests to the right action, depending on the
 button that was pressed in the editing form.
  * This is needed since the browser cannot send the form data to different
 URLs depending on the button pressed, and an
  * XHTML form has only one target URL. In previous versions of XWiki this
 was accomplished using javascript code, with a
  * fall-back on a pseudo-dispatcher inside the {@link PreviewAction},
 which was on obvious case of bad code design.
  * /p
  * p
  * The filter dispatches requests based on the presence of a request
 parameter starting with ttaction_/tt followed
  * by the name of the struts action that should actually process the
 request. For example, the button that does
  * ttSave and Continue/tt looks like:
  *
  * pre
  * lt;input type=quot;submitquot;
 name=quot;action_saveandcontinuequot; value=quot;...quot;/gt;
  * /pre
  *
  * As a result, when clicking the button, the request is not sent to the
 form's target (ttpreview/tt), but is
  * actually forwarded internally to
 tt/bin/saveandcontinue/The/Document/tt.
  * /p


 Hope it helps,
 -Vincent

 ___
 users mailing list
 users@xwiki.org
 http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users