All things being equal, the 'preferred' solution is always the one that
uses tags rather than scriptlets.  It is cleaner and easier to
understand and maintain.  Additionally, a web designer (non-Java
developer) can more easily work with the content and not have to worry
about the Java code.

-KG 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 03, 2006 10:21 AM
To: [email protected]
Subject: Re: [magnolia-user] getting content of nodes

all,

Recently I had the same problem and used the code below to use values in
scriplets.

<c:set var="filename"><cms:out nodeDataName="filename" /></c:set>

<% String filename = (String) pageContext.getAttribute("filename"); %>

They both do their job, but what is the preferred way of accessing
variables ?

cheerio,
Vincent

-----Original Message-----
From: Moskos, Jay [mailto:[EMAIL PROTECTED]
Sent: vrijdag 3 februari 2006 17:14
To: [email protected]
Subject: Re: [magnolia-user] getting content of nodes


Try

String phone =
((Resource.getLocalContentNode(request)).getNodeData("phone")).getString
();

Cheers,
Jay Moskos

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 03, 2006 10:07 AM
To: [email protected]
Subject: [magnolia-user] getting content of nodes

hi,

i think i've got a little missunderstandig:

<cms:out nodeDataName="Phone" /> prints the content of Phone. so far so
good. but how i can access the same content in a scriplet?

i try the code below, but it doesn't work. why?

Content currentPage = Resource.getActivePage(request);       
String email = currentPage.getNodeData("Phone").getString();

thx for help

so long

ingo


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

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

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

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

Reply via email to