Ah. The other variation works, & seems to be a little more
magnoliaesque, so will stick with that.

It's a little more compact too. Having worked with PHP & Python, I don't
like how it takes tons of code to do anything in Java.

What do you think about how I sliced off the '.html' at the end
(page_uri = page_uri.replaceAll(".html", ""))?

Is there a better way?

You would split it by the '.', and yeild an array (HashMap?, ArrayList?)
with two components, then take the first component.

I could cast the string into a character array, get the length, subtract
5, and... I don't know, but there are ways to count back from the end &
slice it off.


Or combine it all in one step. I think in Python it would be something
like...

  page_uri = string.strip(page_uri[:5])

 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 14, 2005 11:23 AM
To: [email protected]
Subject: Re: [magnolia-user] sharing contents

> <%= request.getAttribute(JAVAX_FORWARD_SERVLET_PATH) %>
> 
> Yields this...
> 
> An error occurred at line: 25 in the jsp file:
> /templates/jsp/ud/global/ud_left.jsp
> Generated servlet error:
> /opt/magnolia21/work/Catalina/localhost/magnoliaAuthor/org/apache/jsp/
> te
> mplates/jsp/ud/global/ud_005fleft_jsp.java:103: cannot resolve symbol 
> symbol  : variable JAVAX_FORWARD_SERVLET_PATH
> location: class org.apache.jsp.templates.jsp.ud.global.ud_005fleft_jsp
>       out.print( request.getAttribute(JAVAX_FORWARD_SERVLET_PATH) );
> 
> 

It should be
request.getAttribute(info.magnolia.cms.core.Path.JAVAX_FORWARD_SERVLET_P
ATH) ;-).

./alex


----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to