You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Smigge <jo...@hotmail.com> on 2008/12/02 14:57:36 UTC

How to make functions within xsp:logic

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


Re: How to make functions within xsp:logic

Posted by Varga Zsombor <va...@gmail.com>.
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 <jo...@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