You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by David Barral <da...@elrincondelprogramador.com> on 2004/05/03 18:04:52 UTC

Kuiper. Problems getting ActionRequest Parameters

Hi. I've noticed that the method for getting request parameters is coded 
as follow.

public String getParameter(String key) {
   return super.getParameter(window.getPortletId()+"."+key);
}

A simple form in a portlet (i.e <input name="stockSymbol" type="text" 
size="5" maxlength="5">) can't work this way, although it worked with 
the normal Pluto version.

I suppose you do this in order to prevent the other page portlets to get 
  the parameter at render time.

Shouldn't be better to do something like

public String getParameter(String key) {
	String portletId = super.getParameter("portletId");
	if (porteltId.equals(window.getPortletId()) {
		return super.getParameter(key);
	}
	return null;
}

It's just a little bit of code, but you're not making Pluto users to 
encode the parameters.

And that's another point. If the parameters are expected to be encoded, 
why aren't the keys that the container use (like windowState or mode) 
encoded?

Regards.
David.


-- 
/**
  * David Barral
  * david@elrincondelprogramador.com
  */


Re: Kuiper. Problems getting ActionRequest Parameters

Posted by "David H. DeWolf" <dd...@apache.org>.
David Barral wrote:

> Hi. I've noticed that the method for getting request parameters is 
> coded as follow.
>
> public String getParameter(String key) {
>   return super.getParameter(window.getPortletId()+"."+key);
> }
>
> A simple form in a portlet (i.e <input name="stockSymbol" type="text" 
> size="5" maxlength="5">) can't work this way, although it worked with 
> the normal Pluto version.
>
Yes, you are correct.  This is a bug.

> I suppose you do this in order to prevent the other page portlets to 
> get  the parameter at render time.
>
> Shouldn't be better to do something like
>
> public String getParameter(String key) {
>     String portletId = super.getParameter("portletId");
>     if (porteltId.equals(window.getPortletId()) {
>         return super.getParameter(key);
>     }
>     return null;
> }
>
> It's just a little bit of code, but you're not making Pluto users to 
> encode the parameters.
>
> And that's another point. If the parameters are expected to be 
> encoded, why aren't the keys that the container use (like windowState 
> or mode) encoded?
>
Parameters and Attributes are probably on of  the biggest areas that 
needs work in Kuiper right now. What has been implemented has been 
thrown in just to be able to test basic functionality and act as a 
"proof of concept". Any patches are appreciated.

Regards,

David

> Regards.
> David.
>
>