Portlet / ServetWebRequest / WICKET-4387 fix - Introduced a bug???

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Portlet / ServetWebRequest / WICKET-4387 fix - Introduced a bug???

Doug Leeper
Troubleshooting my issue where my portlet won't work upon a page refresh, I came across this in ServletWebRequest.

                 if (forwardAttributes != null || errorAttributes != null)
                {
                        if (LOG.isDebugEnabled())
                        {
                                LOG.debug("Setting filterPrefix('{}') to '' because there is either an error or a forward. {}, {}",
                                                new Object[] {filterPrefix, forwardAttributes, errorAttributes});
                        }
                        // the filter prefix is not needed when the current request is internal
                        // see WICKET-4387
  this.filterPrefix = "";   <<<-------- HERE
                } else
                {
                        this.filterPrefix = filterPrefix;
                }


This results in not creating the proper URLs for standard resource classes such as wicket-ajax.js.  The filterPrefix is needed to load the resources.

When actually set to this.filterPrefix = filterPrefix;

My portlet works as expected.

Any idea how to work around this as this is wicket core?  

Can this code check if in a portal and not clear out this value?
Reply | Threaded
Open this post in threaded view
|

Re: Portlet / ServetWebRequest / WICKET-4387 fix - Introduced a bug???

Martin Grigorov-4
Hi,

You may need to introduce PortletWebRequest that borrows code from
ServletWebRequest.
Setup it with WebApplication#newWebRequest()

On Sun, Aug 12, 2012 at 4:44 PM, Doug Leeper <[hidden email]> wrote:

> Troubleshooting my issue where my portlet won't work upon a page refresh, I
> came across this in ServletWebRequest.
>
>                  if (forwardAttributes != null || errorAttributes != null)
>                 {
>                         if (LOG.isDebugEnabled())
>                         {
>                                 LOG.debug("Setting filterPrefix('{}') to '' because there is either an
> error or a forward. {}, {}",
>                                                 new Object[] {filterPrefix, forwardAttributes, errorAttributes});
>                         }
>                         // the filter prefix is not needed when the current request is internal
>                         // see WICKET-4387
>                         this.filterPrefix = "";   <<<-------- HERE
>                 } else
>                 {
>                         this.filterPrefix = filterPrefix;
>                 }
>
>
> This results in not creating the proper URLs for standard resource classes
> such as wicket-ajax.js.  The filterPrefix is needed to load the resources.
>
> When actually set to this.filterPrefix = filterPrefix;
>
> My portlet works as expected.
>
> Any idea how to work around this as this is wicket core?
>
> Can this code check if in a portal and not clear out this value?
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Portlet-ServetWebRequest-WICKET-4387-fix-Introduced-a-bug-tp4651153.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Portlet / ServetWebRequest / WICKET-4387 fix - Introduced a bug???

pasto
I think, that this has been fixed in wicket-portlet version 1.5.7.2, which can be downloaded from https://issues.apache.org/jira/browse/WICKET-4019 (which seems to be currently down for maintenance). I checked github, but there is also an old version, maybe because wicketstuff 1.5.8 has not been released yet (I'm not very familiar with github and wicket release process). As I'm not sure, if it is possible to use for wicketstuff version something like "1.5.8-SNAPSHOT" (Martin might know), you can just wait and download it from there. (or just use the one I sent you by email ;).
Reply | Threaded
Open this post in threaded view
|

Re: Portlet / ServetWebRequest / WICKET-4387 fix - Introduced a bug???

Martin Grigorov-4
On Sun, Aug 12, 2012 at 7:10 PM, pasto <[hidden email]> wrote:
> I think, that this has been fixed in wicket-portlet version 1.5.7.2, which
> can be downloaded from https://issues.apache.org/jira/browse/WICKET-4019
> (which seems to be currently down for maintenance). I checked github, but
> there is also an old version, maybe because wicketstuff 1.5.8 has not been
> released yet (I'm not very familiar with github and wicket release process).
> As I'm not sure, if it is possible to use for wicketstuff version something
> like "1.5.8-SNAPSHOT" (Martin might know), you can just wait and download it
> from there. (or just use the one I sent you by email ;).

Yes, the better bet is to clone the project and build it locally.
There is http://ci.wicketstuff.org/ but as Apache Jenkins instances it
is no very reliable :-/

>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Portlet-ServetWebRequest-WICKET-4387-fix-Introduced-a-bug-tp4651153p4651156.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Portlet / ServetWebRequest / WICKET-4387 fix - Introduced a bug???

Doug Leeper
Closure on this one.

Peter Pastrnak did indicate that there was a bug with the "latest" distribution.  There is a fix that will be available in the next release from my understanding.  

Peter did send me the updated files and I confirmed that it did fix my issue.

Thanks Peter!