I agree with Frank and Gary...this is really a hassle when the request
is not reissued every time. And yes most web-sites need this
functionality where the request is always re-issued when the menu is
clicked.

Thanks for the code and the pointers that you guys have given. I'm going
try this and see if it fixes our issues. 

Just one more question. I could apply this code and get it work for 1.6
Jetspeed Right?

I really really hope that the Jetspeed portal community agrees that this
is an issue and provides an easy to implement solution.

This is not to undermine all the work that has been done till now. It
has been awesome and we are using Jetspeed 1.6 without any major issues
yet other than the "Render Request" problem.
Just my two cents.
Thanks,
Archana

-----Original Message-----
From: Boyce, Keith Garry [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 27, 2006 3:36 PM
To: Jetspeed Users List
Subject: RE: How to clear RenderParameters set in action ?


I agree with Frank here... This was a major stumbling block in our
application development and because we were not using a portal where we
could change the source (i.e: Sun One Portal), we had to imbed terrible
work around logic in every portlet to cause it to ignore render
parameterers... This should definitely be standardized in the next
spec.. In the meantime it would definitely be helpful to include this
proposed patch as an optional non-spec behaviour (enabled in jetspeed
config file. Is there one yet? i.e: WEB-INF/jetspeed-portal.xml)


Garry

-----Original Message-----
From: Frank Villarreal [mailto:[EMAIL PROTECTED]

Sent: Friday, January 27, 2006 4:25 PM
To: Jetspeed Users List
Subject: RE: How to clear RenderParameters set in action ?

> From: Archana Turaga [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 27, 2006 03:04 PM
> To: Jetspeed Users List
> Subject: RE: How to clear RenderParameters set in action ?
>
>
> Hello Frank,
> I have a similar issue. Could you tell us where you applied the patch

> and what the content of the patch is? Basically my question how did

> you fix this issue? It would be really great help!!

Hi Archana:

The following is the code I modified in the
org.apache.jetspeed.engine.servlet.ServletRequestImpl class.  Notice
that I check for a parameter named "pgreq".  I add that parameter to
every menu item in my Velocity templates in order to indicate that a
direct PAGE request is occurring.  At that point, with the following
code, I effectively ignore ALL render parameters.


    public String getParameter( String name )
    {
        if (this.portletParameters.containsKey("pgreq")) {
                return null;
        }
        Object value = this.getParameterMap().get(name);
        if (value == null)
        {
            return (null);
        }
        else if (value instanceof String[])
        {
            return (((String[]) value)[0]);
        }
        else if (value instanceof String)
        {
            return ((String) value);
        }
        else
        {
            return (value.toString());
        }
    }

    public Map getParameterMap()
    {
        if (currentRequest == null || currentRequest != getRequest() )
        {
            // Cache the parameters for as long as the wrapped request
stays the same.
            // According to Servlet 2.3 SRV.6.2.2 the passed on
ServletRequest object
            // to an dispatched Servlet must remain the same (this one).
            // Tomcat solves this by injecting a new ServletRequest of
its own above
            // this one (the getRequest() object).
            // So, when that one has changed since the last time the
parameters have
            // been accessed, flush the cache and rebuild the map.
            currentRequest = getRequest();
            portletParameters = new HashMap();

            // get portlet params
            JetspeedRequestContext context = (JetspeedRequestContext)
getAttribute("org.apache.jetspeed.request.RequestContext");
            if (context != null)
            {
                PortalURL url = context.getPortalURL();
                Iterator iter =
url.getNavigationalState().getParameterNames(portletWindow);
                while (iter.hasNext())
                {
                    String name = (String) iter.next();
                    String[] values =
url.getNavigationalState().getParameterValues(portletWindow, name);
                    portletParameters.put(name, values);

                }
            }

            //get servlet params
            for (Enumeration parameters =
getRequest().getParameterNames();
parameters.hasMoreElements();)
            {
                String paramName = (String) parameters.nextElement();
                String[] paramValues = (String[])
getRequest().getParameterValues(paramName);
                String[] values = (String[])
portletParameters.get(paramName);

                if (getCharacterEncoding() != null)
                {
                    for (int i = 0; i < paramValues.length; i++)
                    {
                        try
                        {
                            paramValues[i] = new
String(paramValues[i].getBytes("ISO-8859-1"), getCharacterEncoding());
                        }
                        catch (UnsupportedEncodingException e)
                        {
                            ;
                        }
                    }
                }

                if (values != null)
                {
                    String[] temp = new String[paramValues.length +
values.length];
                    System.arraycopy(paramValues, 0, temp, 0,
paramValues.length);
                    System.arraycopy(values, 0, temp,
paramValues.length, values.length);
                    paramValues = temp;
                }
                portletParameters.put(paramName, paramValues);
            }
        }
        if (this.portletParameters.containsKey("pgreq")) {
                return Collections.unmodifiableMap(new HashMap());
        }
        return Collections.unmodifiableMap(portletParameters);

    }

    public Enumeration getParameterNames()
    {
        if (this.portletParameters.containsKey("pgreq")) {
                return Collections.enumeration(new HashMap().keySet());
        }
        return Collections.enumeration(this.getParameterMap().keySet());
    }

    public String[] getParameterValues( String name )
    {
        if (this.portletParameters.containsKey("pgreq")) {
                return null;
        }
        return (String[]) this.getParameterMap().get(name);
    }



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


This message is a PRIVATE communication.
If you are not the intended recipient, please do not read, copy,
or use it, and do not disclose it to others. Please notify the
sender of the delivery error by replying to this message, and then
delete it from your system. Thank you.

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


This e-mail transmission may contain information that is proprietary, 
privileged and/or confidential and is intended exclusively for the person(s) to 
whom it is addressed. Any use, copying, retention or disclosure by any person 
other than the intended recipient or the intended recipient's designees is 
strictly prohibited. If you are the intended recipient, you must treat the 
information in confidence and in accordance with all laws related to the 
privacy and confidentiality of such information.  If you are not the intended 
recipient or their designee, please notify the sender immediately by return 
e-mail and delete all copies of this email, including all attachments.

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

Reply via email to