Misunderstanding. You cannot access "protocol" attribute. meaningLeszek Gawron wrote:
Daniel Fagerstrom wrote:
<snip/>
The accessors do not solve the problem with $cocoon/request/requestAttribute or $cocoon/request/requestParameter (preferably $cocoon/request/attributes/someAttribute and $cocoon/request/parameters/someParameter)
We could provide some kind of request wrapper (do not know how to emulate getParameters though) or implement RequestJXPathBeanInfo (do not know how also :))Carsten added such wrappers in rev 27976 of the TemplateObjectModelHelper and removed them in 153807. Maybe we should add them again ;)
They aren't correct. The only thing changed from oryginal Request interface is that you can access request attribute using cocoon/request/attribute. It wouldn't work for "protocol" attribute as there is such property in Request interface. It does not work for request parameters at all - you have to query them using a method).
Are you certain about that it doesn't work for properties? I can't test right now, but looking at http://svn.apache.org/viewcvs.cgi/cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/environment/TemplateObjectModelHelper.java?rev=27976&view=markup
in DynamicMap.getDynamicInfo it looks to me that it handle properties. ...
result = PropertyUtils.getProperty(*this*.information, key.toString());
$cocoon/request/protocol gets the property and the syntax does not provide a way do do request.getAttribute( "protocol" );
...
I'd like to fix that even before we move to accessors.
Its a different concern from what accessors solves, so that sounds reasonable.
I do not know how to do it properly though so these constructs provide valid results:
JEXL: cocoon.request.property - works now cocoon.request.parameters.someParameter cocoon.request.attributes.someAttribute
JXPath: $cocoon/request/property $cocoon/request/parameters/someParameter $cocoon/request/attributes/someAttribute
IMO we should make the Request interface bean friendly and add the methods:
Map getParameters(); Map getAttributes();
You won't reach those as collection in HttpServletRequest
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html
Of course there are similar problems with session and context.
It is a serious blocker for users to just try to switch to 2.2-dev and use new JXTG.
IIRC it has nothing to do with the new JXTG, it didn't work with the original either. It is, IIRC, an effect of the refactoring of FOM in 2.2.
yes but it affects JXTG a lot.
-- Leszek Gawron [EMAIL PROTECTED] IT Manager MobileBox sp. z o.o. +48 (61) 855 06 67 http://www.mobilebox.pl mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65
