You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by degressor <pa...@yahoo.com> on 2011/03/18 15:25:06 UTC

Question about new ...()

Hi, I'm new with tapestry(sorry for noob questions), and read in the tutorial
about new and services. Here my question:

I can use new with standart classes and compontents from libryries, for
example with HashMap(), but not with my own classes?  Test test = new Test()
lead to exception. 

I can't use new like this:

Test cds = new Test();
dooSomething(new Test());

but if I put new Test() directly in the function-call it works:
dooSomething(new Test());

Why? Or maybe I don't understand something?


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Question-about-new-tp3965204p3965204.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Question about new ...()

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 18 Mar 2011 11:25:06 -0300, degressor <pa...@yahoo.com> wrote:

> Why? Or maybe I don't understand something?

You can't instantiate directly classes that are pages, components, mixins  
or are in the base package, because they're modified by Tapestry when  
loading them. Actually, you can, but they won't correctly inside Tapestry.  
Everything else is not affected.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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