velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Romianowski" <megap...@gmx.de>
Subject RE: String to Int
Date Tue, 10 Dec 2002 13:04:18 GMT
  As written before: If you convert MyClass to be a Singleton
like this:

public final class MyClass {

	private MyClass instance = new MyClass();

	public static getInstance() {
		return instance;
	}

	public static final String process(Map map) {
		System.out.println(">>>>>>>>>>"+map.toString());
		return map.toString();
	}

	public static final String process() {
		return "-----------|||||||||||||---------------";
	}

}

and then add to your Example.java:

            context.put("MyClass", MyClass.getInstance());

  everything sould work. For every object $something you access
in your VTL-script you have to put an Object under the key
"something" into your context or you have to use the #set ()
directive (but that's irrelevant for your problem).


Peter

> -----Original Message-----
> From: Cocosila [mailto:cocosila@home.ro] 
> Sent: Tuesday, December 10, 2002 1:42 PM
> To: Velocity Users List
> Subject: Re: String to Int
> 
> 
> Ok, here are all of them.
> 
> I am also confused about $Integer.parseInt("4") that does not "work".
> 
> Dan
> 


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message