cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Varga Zsombor" <varga.zsom...@gmail.com>
Subject Re: How to make functions within xsp:logic
Date Thu, 04 Dec 2008 20:37:27 GMT
Hi!

Few years ago i use java methods in xsp pages.
Here is a sample code:
<?xml version="1.0" encoding="iso-8859-2"?>
<xsp:page language="java" ....>
<xsp:structure>
  <xsp:include>java.util.*</xsp:include>
</xsp:structure>
<xsp:logic>
  String hello(String name) {	
   return "Hello " + name + "!";
  }
</xsp:logic>
<page>
 <welcome><xsp:expr>hello("YourName")</xsp:expr><welcome>
</page>
</xsp:page>

The most important thing, that write your java function before the
first output xml node.
I hope that will help you

Zsombor

On Tue, Dec 2, 2008 at 14:57, Smigge <jogilius@hotmail.com> wrote:
>
> Hi!
>
> I'm trying to put a function inside an xsp:logic element. How is this done?
> Normally you have main function in a java class, but here you don't need
> one. So how do you make a function there? It has to be possible, right?
> --
> View this message in context: http://www.nabble.com/How-to-make-functions-within-xsp%3Alogic-tp20792700p20792700.html
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message