Issue WICKET-4223 <https://issues.apache.org/jira/browse/WICKET-4223>
 created.

On 10 November 2011 18:04, Igor Vaynberg <[email protected]> wrote:

> not that strange. the base url (unless something like a portlet
> container completely reencodes it) includes the listener interface
> which is the ?foo part, thus we do not bother checking for ? in the
> url.
>
> -igor
>
> On Thu, Nov 10, 2011 at 12:25 AM, Martin Grigorov <[email protected]>
> wrote:
> > Hi,
> >
> > Please create a ticket in Jira with this patch.
> > It is strange it didn't break so far in non-portlet environments
> >
> > On Thu, Nov 10, 2011 at 1:28 AM, José Antonio Matute Calvo
> > <[email protected]> wrote:
> >> Hi!,
> >>
> >> Recently, when we were developing an application for IBM WebSphere
> Portal
> >> 6.1 (JSR286 Portlet) using Wicket 1.4.18, we had problems with forms
> that
> >> use AjaxButton component for submitting.
> >>
> >> After some investigations, we realized that the problem was on the
> >> javascript side (wicket-ajax.js).  The url encoded by IBM WebSphere
> Portal
> >> 6.1 has the following pattern:
> >>
> >> /wps/myportal/!ut/p/c5/_very_very_long_string_ended_with_a_slash/
> >>
> >> and when wicket-ajax.js do the submit, builds the following url
> >>
> >>
> /wps/myportal/!ut/p/c5/_very_very_long_string_ended_with_a_slash/&wicket:ajax=true
> >>
> >> As you can see, this is an invalid URL: after the / must be an ? not an
> &
> >>
> >> Fortunately, the solutions is easy. Here are the patch:
> >>
> >> Index: wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
> >> ===================================================================
> >> --- wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js (revision
> >> 1176907)
> >> +++ wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js (working
> >> copy)
> >> @@ -1192,7 +1192,7 @@
> >>
> >>  // reconfigure the form
> >>  form.target=iframe.name;
> >> - form.action=this.request.url + "&wicket:ajax=true";
> >> + form.action=this.request.url + (this.request.url.indexOf("?")>-1 ?
> "&" :
> >> "?") + "wicket:ajax=true";
> >>  form.method="post";
> >>  form.enctype="multipart/form-data";
> >>  form.encoding="multipart/form-data";
> >>
> >> do you think this solution is fine? If it is, can this fix be included
> in
> >> the next release of wicket 1.4.x?
> >>
> >> Best regards,
> >>
> >> José Antonio Matute
> >>
> >> keen*soft
> >> *email:  [email protected]
> >> web:     http://www.keensoft.es
> >>
> >> CONFIDENCIALIDAD:
> >>
> >> La presente comunicación y, en su caso, los ficheros que lleve adjuntos,
> >> pertenecen exclusivamente a las personas a las que va dirigido y puede
> >> contener información confidencial. Si usted no es el destinatario de
> este
> >> mensaje (o la persona responsable de su entrega), considérese advertido
> de
> >> que lo ha recibido por error y que cualquier uso, difusión, reenvío o
> copia
> >> están prohibidos legalmente. Si ha recibido este mensaje por error, por
> >> favor notifíquelo al remitente y proceda a destruirlo inmediatamente.
> >>
> >> This message and the attached documents may contain
> privileged/confidential
> >> information and intended solely for the use of the individual to whom
> it is
> >> addressed. If you are not the intended recipient (or responsible for
> >> delivery of the message to such a person) be advised that you have
> received
> >> this message in error and that any use, dissemination, forwarding,
> printing
> >> or copying of this e-mail is strictly prohibited. If you have received
> this
> >> message in error please notify it to the sender and destroy it
> immediately
> >>
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com
> >
>

Reply via email to