cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Mayrhuber <cm...@iicm.edu>
Subject Re: How to fix org.apache.cocoon.sitemap.PatternException?
Date Wed, 14 Apr 2004 13:45:05 GMT
>>
>>At http://localhost:8888/samples/blocks/proxy/wsproxy/
>>org.apache.cocoon.sitemap.PatternException: Evaluation error in expression: 
>>http://{request:serverName}:{request:serverPort}{request:contextPath}
>>  
>>
>
>Can you apply the attached patch, to your Cocoon source, and see if it 
>fixes it. Simple, but should work.
Applied.

>My Cocoon setup is broken a present as I'm working on something else.
>
>Let me know. If it works, I'll commit it.
>
>Upayavira
Sorry, it is only a partial fix to for the PatternException.

I've the same problem when accessing global
variable definitions like

 <map:pipelines>
  <map:component-configurations>
    <global-variables>
       <!--+
           | Define global parameters here:
           | You can access them by {global:*name*}, e.g. {global:skin}.
           | These values are inherited into sub-sitemaps and can
           | be extended there.
           +-->
	  <hwhost>test</hwhost>
	  <hwport>418</hwport>	  
    </global-variables>
  </map:component-configurations>

...

</map:pipelines>

and accessing them with
 src="hyperwave://{global:hwhost}:{global:hwport}"

I've done a little debugging in PreparedVariableResolver.resolve():

After parsing this src line stack.size == 3

with 

Token 0: type=EXPR, value=hyperwave://test
Token 1: type=COLON, value=null
Token 2: type=EXPR, value=418

The bug is in the that colons only appear between
{input_module:value} and not outside of it.
The fix is to create tokens of type TEXT with value ":" for colons
outside an module reference.

The attached patch works for me with my sitemap and seems to work
for the proxy block, too.


-- 
lg, Chris

Mime
View raw message