I'm building up some test Portlets and got into trouble when I tried to post
an ActionRequest.
My posted parameters never showed up in the processAction method of my
Portlet.

After some debugging I found that (part of) the trouble was caused by
o.a.j.engine.servlet.ServletRequestImpl.getParameterMap().
There, the current PortletWindow its id is compared to a seemingly encoded
pid value in the control parameters retrieved with
o.a.j.engine.core.PortalControlParameter.getPIDValue().
But, this pid value is nowhere encoded so no hit and therefore no parameters
will ever be found.
After trying to get a grip on the whole PortalURL encoding stuff (which I
must say is some kind of obfuscated code to me: anyone out there who really
knows and understands the logic and flow under all conditions ?), I came up
with a simple solution to my problem.
If it is valid in all situations I'm really unable to determine but at least
to get to posted ActionRequest parameters it works.

I replaced the following line in
o.a.j.engine.core.PortalControlParameter.getPIDValue():

        String value = (String)
stateLessControlParameter.get(getPortletIdKey());

with:

        String value = null;// always returns null: (String)
stateLessControlParameter.get(getPortletIdKey());
        try
        {
            PortletWindow window = getPortletWindowOfAction();
            if ( window != null )
                value = window.getId().toString();
        }
        catch (JetspeedException e)
        {
            throw new RuntimeException(e);
        }

I know, trapping the JetspeedException like that isn't nice but I for a
quick fix it does the trick (it is only thrown when the PorletDefinition of
the referenced PortletWindow couldn't be found).

If this patch is acceptable in it current form (or something better of
course ;-) it would be nice if it could be put into CVS.

Finally, I like to suggest that a few more test Portlets are created to
validate the most basic features of the Portal and Portlet engine because
not be able to process posted data certainly got me bewildered.

Thanks,

Ate



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to