You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Howard <hl...@gmail.com> on 2010/08/18 02:33:58 UTC

[Tapestry Central] Tapestry Frequently Asked Questions

I'm taking some time to work on the Tapestry documentation ... starting
with the FAQ. It's great fun, though this could get to be quite large.
I'm just spewing out content right now, over time we'll clean it up,
reorganize it, and add further hyperlinks and annotations.
In fact, as I'm working on the FAQ, I'm thinking this might be the best
way to document open source projects in general. User's guides and
reference documents are rarely read, everyone just Google's their
question, so put those questions in their most findable format. Also,
it's hard to write a consistent user guide start to finish ... but more
reasonable to document one tidbit at a time.
Also, I'm reminded of The Little Schemer, a book that teaches the
entire Scheme language (a Lisp variant) via a series of questions of
ever broadening scope.
Feel free to suggest additional FAQ topics on the Tapestry Users
mailing list.

--
Posted By Howard to Tapestry Central at 8/17/2010 05:33:00 PM

Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 18 Aug 2010 15:23:34 -0300, Alexander Muthmann  
<am...@dev-eth0.de> wrote:

>   Thanks a lot for this idea!
> The call of:
> componentSource.getPage(Registered.class).getClass().equals(CurrentPage.class)  
> works fine!

I should have thought of that in my first answer. :)

-- 
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


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by Alexander Muthmann <am...@dev-eth0.de>.
  Thanks a lot for this idea!

The call of:
componentSource.getPage(Registered.class).getClass().equals(CurrentPage.class) 

works fine!


On 18.08.2010 17:51, Thiago H. de Paula Figueiredo wrote:
> On Wed, 18 Aug 2010 12:31:15 -0300, Alexander Muthmann 
> <am...@dev-eth0.de> wrote:
>
>>   I just refer to this article about class-comparison:
>> https://www.securecoding.cert.org/confluence/display/java/OBJ06-J.+Compare+classes+and+not+class+names 
>>
>> But if you say it's ok, I trust you ;)
>
> Another option is to get the transformed page instance from 
> ComponentSource, get its class from getClass() and then use equals() 
> for comparison.
> Please try this and post the result.
>


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 18 Aug 2010 12:31:15 -0300, Alexander Muthmann  
<am...@dev-eth0.de> wrote:

>   I just refer to this article about class-comparison:
> https://www.securecoding.cert.org/confluence/display/java/OBJ06-J.+Compare+classes+and+not+class+names
> But if you say it's ok, I trust you ;)

Another option is to get the transformed page instance from  
ComponentSource, get its class from getClass() and then use equals() for  
comparison.
Please try this and post the result.

-- 
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


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by Alexander Muthmann <am...@dev-eth0.de>.
  I just refer to this article about class-comparison:

https://www.securecoding.cert.org/confluence/display/java/OBJ06-J.+Compare+classes+and+not+class+names

But if you say it's ok, I trust you ;)

On 18.08.2010 17:07, Thiago H. de Paula Figueiredo wrote:
> On Wed, 18 Aug 2010 11:33:05 -0300, Alexander Muthmann 
> <am...@dev-eth0.de> wrote:
>
>> Is there any better possibility to compare those classes than to just 
>> compare their names which is a little bit annoying because there 
>> could be two classes with the same name but which aren't equal...
>
> If you have two different classes with the same fully qualified name, 
> you have a big problem waiting to happen.
>


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Wed, Aug 18, 2010 at 8:07 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Wed, 18 Aug 2010 11:33:05 -0300, Alexander Muthmann
> <am...@dev-eth0.de> wrote:
>
>> Is there any better possibility to compare those classes than to just
>> compare their names which is a little bit annoying because there could be
>> two classes with the same name but which aren't equal...
>
> If you have two different classes with the same fully qualified name, you
> have a big problem waiting to happen.
>

This is already in the FAQ, though in my current experiments it shows
up as a LinkageError.  I even created a little Gliffy chart to explain
the class loader hierarchy.


> --
> 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
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 18 Aug 2010 11:33:05 -0300, Alexander Muthmann  
<am...@dev-eth0.de> wrote:

> Is there any better possibility to compare those classes than to just  
> compare their names which is a little bit annoying because there could  
> be two classes with the same name but which aren't equal...

If you have two different classes with the same fully qualified name, you  
have a big problem waiting to happen.

-- 
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


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by Alexander Muthmann <am...@dev-eth0.de>.
  Hi there,

It's great to have a FAQ for Tapestry. I just had a look at it and 
immediately found an issue I just ran into.

The second FAQ is  "Why do I get a ClassCastException ..."

I have a service which takes some page-classes via the contribute 
method. In my code, I then want to compare the current page with the 
saved ones.
The comparison of Class a and b is done by a.equals(b). This always 
returns false as one class is loaded by tapestry's classloader and 
therefor has another java.lang.Class but the same classname.

Is there any better possibility to compare those classes than to just 
compare their names which is a little bit annoying because there could 
be two classes with the same name but which aren't equal...

Thanks a lot

Alex


On 18.08.2010 02:33, Howard wrote:
> I'm taking some time to work on the Tapestry documentation ... starting
> with the FAQ. It's great fun, though this could get to be quite large.
> I'm just spewing out content right now, over time we'll clean it up,
> reorganize it, and add further hyperlinks and annotations.
> In fact, as I'm working on the FAQ, I'm thinking this might be the best
> way to document open source projects in general. User's guides and
> reference documents are rarely read, everyone just Google's their
> question, so put those questions in their most findable format. Also,
> it's hard to write a consistent user guide start to finish ... but more
> reasonable to document one tidbit at a time.
> Also, I'm reminded of The Little Schemer, a book that teaches the
> entire Scheme language (a Lisp variant) via a series of questions of
> ever broadening scope.
> Feel free to suggest additional FAQ topics on the Tapestry Users
> mailing list.
>
> --
> Posted By Howard to Tapestry Central at 8/17/2010 05:33:00 PM


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by "Vangel V. Ajanovski" <aj...@ii.edu.mk>.
 There are many howtos that helped me a lot, the jumpstart is also an
incredible thing, the only thing that is missing is a linking between
them and the releases. Maybe some kind of an "official" certification
that the mentioned how-to does or does not work with version x.x.x. But
since it is a wiki, anyone can put a comment that it does or it does not
work. Also anyone that has managed to find a simple solution for some
interesting problem could post it in the wiki.

Community involvment is crucial for this.

What I really am missing is more text and better explanation in the
official documentation. I mean a real revision of each document seen on
the website with a clearer and more detailed explanation.

For example I am trying to create a unit test following the explanation
there for PageTester but this does not help me because all of the pages
in my app requires authentication from a filter executed before
tapestry. So my application only checks if this filter has remoteUser
set from HttpServletRequest to some username. But this does not work
with PageTester because this is obviously null and I can't find any
information on how to simulate this. This is an example of a simple
thing that should be put or configured somewhere somehow, that is not
mentioned anywhere. There are many examples like this.

So far the best way to learn Tapestry was by investigating somebody
elses source code or sometimes even tapestry's source code. FAQ is good
but if you really want to spend some time on documenting things,
document them better and in more detail. Thinks might look ok to you
since you already know it and are good with it, but if you are a
complete beginner and you have worked for example with JSP or servlets
from scratch, not everything is clean on itself.

Tapestry has many mechanisms "that simply and smartly work" but too bad
that rarely people know about them.


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by Chris Mylonas <ch...@mrvoip.com.au>.
Hi Howard et. al ,

Here's my 2cents:

1) removed.

2)  I think a HOWTO section would be better than a FAQ - how do i put a checkbox in an ajax form loop, then link to jumpstart's example.

3) Some more diagrams - the page lifecycle one is tops, but I only really began to understand it when I was doing some zone updater form related work.  Even with the diagram, I was pumping out some System.out.println("Yo I'm here") kinda stuff

4) A diagram on ValueEncoder would probably be a nice one for people to understand client side string-javascript mapped to server side objects.

5)  A howto on porting JSF (or other) to tapestry as the view in MVC, with a really simple EJB backend - e.g. address book  (even creating a php CMS to tapestry front end)

6)  A wishlist/voting section for modules to add to tapestry - e.g. take a look at other frameworks and wish some of their features into tapestry5 - .e.g. GSoC google maps stuff that was just completed.

7)  A guide on how to create a plugin/extension

8)  How to get tapestry going without maven, say ant/ivy

9)  Diagrams (even hand-drawn & scanned and put into svn for someone with time and some graphics to convert at a later date)

Flame away! :)

Cheers
Chris


On 18/08/2010, at 10:33 AM, Howard wrote:

> I'm taking some time to work on the Tapestry documentation ... starting
> with the FAQ. It's great fun, though this could get to be quite large.
> I'm just spewing out content right now, over time we'll clean it up,
> reorganize it, and add further hyperlinks and annotations.
> In fact, as I'm working on the FAQ, I'm thinking this might be the best
> way to document open source projects in general. User's guides and
> reference documents are rarely read, everyone just Google's their
> question, so put those questions in their most findable format. Also,
> it's hard to write a consistent user guide start to finish ... but more
> reasonable to document one tidbit at a time.
> Also, I'm reminded of The Little Schemer, a book that teaches the
> entire Scheme language (a Lisp variant) via a series of questions of
> ever broadening scope.
> Feel free to suggest additional FAQ topics on the Tapestry Users
> mailing list.
> 
> --
> Posted By Howard to Tapestry Central at 8/17/2010 05:33:00 PM


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


Re: [Tapestry Central] Tapestry Frequently Asked Questions

Posted by Ivano Luberti <lu...@archicoop.it>.
I disagree about the FAQ as the better documentation for OS projects.
Yes they are necessary, but user guides have to be the first step to get
to know a new system.
With user guide I mean a step by step guide that teaches to the newbie

1) how to setup environment and start developing simple things (hello
world and little more)

2) how to integrate common third party libraries (ORM, logging) or
products (Javascript libraries)

3) how to realize various type of applications with the framework (web
applications, web service, CRUD operations)

I think that 80% of development tasks are common to all web projects

FAQs are useful for common problems, not for common tasks.

Just my 2 cents


Il 18/08/2010 2.33, Howard ha scritto:
> I'm taking some time to work on the Tapestry documentation ... starting
> with the FAQ. It's great fun, though this could get to be quite large.
> I'm just spewing out content right now, over time we'll clean it up,
> reorganize it, and add further hyperlinks and annotations.
> In fact, as I'm working on the FAQ, I'm thinking this might be the best
> way to document open source projects in general. User's guides and
> reference documents are rarely read, everyone just Google's their
> question, so put those questions in their most findable format. Also,
> it's hard to write a consistent user guide start to finish ... but more
> reasonable to document one tidbit at a time.
> Also, I'm reminded of The Little Schemer, a book that teaches the
> entire Scheme language (a Lisp variant) via a series of questions of
> ever broadening scope.
> Feel free to suggest additional FAQ topics on the Tapestry Users
> mailing list.
>
> --
> Posted By Howard to Tapestry Central at 8/17/2010 05:33:00 PM
>   

-- 
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================


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