Re: tapestry-spring-security support for Spring Security 3.0.4.RELEASE?

2010-11-07 Thread Olle Hallin
Alex,

It's not a minor point release.

TSS 2.1.0 depends on
org.springframework.security:spring-security-core:2.0.4.
In this version, AccessDeniedHandler lives in
org.springframework.security.ui.

In org.springframework.security:spring-security-core:3.0.x, it lives in
org.springframework.security.web.access

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/11/5 Alex Kotchnev 

> Olle,
>  I'm not sure what the best way of doing this is . At this time TSS
> supports Spring 3.0 (I think I recal 3.0.3) in the latest snapshot builds.
> The problem is that if we bum the snapshot to support 3.0.5.RELEASE, this
> will effectively break anyone who uses TSS w/ Spring 3.0 prior to
> 3.0.5.RELEASE . The problem is certainly fixable if we have a different
> branch for the pre 3.0.5 work, but I'm really not looking forward to having
> the two branches start diverging.
>
>  As a side note, this seems like an odd move from spring source - would
> would they rename a package on a minor point release ??
>
> Cheers,
>
> Alex K
>
> On Fri, Nov 5, 2010 at 5:53 AM, Olle Hallin  wrote:
>
> > Hi!
> >
> > We're using nu.localhost:tapestry-spring-security:2.1.0 in the project i
> > work on.
> >
> > Now we're trying to upgrade to Spring 3.0.5.RELEASE and Spring Security
> > 3.0.4.RELEASE, but I get a runtime error because
> > of a renamed package (org.springframework.security.ui
> > -> org.springframework.security.web).
> >
> > Is there any plans for lifting tapestry-spring-security to support Spring
> > Security 3.0.4.RELEASE?
> >
> > Olle Hallin
> > Senior Java Developer and Architect
> > olle.hal...@crisp.se
> > www.crisp.se
> > http://www.linkedin.com/in/ollehallin
> >
>


tapestry-spring-security support for Spring Security 3.0.4.RELEASE?

2010-11-05 Thread Olle Hallin
Hi!

We're using nu.localhost:tapestry-spring-security:2.1.0 in the project i
work on.

Now we're trying to upgrade to Spring 3.0.5.RELEASE and Spring Security
3.0.4.RELEASE, but I get a runtime error because
of a renamed package (org.springframework.security.ui
-> org.springframework.security.web).

Is there any plans for lifting tapestry-spring-security to support Spring
Security 3.0.4.RELEASE?

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin


Re: Static HTML ...

2010-01-20 Thread Olle Hallin
You could place them anywhere you like under the web context, but you must
tell Tapestry to ignore them:

Add to AppModule.java:

public void contributeIgnoredPathsFilter(Configuration
configuration) {
configuration.add("/my-static-stuff/*");
    }


Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/1/20 Gunnar Eketrapp 

> Hi!
>
> This is most certainly a stupid question.
>
> We have built quite a big T5 webapp without any static html.
>
> Now I feel the need to add some static html files and cant find any info on
> how to do this.
>
> Where are they placed in the project ?
>
> Do I have to tell T5 filter to ignore them?
>
> Thanks in advance!
> /Gunnar Eketrapp
>


Re: Is tapestry coupled with Hibernate API?

2010-01-12 Thread Olle Hallin
Once again, I recommend that you have a look at JDO.

Just like JPA, it is a standardized specification with several providers.

Differently from JPA, it also allows one to use OODBMSs, Excel, Google
BigTable, Amazon EC2 and so on in addition to relational databases.

By selecting JPA you cut of the possibility to use e.g., db4o as persistence
engine.

(IMO there are far too many systems out there that routinely use a RDBMS as
persistence engine. In many cases an OODBMS would have done the job with
significantly less development effort.)

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/1/12 Piero Sartini 

> > As far as I understand, javax.persistence.EntityManager is an interface,
> so,
> > there should be any mechanism to determine which impl will be used at
> > runtime, right?
>
> Right. This is part of the JPA specification. You define the
> implementation inside your persistence.xml:
> ...
> org.eclipse.persistence.jpa.PersistenceProvider
> ...
>
>Piero
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Is tapestry coupled with Hibernate API?

2010-01-11 Thread Olle Hallin
Or have a look at JDO, the very much under-appreciated predecessor to JPA.

I guess it would be very simple to implement @CommitAfter using the JDO api.

DataNucleus provides a JDO implementation (under the Apache 2 license),
which can use pretty much anything for the actual persistence (including
Excel, RDBMS:es, db4o, Amazon S3 and Google Big Table).

This way, you avoid vendor lock-in. See
http://www.datanucleus.org/products/index.html

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/1/11 Piero Sartini 

> > So, do you think that the most flexible approach should be to have some
> > module like tapestry-jpa to interact with into the pages, and, the real
> > "data access layer" implementation could be inter-changable between
> > hibernate, db4o, and anyone which implements the JPA specification?
>
> If you use JPA, you may switch between the implementations:
> EclipseLink / Toplink, Hibernate, OpenJPA and DataNucleus to name a
> few.
> In practice I have never seen a project changing its underlying
> database.. but well, you may do this with JPA as well.
>
> For db4o, as it is no relational database I don't think it provides a
> JPA implementation. And if it does, I would not use it - you loose the
> power of object oriented databases by doing so. I've used NeoDatis
> (another OODB) myself and wrote a small plugin equal to tapestry-jpa
> to make its usage more pleasant (injecting ODB service and working
> @CommitAfter). You could take the same approach for db4o.
>
> Piero
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Persisting state without HTTP Session

2010-01-07 Thread Olle Hallin
I agree that one should try to defer session creation as long as possible.
But as soon as there is some state to persist, you shouldn't hesitate to use
sessions.

Session replication isn't necessarily a heavy thing.

Have a look at Terracotta, which shines at making web session replication
scale well.
Combine this with sticky sessions, and you get the best of two worlds.
Terracotta does only send replicated data to the nodes that actually demands
it.

See http://www.terracotta.org

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/1/7 Thiago H. de Paula Figueiredo 

> Em Wed, 06 Jan 2010 13:36:31 -0200, Jim O'Callaghan 
> escreveu:
>
>
>  Thanks for the responses Thiago.
>>
>
> You're welcome!
>
>  I'll have a look at the
>> LinkCreationListener you suggested in your other email.  Regarding the
>> response below, does the approach not make an assumption that the objects
>> I am trying to share between pages  are persisted objects with a
>> key(id)/value elationship?  I'm using something at the moment that manages a
>> menu stack in the user's session and some other data that is really just
>> relevant to
>>
>> the user's session and not something I had thought of persisting.
>>
>
> The approach doesn't assume your objects have an id, but it does assume you
> won't put much information in the URLs. Internet Explorer, for example, has
> a limit of 2083 characters.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: About T5 integration modules

2009-12-28 Thread Olle Hallin
It has been much talk about Tapestry lacking an annotation-based security
framework.

Don't you guys know about tapestry-security, which is a Tapestry module that
uses Spring Security (formerly Acegi) under the covers?

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/28 Alessandro Bottoni 

> Il 28/12/2009 09:46, Massimo Lusetti ha scritto:
> > Comparing Drupal to Tapestry is somehow comparing apples with an
> apple-pie
>
> That's true but...
>
> I tried not to mention Wicket/Brix and Wicket/Hippo (for not starting a
> flame). Both of these frameworks can be used as more pertaining examples
> of what Tapestry/Tynamo should became in the near future.
>
> The point is simple: Tapestry alone is not enough to win this battle. It
> desperetely needs something like Tynamo (or AppFuse), both for
> educational/demonstrative purposes and as a starting point for real
> world projects. And, more in detail, the way Tynamo (or AppFuse) will be
> developed in the near future can make a huge difference for Tapestry.
>
> To be able to compete with Wicket/Brix, for example, Tapestry/Tynamo
> still have to supply something like Swarm or Wasp (the two security
> frameworks supplied by Wicket) and many other tools. These
> "implementation details" can be crucial for all of the T5 ecosystem.
>
> Please note that defending Tapestry is futile. Nobody here is accusing
> it of anything. I'm just saying that the evolution path of Tapestry and
> Tynamo must take into account what people is actually looking for (and
> what people can actually find elsewhere right now).
>
> CU
> --
>
> Alessandro Bottoni
> Website: http://www.alessandrobottoni.it/
>
> Philosophy is a game with objectives and no rules.
> Mathematics is a game with rules and no objectives.
>-- Unknown
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: t5 restarting a t5 app in tomcat

2009-12-20 Thread Olle Hallin
Do you deploy a war file or an exploded web app?

If you deploy a war file, Tomcat will explode it internally to
$CATALINA_BASE/webapps/myapp/ (if your app is myapp.war).

When you deploy a new version of the war file, you must also delete the
exploded version, or else anything can happen.

Also, try to see if deleting the $CATALINA_BASE/work/ folder helps.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/21 Angelo Chen 

>
> hi,
>
> not sure if this is t5 related, there are times that I have this problem
> when restarting tomcat for t5 app:
> 1. stop the tomcat
> 2. copy the latest version of app
> 3. start tomcat
>
> tomcat got started, but can not see the app's page, in the log, i can see
> those dispatchers got called, but just no page can be accessed. I have to
> update the server.xml to increase the maxThreads, then restart tomcat, it
> will show now the main page, what might be the cause of this problem?
>
> a.c.
> --
> View this message in context:
> http://old.nabble.com/t5-restarting-a-t5-app-in-tomcat-tp26868240p26868240.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Passing a value from a page to another

2009-12-18 Thread Olle Hallin
A long-shot in the dark...

Try to rename UserId to userId to comply with JavaBean naming conventions.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/18 Alessandro Bottoni 

> I'm trying to pass a value from a page called "Register" to a page
> called "UserProfile" following the instruction supplied by A. Kolesnikov
> in his Tapestry 5 book (pages 59 - 62).
>
> The value I want to pass is just a simple String Id. Here is (a
> simplified version of) my code:
>
> public class Register {
> // this class is used by a BeanEditor-based page template
>
>private String id = "Id From Register";
>
>@InjectPage
>private UserProfile userProfile;
>
>Object onSuccess(){
>// this call does not work...
>userProfile.setUserId(id);
>return userProfile;
>}
> }
>
> public class UserProfile {
>
>private String UserId = "Id from UserProfile";
>
>// this method is not invoked as expected..
>public void setUserId(String MyUserId){
>this.UserId = "Id received form Register";
>}
>
>// later used in a ${UserId} expansion on the target page
>public String getUserId() {
>return this.UserId;
>}
> }
>
> The Id Value is not passed from the first page to the second one (that
> is: I always get the default string "Id from UserProfile" as the Id
> rendered on the UserProfile page).
>
> What can be wrong in such trivial code?
>
> --
>
> Alessandro Bottoni
> Website: http://www.alessandrobottoni.it/
>
> "Life is a sexually transmitted disease, and it's 100% fatal."
> -- Unknown
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: T5 PageRedirectExeption

2009-12-18 Thread Olle Hallin
Or, a java.net.URL if you want to redirect to an arbitrary location outside
the own app.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/17 Thiago H. de Paula Figueiredo 

> Em Thu, 17 Dec 2009 15:11:53 -0200, Marcel Sammut 
> escreveu:
>
>
>  What is the equivalent to throwing a PageRedirectException in T3, T4 in
>> T5?
>>
>
> Just return the name of the target page, its class or an instance of it in
> the event handler method.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Affortable Hosting solutions for Tapestry WebApps

2009-12-17 Thread Olle Hallin
Another alternative is www.slicehost.com.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/18 Olle Hallin 

> Google App Engine does not work for Tapestry 5.1
>
> T5.1 uses an XML parser that is incompatible with GAE.
>
> T5.0.18 works fine from what I've heard.
>
> Olle Hallin
> Senior Java Developer and Architect
> olle.hal...@crisp.se
> www.crisp.se
> http://www.linkedin.com/in/ollehallin
>
>
>
> 2009/12/17 Kalle Korhonen 
>
> I've evaluated lots of different VPS providers, and I haven't found
>> anybody offering more RAM for the same price than http://tektonic.net.
>> If you know your way around Linux distros, their unmanaged plans are
>> great. I've been a very happy user for a few years. But still, can't
>> beat free - Google App Engine is a good choice if you just want to
>> host a Java webapp.
>>
>> Kalle
>>
>>
>> On Thu, Dec 17, 2009 at 8:48 AM, Joost Schouten (ml)
>>  wrote:
>> > Though I'm still in a trial phase and have yet to go live with them, I
>> am
>> > impressed with their service and understanding of JAVA so far.
>> >
>> > http://rimuhosting.com
>> >
>> > It is a new zealand based company with datacenters in the US, europe and
>> > Australia.
>> >
>> > just my 2 cents.
>> >
>> > Eldred Mullany wrote:
>> >>
>> >> Hi everyone
>> >>
>> >> Some time ago there was a discussion suitable hosting solutions
>> >> specifically relating to tapestry applications.
>> >>
>> >> All I would like to know if anyone can recommend an affordable ISP,
>> >> either in USA, Europe or better still in South Africa where I live.
>> >>
>> >> Just a few links would be appreciated.
>> >>
>> >> Thank you.
>> >> Eldred Mullany
>> >>
>> >>
>> >>
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> > For additional commands, e-mail: users-h...@tapestry.apache.org
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: Affortable Hosting solutions for Tapestry WebApps

2009-12-17 Thread Olle Hallin
Google App Engine does not work for Tapestry 5.1

T5.1 uses an XML parser that is incompatible with GAE.

T5.0.18 works fine from what I've heard.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/17 Kalle Korhonen 

> I've evaluated lots of different VPS providers, and I haven't found
> anybody offering more RAM for the same price than http://tektonic.net.
> If you know your way around Linux distros, their unmanaged plans are
> great. I've been a very happy user for a few years. But still, can't
> beat free - Google App Engine is a good choice if you just want to
> host a Java webapp.
>
> Kalle
>
>
> On Thu, Dec 17, 2009 at 8:48 AM, Joost Schouten (ml)
>  wrote:
> > Though I'm still in a trial phase and have yet to go live with them, I am
> > impressed with their service and understanding of JAVA so far.
> >
> > http://rimuhosting.com
> >
> > It is a new zealand based company with datacenters in the US, europe and
> > Australia.
> >
> > just my 2 cents.
> >
> > Eldred Mullany wrote:
> >>
> >> Hi everyone
> >>
> >> Some time ago there was a discussion suitable hosting solutions
> >> specifically relating to tapestry applications.
> >>
> >> All I would like to know if anyone can recommend an affordable ISP,
> >> either in USA, Europe or better still in South Africa where I live.
> >>
> >> Just a few links would be appreciated.
> >>
> >> Thank you.
> >> Eldred Mullany
> >>
> >>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: dynamically switching layouts

2009-12-17 Thread Olle Hallin
I've used this technique in the past with good results, even for the
notorious IE6.

So I wouldn't be too pessimistic. Try @media print first before you decide
to code a lot.

There is a usability problem with @media print though. Users are so trained
to look for printer-friendly versions of pages, that many of them don't try
to print the page they see on the screen. They simply don't know that a page
can have different appearance on different media. (Sadly enough, a majority
of web designers seem to be ignorant about this fact too.)

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/17 Ilya Obshadko 

> I was reading exactly the same page and it doesn't look very optimistic :)
>
> On Thu, Dec 17, 2009 at 10:21 PM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > Em Thu, 17 Dec 2009 19:03:38 -0200, Ilya Obshadko <
> ilya.obsha...@gmail.com>
> > escreveu:
> >
> >
> >  Looks like there's a lot of browser compatibility issues with this
> >> feature?
> >>
> >
> > I don't think so:
> > http://www.codestyle.org/css/media/print-BrowserSummary.shtml
> >
> >
>
> --
> Ilya Obshadko
>


Re: [newbie] EventListener in Tapestry 5 ?

2009-12-14 Thread Olle Hallin
I forgot to paste in the JavaDocs link:

http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/OnEvent.html

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/14 Olle Hallin 

> It is.
>
> Add this to your page/component class:
>
>   @OnEvent @Log public void onEvent() {}
>
> and watch the log file for the stream of events that are fired against this
> (catch-all) event handler.
>
> Olle Hallin
> Senior Java Developer and Architect
> olle.hal...@crisp.se
> www.crisp.se
> http://www.linkedin.com/in/ollehallin
>
>
>
> 2009/12/14 marioosh.net 
>
>
>>
>> Inge Solvoll wrote:
>> >
>> > Check out this one!
>> >
>> >
>> http://chenillekit.codehaus.org/chenillekit-tapestry/ref/org/chenillekit/tapestry/core/mixins/OnEvent.html
>> >
>>
>> Thanks:)
>> But... I see, that is a addition to tapestry. Why is not in native
>> Tapestry
>> 5 ? :(
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/newbie-EventListener-in-Tapestry-5-tp4163378p4163622.html
>> Sent from the Tapestry Users mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: [newbie] EventListener in Tapestry 5 ?

2009-12-14 Thread Olle Hallin
It is.

Add this to your page/component class:

  @OnEvent @Log public void onEvent() {}

and watch the log file for the stream of events that are fired against this
(catch-all) event handler.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/14 marioosh.net 

>
>
> Inge Solvoll wrote:
> >
> > Check out this one!
> >
> >
> http://chenillekit.codehaus.org/chenillekit-tapestry/ref/org/chenillekit/tapestry/core/mixins/OnEvent.html
> >
>
> Thanks:)
> But... I see, that is a addition to tapestry. Why is not in native Tapestry
> 5 ? :(
>
> --
> View this message in context:
> http://n2.nabble.com/newbie-EventListener-in-Tapestry-5-tp4163378p4163622.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Lock contention in PerthreadManagerImpl

2009-12-08 Thread Olle Hallin
JIRA https://issues.apache.org/jira/browse/TAP5-945 created

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2009/12/8 Thiago H. de Paula Figueiredo 

> Em Tue, 08 Dec 2009 11:08:38 -0200, Olle Hallin 
> escreveu:
>
>  Hi!
>>
>
> Hi!
>
>
>  Shall I file a JIRA issue, or have I missed something?
>>
>
> I'm no expert at concurrency, but please post it so the committers with the
> required knowledge can take a look at it. ;)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Lock contention in PerthreadManagerImpl

2009-12-08 Thread Olle Hallin
Hi!

We are load testing our new high volume site before soft launch, and we have
noticed that we have two sources of severe lock contention.
Of 300 threads, in average 165 are waiting for one of these two locks.

One is in ZipFile (caused by  @IncudeJavaScriptLibrary("classpath:...")) and
the other is in
org.apache.tapestry5.ioc.internal.services.PerthreadManagerImpl

The ZipFile bottleneck is harmless, since we will use a CDN in production.
The second one is harder to work-around, since it is caused by
RequestGlobals.storeServletRequestResponse().

I have browsed PerthreadManagerImpl.java, and have found two cases where a
lock on "this" is requested.

In both cases the lock is requested before accessing a ThreadLocal
(ThreadLocal.get() and ThreadLocal.remove()).
Since ThreadLocal is thread-safe, external locking is uneeded.

Shall I file a JIRA issue, or have I missed something?

We use T5 5.1.0.5

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin


Re: Verbose path for combined javascript

2009-10-26 Thread Olle Hallin
BTW, the source and javascript for Tapestry is as always in the Maven repo.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/26 Olle Hallin 

> Very constructive comment! NOT!
>
> You don't get better treatment by being rude.
>
> Olle Hallin
> Senior Java Developer and Architect
> olle.hal...@crisp.se
> www.crisp.se
>
>
>
>
> 2009/10/26 Argo Vilberg 
>
> ok ok, then write your own bugfree tapestry:)
>>
>> And by the way, where i get tapestry latest source. Are there any SVN
>> server?
>>
>> Thise combine javascript are massed up my hole javascript library so
>> nothing
>> works with no brausers!!
>>
>> So combine javascript is tottaly BUG!
>>
>>
>> ARgo
>>
>> 2009/10/26 Inge Solvoll 
>>
>> > I know, but I don't want to do that :)
>> >
>> > On Mon, Oct 26, 2009 at 2:15 PM, Argo Vilberg 
>> wrote:
>> >
>> > > Just use
>> > > 
>> > > tapestry.combine-scripts
>> > > false
>> > > 
>> > >
>> > >
>> > >
>> > > in your web.xml faile and there are no more virtual big links.
>> > >
>> > >
>> > > Argo
>> > >
>> > > 2009/10/26 Inge Solvoll 
>> > >
>> > > > Hi!
>> > > >
>> > > > The path to the aggregated javascript included on the page by T5
>> looks
>> > > like
>> > > > this:
>> > > >
>> > > > /assets/virtual/
>> > > >
>> > > >
>> > >
>> >
>> H4sIAJXQUWrDMAyAYTPY065RyhjUTrdlawc9S3AcOVOb2MZSRtMz7Wq7w$002bJAAn1J6ZsR3y8b$002f$002f6Jx4sQD1II8SRelCYCJkUmYmBtusZ3pHK5lZnMVYiePfcB5JGEXLZX0$002bSflz1YC4ZHuZok6wDEsZ$002fRNEhqPamy0eZUYqxmNk$002bS29zctmmBSNcwXv41cR2CejfG7t8$002bqizf63L3OvxAYupIypygQvZxPqT2877WeGexTuFuMTS$002bDd6B47GGH4g9f6Mby8MdJUJwtcVzwdhAWd9$002bcYtndKQuw4qiC5VmiMW2yIbwH4zpiYQ3AgAA.js
>> > > >
>> > > > This causes problems on some appservers. Specifically, JK connector
>> for
>> > > IIS
>> > > > chokes on this and won't deliver the scripts to the client, due to
>> the
>> > > very
>> > > > long url. We had to turn off script combination for this customer.
>> > > >
>> > > > Is it possible to use a shorter url? I realize that there probably
>> is a
>> > > > reason for this url, but does it REALLY have to be THAT long? :)
>> > > >
>> > >
>> >
>>
>
>


Re: Verbose path for combined javascript

2009-10-26 Thread Olle Hallin
Very constructive comment! NOT!

You don't get better treatment by being rude.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/26 Argo Vilberg 

> ok ok, then write your own bugfree tapestry:)
>
> And by the way, where i get tapestry latest source. Are there any SVN
> server?
>
> Thise combine javascript are massed up my hole javascript library so
> nothing
> works with no brausers!!
>
> So combine javascript is tottaly BUG!
>
>
> ARgo
>
> 2009/10/26 Inge Solvoll 
>
> > I know, but I don't want to do that :)
> >
> > On Mon, Oct 26, 2009 at 2:15 PM, Argo Vilberg 
> wrote:
> >
> > > Just use
> > > 
> > > tapestry.combine-scripts
> > > false
> > > 
> > >
> > >
> > >
> > > in your web.xml faile and there are no more virtual big links.
> > >
> > >
> > > Argo
> > >
> > > 2009/10/26 Inge Solvoll 
> > >
> > > > Hi!
> > > >
> > > > The path to the aggregated javascript included on the page by T5
> looks
> > > like
> > > > this:
> > > >
> > > > /assets/virtual/
> > > >
> > > >
> > >
> >
> H4sIAJXQUWrDMAyAYTPY065RyhjUTrdlawc9S3AcOVOb2MZSRtMz7Wq7w$002bJAAn1J6ZsR3y8b$002f$002f6Jx4sQD1II8SRelCYCJkUmYmBtusZ3pHK5lZnMVYiePfcB5JGEXLZX0$002bSflz1YC4ZHuZok6wDEsZ$002fRNEhqPamy0eZUYqxmNk$002bS29zctmmBSNcwXv41cR2CejfG7t8$002bqizf63L3OvxAYupIypygQvZxPqT2877WeGexTuFuMTS$002bDd6B47GGH4g9f6Mby8MdJUJwtcVzwdhAWd9$002bcYtndKQuw4qiC5VmiMW2yIbwH4zpiYQ3AgAA.js
> > > >
> > > > This causes problems on some appservers. Specifically, JK connector
> for
> > > IIS
> > > > chokes on this and won't deliver the scripts to the client, due to
> the
> > > very
> > > > long url. We had to turn off script combination for this customer.
> > > >
> > > > Is it possible to use a shorter url? I realize that there probably is
> a
> > > > reason for this url, but does it REALLY have to be THAT long? :)
> > > >
> > >
> >
>


Re: UTF-8 vs ISO-8859

2009-10-21 Thread Olle Hallin
We always use UTF-8.
We usually add a mandatory comment that contains non-ASCII characters at the
top of the file, and a unit test that verifies it. It's too common that some
developer screws up the file by opening it with wrong encoding.

Example:

*.properties:

# DO NOT REMOVE: räksmörgås

PropertiesEncodingTest.java

foreach *.properties:
   assertFirstLineEquals("# DO NOT REMOVE: räksmörgås")

This has save our ass many times :)

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/21 Ulrich Stärk 

>
>
> Am 21.10.2009 10:02 schrieb Stephan Windmüller:
>
>  Note: The issues I have is that eclipse keeps insisting that my
>>> .properties
>>> files are ISO-8859 and I have to manually switch encoding
>>> for each new property file i create or copy. Besides that's everyting
>>> works
>>> fine 
>>>
>>
> Forgot to mention: You can change the default encoding for a file type in
> Eclipse. Under Preferences  go to General -> Content Types, expand Text and
> choose Java properties file. At the bottom of the form you can now input
> your desired default encoding
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


T5.1: IllegalStateException when logging out from Tapestry-spring-security

2009-10-14 Thread Olle Hallin
Hi!
I have had some problems with T5 5.1.0.5 and tapestry-spring-security 2.1.0
and the logout behaviour.

After logging out, numerous java.lang.IllegalStateExceptions are thrown from
all over the place, due to @Persist and @SessionState objects that want's to
get stuffed back to the session.

I dived into
org.apache.tapestry5.internal.services.RequestImpl.getSession(boolean), and
it turns out that the following scenario breaks:

1. Session s1 = request.getSession(true);
2. s1.invalidate();
3. Session s2 = request.getSession(true);
4. assertNotNull(s2);
5. assertNotSame(s1, s2); <= KA-BOOM s1 == s2!!!
6. assertFalse(s2.isInvalidated());

I did the same using the underlying HttpServletRequest.getSession(), and it
works as expected (verified on Jetty 6.1.5).

I have logged the JIRA issue TAP5-891

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [ANNOUNCE] ChenilleKit 1.2.0 RELEASE

2009-10-13 Thread Olle Hallin
Hint: Use mavensearch.net for finding exactly what to paste into pom.xml
It indexes not only central, but also a bunch of other useful repositories.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/13 Borut Bolčina 

> Roy,
>
> you do not have to specify the  as the chenillekit is in the
> main maven repository (included by default).
>
> Cheers,
> Borut
>
> 2009/10/13 Roy Douglas 
>
> >
> > thanks, how about the repo? is it
> >
> > 
> >chenillekit
> >http://repo1.maven.org/maven2/org/chenillekit/
> > 
> >
> >
> >
> >
> >
> > Kalle Korhonen-2 wrote:
> > >
> > > Depending on what you need, e.g:
> > >   
> > >   org.chenillekit
> > >   chenillekit-tapestry
> > >   1.2.0
> > >   
> > >
> > > The released artifacts are in repo1...
> > >
> > > Kalle
> > >
> > >
> > > On Tue, Oct 13, 2009 at 12:08 PM, Roy Douglas
> > >  wrote:
> > >>
> > >> Hi,
> > >>
> > >> sorry, I really don't know what to put it in my pom.xml, I tried to
> > >> search
> > >> through google and here,
> > >> would you please tell me what is the url of the repo and group id and
> > >> artifact id I should use?
> > >>
> > >> Thanks
> > >> Roy
> > >>
> > >>
> > >> Massimo Lusetti wrote:
> > >>>
> > >>> Hi everyone,
> > >>>   I'm happy to announce the 1.2.0 release of the ChenilleKit project,
> > >>> our first release compatible with Tapestry 5.1.0.5.
> > >>>
> > >>> The ChenilleKit project lately have suffered from various issues
> > >>> affecting project management that have complicated more then the
> > >>> necessary the development.
> > >>>
> > >>> We finally find peace at CodeHaus http://chenillekit.codehaus.org.
> > >>>
> > >>> Anyway the release is done now and for the first time you will find
> > >>> 1.2.0 artifacts in the central maven repo, thanks to CodeHaus syncing
> > >>> with it. I think this is a great plus for us and everyone using
> > >>> ChenilleKit.
> > >>>
> > >>> I would like 1.2.0 to be released as a distribution outside maven
> > >>> scope too, but I failed, so you will find 1.2.0 only as a maven
> > >>> artifacts, sorry for that.
> > >>>
> > >>> Due to our late moves (from googlecode to tapestry...@formos and
> then
> > >>> to CodeHaus) we lost our JIRA issues and we cannot produce a reliable
> > >>> release notes.
> > >>>
> > >>> I would like to remember one more time to everyone interested that we
> > >>> have our own mailing lists:
> > >>>  - annou...@chenillekit.codehaus.org Projects announcing important
> > >>> news about the project, used by the team.
> > >>>  - u...@chenillekit.codehaus.org Users discussions and support
> > >>>  - d...@chenillekit.codehaus.org Developers discussions about all
> > >>> aspect of Chenillekit coding.
> > >>>  - s...@chenillakit.codehaus.org Commit logs and JIRA issues
> > >>>
> > >>> Cheers
> > >>> --
> > >>> Massimo
> > >>> http://meridio.blogspot.com
> > >>>
> > >>> -
> > >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> > >>>
> > >>>
> > >>>
> > >>
> > >> --
> > >> View this message in context:
> > >>
> >
> http://www.nabble.com/-ANNOUNCE--ChenilleKit-1.2.0-RELEASE-tp25511012p25878865.html
> > >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> > >>
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > >> For additional commands, e-mail: users-h...@tapestry.apache.org
> > >>
> > >>
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> > >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/-ANNOUNCE--ChenilleKit-1.2.0-RELEASE-tp25511012p25879735.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: [T4] Two users see the same data - problem with ASO objects

2009-10-13 Thread Olle Hallin
Well, google for "singletons considered harmful" and reserve a couple of
hours for reading...
Here's one that explains it pretty well:
http://tech.puredanger.com/2007/07/03/pattern-hate-singleton

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/13 Argo Vilberg 

> anti-pattern?
>
> why it makes testing much harder?
>
> I use singleton for my own connection pooling and cache and cluster system.
> All works very fine!
>
> 2009/10/13 Olle Hallin 
>
> > Singletons is an anti-pattern that the Java community abandoned years
> ago!
> > The main reason is that it makes testing much harder.
> >
> > Besides, your example is wrong. The constructor must be private, or else
> > the
> > singleton is broken.
> >
> > Olle Hallin
> > Senior Java Developer and Architect
> > olle.hal...@crisp.se
> > www.crisp.se
> >
> >
> >
> >
> > 2009/10/13 Argo Vilberg 
> >
> > > very simple solution is creata Singleton java class.
> > >
> > >
> > > public class MallBean{
> > > public final static MallBean INSTANCE = new MallBean();
> > >
> > >public MallBean() {
> > >}
> > >
> > > 
> > >
> > > }
> > >
> > >
> > > And access
> > >
> > > MallBean.INSTANCE.getSomething.
> > >
> > >
> > > And if you first time calling this, class is created and only ONE this
> > type
> > > of class can be created.
> > > And this class is accessible everyone.
> > >
> > >
> > > Enjoy!
> > >
> > > Argo
> > >
> > >
> > > 2009/10/13 TomMax 
> > >
> > > >
> > > > Hi all,
> > > >
> > > > I'm working in a developers team with Tapestry applications (version
> > > 4.0.2)
> > > > for more than 2 years. Our Tapestry applications works on various
> > > > Application Servers (JBoss, SAP Netweaver), and usually we were able
> in
> > > our
> > > > team to resolve all problems, recently however, we spotted a problem
> > with
> > > > Application State Object, which is responsible for user session data
> > and
> > > we
> > > > can't find the bug.
> > > >
> > > > The problem is that two users see sometimes the same data on a page.
> In
> > > our
> > > > scenario User1 and User2 have their own userSession objects (they are
> > ASO
> > > > object with session scope), these objects keep all their data, and
> > these
> > > > objects are injected to every page in .page file:
> > > >
> > > > 
> > > >
> > > > Every user has own userSession object, so every user should see only
> > his
> > > > own
> > > > data on a page, but sometimes (quite rarely), we got the situation,
> > that
> > > > User2 sees the data from User1 userSession object when he get the
> page,
> > > > where User1 was earlier.
> > > > So far I know, in case of ASO objects, the references in a page to
> > these
> > > > objects, should be set to null on pageDetach action. So each time
> when
> > > the
> > > > user is receiving the page from PagePool (or newly created page), he
> > > should
> > > > obtain also fresh ASO object from ApplicationStateManager.
> > > > We have got currently this problem not so often (usually it is one or
> > two
> > > > times in a two week period, in case when the application is used by
> 3-4
> > > > persons 8 hours per day), and when the problem happens, usually all
> > > working
> > > > users are receiving wrong data (they see the data from other users).
> > > >
> > > > I hope someone will be able to help me.
> > > >
> > > > Thanks
> > > > Tomek
> > > >
> > > >
> > > > --
> > > > View this message in context:
> > > >
> > >
> >
> http://www.nabble.com/-T4--Two-users-see-the-same-data---problem-with-ASO-objects-tp25872478p25872478.html
> > > > Sent from the Tapestry - User mailing list archive at Nabble.com.
> > > >
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >
> > > >
> > >
> >
>


Hibernate Validator 4 released, any plans for adding support in T5?

2009-10-13 Thread Olle Hallin
Hi,
Now when Hibernate Validator 4 and soon also the JSR-303 spec itself is
released, it wouldbe great to learn if someone is planning to add support
for it in Tapestry 5.

Are there any such plans?

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [T4] Two users see the same data - problem with ASO objects

2009-10-13 Thread Olle Hallin
Singletons is an anti-pattern that the Java community abandoned years ago!
The main reason is that it makes testing much harder.

Besides, your example is wrong. The constructor must be private, or else the
singleton is broken.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/13 Argo Vilberg 

> very simple solution is creata Singleton java class.
>
>
> public class MallBean{
> public final static MallBean INSTANCE = new MallBean();
>
>public MallBean() {
>}
>
> 
>
> }
>
>
> And access
>
> MallBean.INSTANCE.getSomething.
>
>
> And if you first time calling this, class is created and only ONE this type
> of class can be created.
> And this class is accessible everyone.
>
>
> Enjoy!
>
> Argo
>
>
> 2009/10/13 TomMax 
>
> >
> > Hi all,
> >
> > I'm working in a developers team with Tapestry applications (version
> 4.0.2)
> > for more than 2 years. Our Tapestry applications works on various
> > Application Servers (JBoss, SAP Netweaver), and usually we were able in
> our
> > team to resolve all problems, recently however, we spotted a problem with
> > Application State Object, which is responsible for user session data and
> we
> > can't find the bug.
> >
> > The problem is that two users see sometimes the same data on a page. In
> our
> > scenario User1 and User2 have their own userSession objects (they are ASO
> > object with session scope), these objects keep all their data, and these
> > objects are injected to every page in .page file:
> >
> > 
> >
> > Every user has own userSession object, so every user should see only his
> > own
> > data on a page, but sometimes (quite rarely), we got the situation, that
> > User2 sees the data from User1 userSession object when he get the page,
> > where User1 was earlier.
> > So far I know, in case of ASO objects, the references in a page to these
> > objects, should be set to null on pageDetach action. So each time when
> the
> > user is receiving the page from PagePool (or newly created page), he
> should
> > obtain also fresh ASO object from ApplicationStateManager.
> > We have got currently this problem not so often (usually it is one or two
> > times in a two week period, in case when the application is used by 3-4
> > persons 8 hours per day), and when the problem happens, usually all
> working
> > users are receiving wrong data (they see the data from other users).
> >
> > I hope someone will be able to help me.
> >
> > Thanks
> > Tomek
> >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/-T4--Two-users-see-the-same-data---problem-with-ASO-objects-tp25872478p25872478.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: [T4] Two users see the same data - problem with ASO objects

2009-10-13 Thread Olle Hallin
Another thing to look for are object references inside the ASO.

Perhaps they point to the same mutable object?

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/13 Martin Strand 

> Hmm, it sounds unlikely that different sessions would get mixed up like
> that.
> Perhaps the problem is with some other variable that happens to be visible
> to several users?
>
> I haven't done Tap4 in a while, but maybe you could look for:
> - any field in a page class, they should probably all be abstract getters.
>  You need to reset any such fields manually before rendering the page.
> - any non-final field in a service, they should probably all be final and
> initialized in the constructor
>  Hivemind services are singletons by default so if you put any stateful
> data there it will be visible to all users
>
>
> On Tue, 13 Oct 2009 15:01:33 +0200, TomMax  wrote:
>
>  Hi all,
>>
>> I'm working in a developers team with Tapestry applications (version
>> 4.0.2)
>> for more than 2 years. Our Tapestry applications works on various
>> Application Servers (JBoss, SAP Netweaver), and usually we were able in
>> our
>> team to resolve all problems, recently however, we spotted a problem with
>> Application State Object, which is responsible for user session data and
>> we
>> can't find the bug.
>>
>> The problem is that two users see sometimes the same data on a page. In
>> our
>> scenario User1 and User2 have their own userSession objects (they are ASO
>> object with session scope), these objects keep all their data, and these
>> objects are injected to every page in .page file:
>>
>> 
>>
>> Every user has own userSession object, so every user should see only his
>> own
>> data on a page, but sometimes (quite rarely), we got the situation, that
>> User2 sees the data from User1 userSession object when he get the page,
>> where User1 was earlier.
>> So far I know, in case of ASO objects, the references in a page to these
>> objects, should be set to null on pageDetach action. So each time when the
>> user is receiving the page from PagePool (or newly created page), he
>> should
>> obtain also fresh ASO object from ApplicationStateManager.
>> We have got currently this problem not so often (usually it is one or two
>> times in a two week period, in case when the application is used by 3-4
>> persons 8 hours per day), and when the problem happens, usually all
>> working
>> users are receiving wrong data (they see the data from other users).
>>
>> I hope someone will be able to help me.
>>
>> Thanks
>> Tomek
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


How to write a Testify test for an onActivate() that returns a URL?

2009-10-09 Thread Olle Hallin
Hi,

I'm struggling with writing a test for a page that just redirects to an
external page.

The page basically looks like this:

public class Redirecter {

  @Inject
  private UrlManager urlManager;

  public Object onActivate() {
java.net.URL url = new URL(urlManager.getExternalUrlFor(some-string));
return url;
  }
}

I have managed to mock urlManager.getExternalUrlFor(), but then Testify
throws

java.lang.RuntimeException: TestableResponse: Method sendRedirect() not yet
implemented.

Any ideas?

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Re: T5, tapestry-spring-security, slf4j MDC

2009-10-09 Thread Olle Hallin
Do like this:
MDC.put("xxx", ...);
MDC.put("yyy", ...);

try {
   return handler.service(request, response);
} finally {
  MDC.remove("xxx")
  MDC.remove("yyy")
}

or else you will have problems when your request throws an exception

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/9 

> Hi!
>
> Borut Bolčina  schrieb am 09.10.2009 14:55:32:
>
> > this is what I did:
> >
> > public class RequestLoggingFilter implements HttpServletRequestFilter {
> > public final RequestGlobals requestGlobals;
> >
> > public RequestLoggingFilter(final RequestGlobals requestGlobalss) {
> > this.requestGlobals = requestGlobalss;
> > }
> >
> > @Override
> > public boolean service(HttpServletRequest request,
> HttpServletResponse
> > response, HttpServletRequestHandler handler)
> > throws IOException {
> > MDC.put("remoteIP",
> > this.requestGlobals.getHTTPServletRequest().getRemoteAddr());
> >
> > String s =
> > this.requestGlobals.getHTTPServletRequest().getRequestedSessionId();
> > if (s == null) {
> > s = "";
> > }
> > MDC.put("sessionID", s);
> > return handler.service(request, response);
> > }
> > }
>
> >
> > but I feel I am missing something. Where do I put the code:
> > MDC.remove("remoteIP");
> > MDC.remove("sessionID");
> >
>
> In a similar situation, I used something like
> 
> @Override
>public boolean service(HttpServletRequest request, HttpServletResponse
> response, HttpServletRequestHandler handler)
>throws IOException {
>MDC.put("remoteIP",
> this.requestGlobals.getHTTPServletRequest().getRemoteAddr());
>
>String s =
> this.requestGlobals.getHTTPServletRequest().getRequestedSessionId();
>if (s == null) {
>s = "";
>}
>MDC.put("sessionID", s);
> boolean result = handler.service(request, response);
>
>MDC.remove("remoteIP");
>MDC.remove("sessionID");
>
> return result;
>}
> }
> 
>
> but I'm not sure if it does the right thing in all situations.
>
> Dirk
>
>
>
> BGS Beratungsgesellschaft
> Software Systemplanung AG
>
>
>
>
> Niederlassung Köln/Bonn
> Grantham-Allee 2-8
> 53757 Sankt Augustin
> Fon: +49 (0) 2241 / 166-500
> Fax: +49 (0) 2241 / 166-680
> www.bgs-ag.de
> Geschäftssitz Mainz
> Registergericht
> Amtsgericht Mainz
> HRB 62 50
>
> Aufsichtsratsvorsitzender
> Klaus Hellwig
> Vorstand
> Hermann Kiefer
> Nils Manegold
> Thomas Reitz
>
>


Re: T5, tapestry-spring-security, slf4j MDC

2009-10-09 Thread Olle Hallin
We do something similar. We have implemented a RequestFilter that pushes the
HttpSession ID (if any) onto the Log4j Nested Diagnostics Context (NDC)
before the request, and pops it afterwards.
I guess that the same approach could be used for pushing usernames in the
SLF4J MDC, provided that you can get hold of them from a RequestFilter.

Good to know: Tapestry 5.1 stores @SessionStateObjects in the session under
the key "sso:" + MySessionStateObject.class.getName(). ("aso:" in 5.0.*)

HTH,
Olle

Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/10/9 Borut Bolčina 

> Hello,
>
> has anybody implemented logging with MDC %X{username}?
>
> I would like to track users in my logs by their username and/or IP address.
> Before I dive in, I just wanna ask if someone has already done it?
>
> Thanks, Borut
>


Re: T5 - Post Form To SSL

2009-10-04 Thread Olle Hallin
Created https://issues.apache.org/jira/browse/TAP5-874 .

Olle

2009/10/2 Thiago H. de Paula Figueiredo 

> Em Thu, 01 Oct 2009 20:11:08 -0300, Daniel Jones 
> escreveu:
>
>  Hi There,
>>
>
> Hi!
>
>  Is there any way to tell a form to post using https.  What I was ideally
>> looking for was an extra parameter on the Form component, for example:
>>
>> 
>>  ...
>> 
>>
>
> Please post a JIRA about it unless some comes with an answer. ;)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: PageLink / context / newbie question ...

2009-10-02 Thread Olle Hallin
What happens if you introduce *public Object[] getPagelinkContext() { ... }*
and change the template to
... ?

Olle Hallin


2009/10/2 Gunnar Eketrapp 

> Can't find the documentaion on how to pass multiple values in the context.
>
> I have seen it somewhere
>
> I need to pass two strings where one of them may be null.
>
> E.g.
>  Pass two
> strings 
>
> 

Re: T5 - Post Form To SSL

2009-10-02 Thread Olle Hallin
+1 on this!

We have the same use case in our new app.

We have so far solved it with a URLRewrite filter. This is a clumsy way of
doing it IMHO. A parameter on the Form component would be much cleaner.

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


2009/10/2 Daniel Jones 

>
> Hi There,
>
> Is there any way to tell a form to post using https.  What I was ideally
> looking for was an extra parameter on the Form component, for example:
>
> 
>  ...
> 
>
> Just so you have an idea of what I'm trying to achieve.  I have a login
> form
> on every page (this is part of my layout component) and I don't want every
> page to be served over https.  So a way of telling the form that it should
> be posted to the https version of the current page.
>
> Many Thanks,
> Daniel
> --
> View this message in context:
> http://www.nabble.com/T5---Post-Form-To-SSL-tp25708078p25708078.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: How to implement a user tracker in T5 ....

2009-09-30 Thread Olle Hallin
Also good to know is that @SessionStateObjects (was:
@ApplicationStateObject) are stored in the HTTP session with the key "sso:"
+ MySessionStateObject.class.getName() (Tapestry 5.1)

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/9/30 cordenier christophe 

> If you choose to use a servlet session listener, keep in mind that the
> Tapestry Registry can be obtained from the application context under this
> key "TapestryFilter.REGISTRY_CONTEXT_NAME".
>
> Then you can have access to all Tapestry 5 services including the
> ApplicationStateManager.
>
> 2009/9/30 Gunnar Eketrapp 
>
> > Hi !
> >
> > I am porting a huge jsp/spring kludge to T5. (And love it ...)
> >
> > I have now come across a UserTracker implementation that tracks currently
> > logged in users.
> >
> > How is this best done in T5 anyone?
> >
> > I could perhaps stick with the old servlet but I am not sure of how T5
> > creaets/destoys sessions and
> > adds/removes attributes.
> >
> > You know now I have a state ASO where the user object is stored within.
> >
> > Thanks in advance,
> > Gunnar Eketrapp,
> > Stockholm, Sweden
> >
> >
> >
> >
> > 
> > Current User tracker implementaon using HttpSessionListener +
> > HttpSessionAttributeListener
> > 
> >
> > public class UserTracker implements HttpSessionListener,
> > HttpSessionAttributeListener {
> >private static final Logger logger =
> > Logger.getLogger(UserTracker.class.getName());
> >private static UserTracker instance;
> >
> >public static UserTracker getInstance() {
> >return instance;
> >}
> >
> >public UserTracker() {
> >instance = this;
> >}
> >
> >private SortedSet current = new
> > TreeSet();
> >
> >public SortedSet getCurrent() {
> >SortedSet result = new
> > TreeSet();
> >synchronized (current) {
> >result.addAll(current);
> >}
> >return result;
> >}
> >
> >public SortedSet getCurrentUsernames() {
> >SortedSet result = new TreeSet();
> >synchronized (current) {
> >for( UserTrackerEntry en : current ) {
> >result.add(en.getUsername());
> >}
> >}
> >return result;
> >}
> >
> >public void attributeAdded(HttpSessionBindingEvent e) {
> >if( "user".equals(e.getName()) ) {
> >User user = (User) e.getValue();
> >synchronized (current) {
> >String sessionId = e.getSession().getId();
> >current.add(new
> > UserTrackerEntry(user.getUsername(),user.getFullName(),sessionId,new
> > Date()));
> >}
> >}
> >}
> >
> >public void attributeRemoved(HttpSessionBindingEvent e) {
> >if( "user".equals(e.getName()) ) {
> >User user = (User) e.getValue();
> >synchronized (current) {
> >String sessionId = e.getSession().getId();
> >current.remove(new
> > UserTrackerEntry(user.getUsername(),user.getFullName(),sessionId,new
> > Date()));
> >}
> >}
> >}
> >
> >public void attributeReplaced(HttpSessionBindingEvent arg0) {
> >// ignore
> >}
> >
> >public void sessionCreated(HttpSessionEvent e) {
> >User user = (User) e.getSession().getAttribute("user");
> >if( user != null ) {
> >synchronized (current) {
> >String sessionId = e.getSession().getId();
> >current.add(new
> > UserTrackerEntry(user.getUsername(),user.getFullName(),sessionId,new
> > Date()));
> >}
> >}
> >}
> >
> >public void sessionDestroyed(HttpSessionEvent e) {
> >User user = (User) e.getSession().getAttribute("user");
> >if( user != null ) {
> >synchronized (current) {
> >String sessionId = e.getSession().getId();
> >current.remove(new
> > UserTrackerEntry(user.getUsername(),user.getFullName(),sessionId,new
> > Date()));
> >}
> >}
> >}
> >
> > }
> >
>


Re: [Announce] ioko-tapestry-commons-1.4.0

2009-09-18 Thread Olle Hallin
Yes, it is because dual EHCaches.

We don't use disk persistence, so we haven't modified the diskStore
attribute in ehcache.xml.
So starting the next CacheManager instance causes a collision on this.

I also want to avoid having duplicate config files for EHCache, so I wrote a
custom CacheContentImpl which uses the already existing CacheManager. I
swapped it by means of Tapestry's service override mechanism. Works like a
charm!

Olle




2009/9/17 Ben Gidley 

> Hi,
> Is the error your getting complaining about 2 ehcaches? We have this in one
> of our apps and it all works fine - so I am puzzled you are getting this
> error.
>
> Ben Gidley
>
> www.gidley.co.uk
> b...@gidley.co.uk
>
>
> On Thu, Sep 17, 2009 at 2:15 PM, Olle Hallin  wrote:
>
> > Hi!
> >
> > I just made an attempt to introduce the Ioko tapestry-caching library in
> > our
> > project, but stumbled on the fact that we already use EhCache. (We use
> > tapestry-cache 1.5.0)
> >
> > (Manifested as an exception from ContentCacheImpl. when it tries to
> > create the CacheManager instance.)
> >
> > I then tried to build my own version of the ContentCache service, hoping
> > that it would replace the one in the Ioko CacheModule. But Tapestry then
> > complains that there is more than one implementation of that interface.
> >
> > I then tried to decorate the ContentCache service built by CacheModule,
> but
> > that does not prevent the original service from being started.
> >
> > For us it would be valuable with some mechanism where one can inject an
> > already running
> > CacheManager into the Ioko ContentCacheImpl.
> >
> > Another feasible solution would be to provide our own implementation, and
> > *prevent* the Ioko instance to start. Is it possible to prevent builder
> > methods in other modules from being executed?
> >
> > Any ideas?
> >
> > Olle Hallin
> > Senior Java Developer and Architect
> > olle.hal...@crisp.se
> > www.crisp.se
> >
> >
> >
> >
> > 2009/8/6 Otho 
> >
> > > There are some typos on
> > > http://tapestry.formos.com/projects/ioko-tapestry-commons/ . In all
> > > dependencies the starting slash of the closing  is
> missing.
> > >
> > >
> > > 2009/8/5 Inge Solvoll 
> > >
> > > > Excellent. I love the convenient javascript and jquery jars!
> > > >
> > > > On Tue, Aug 4, 2009 at 3:04 PM, Ben Gidley  wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > ioko-tapestry-commons 1.4.0 has been released. This is a bug fix
> > > release
> > > > to
> > > > > address issues in including the libraries.
> > > > >
> > > > > Full details and downloads are available at
> > > > > http://tapestry.formos.com/projects/ioko-tapestry-commons/
> > > > >
> > > > > Ben Gidley
> > > > >
> > > > > www.gidley.co.uk
> > > > > b...@gidley.co.uk
> > > > >
> > > >
> > >
> >
>


Re: [Announce] ioko-tapestry-commons-1.4.0

2009-09-17 Thread Olle Hallin
Gee, super!

Thanx,
Olle


2009/9/17 Ulrich Stärk 

> http://tapestry.apache.org/tapestry5/tapestry-ioc/cookbook/override.html
>
> On 17.09.2009 15:15 schrieb Olle Hallin:
>
>  Hi!
>>
>> I just made an attempt to introduce the Ioko tapestry-caching library in
>> our
>> project, but stumbled on the fact that we already use EhCache. (We use
>> tapestry-cache 1.5.0)
>>
>> (Manifested as an exception from ContentCacheImpl. when it tries to
>> create the CacheManager instance.)
>>
>> I then tried to build my own version of the ContentCache service, hoping
>> that it would replace the one in the Ioko CacheModule. But Tapestry then
>> complains that there is more than one implementation of that interface.
>>
>> I then tried to decorate the ContentCache service built by CacheModule,
>> but
>> that does not prevent the original service from being started.
>>
>> For us it would be valuable with some mechanism where one can inject an
>> already running
>> CacheManager into the Ioko ContentCacheImpl.
>>
>> Another feasible solution would be to provide our own implementation, and
>> *prevent* the Ioko instance to start. Is it possible to prevent builder
>> methods in other modules from being executed?
>>
>> Any ideas?
>>
>> Olle Hallin
>> Senior Java Developer and Architect
>> olle.hal...@crisp.se
>> www.crisp.se
>>
>>
>>
>>
>> 2009/8/6 Otho 
>>
>>  There are some typos on
>>> http://tapestry.formos.com/projects/ioko-tapestry-commons/ . In all
>>> dependencies the starting slash of the closing  is missing.
>>>
>>>
>>> 2009/8/5 Inge Solvoll 
>>>
>>>  Excellent. I love the convenient javascript and jquery jars!
>>>>
>>>> On Tue, Aug 4, 2009 at 3:04 PM, Ben Gidley  wrote:
>>>>
>>>>  Hi,
>>>>>
>>>>> ioko-tapestry-commons 1.4.0 has been released. This is a bug fix
>>>>>
>>>> release
>>>
>>>> to
>>>>
>>>>> address issues in including the libraries.
>>>>>
>>>>> Full details and downloads are available at
>>>>> http://tapestry.formos.com/projects/ioko-tapestry-commons/
>>>>>
>>>>> Ben Gidley
>>>>>
>>>>> www.gidley.co.uk
>>>>> b...@gidley.co.uk
>>>>>
>>>>>
>>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [Announce] ioko-tapestry-commons-1.4.0

2009-09-17 Thread Olle Hallin
Hi!

I just made an attempt to introduce the Ioko tapestry-caching library in our
project, but stumbled on the fact that we already use EhCache. (We use
tapestry-cache 1.5.0)

(Manifested as an exception from ContentCacheImpl. when it tries to
create the CacheManager instance.)

I then tried to build my own version of the ContentCache service, hoping
that it would replace the one in the Ioko CacheModule. But Tapestry then
complains that there is more than one implementation of that interface.

I then tried to decorate the ContentCache service built by CacheModule, but
that does not prevent the original service from being started.

For us it would be valuable with some mechanism where one can inject an
already running
CacheManager into the Ioko ContentCacheImpl.

Another feasible solution would be to provide our own implementation, and
*prevent* the Ioko instance to start. Is it possible to prevent builder
methods in other modules from being executed?

Any ideas?

Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se




2009/8/6 Otho 

> There are some typos on
> http://tapestry.formos.com/projects/ioko-tapestry-commons/ . In all
> dependencies the starting slash of the closing  is missing.
>
>
> 2009/8/5 Inge Solvoll 
>
> > Excellent. I love the convenient javascript and jquery jars!
> >
> > On Tue, Aug 4, 2009 at 3:04 PM, Ben Gidley  wrote:
> >
> > > Hi,
> > >
> > > ioko-tapestry-commons 1.4.0 has been released. This is a bug fix
> release
> > to
> > > address issues in including the libraries.
> > >
> > > Full details and downloads are available at
> > > http://tapestry.formos.com/projects/ioko-tapestry-commons/
> > >
> > > Ben Gidley
> > >
> > > www.gidley.co.uk
> > > b...@gidley.co.uk
> > >
> >
>


Re: How to pass message's parameters in template

2009-08-17 Thread Olle Hallin
Yes there is, in the Chenille Kit.

See http://www.chenillekit.org/chenillekit-tapestry/messageformatbinding.html

Olle


2009/8/17 Radek Terber :
> Hi all.
>
> Is there any way how to pass parameter to message directly in TML file ?
>
> For example:
> I have component Example1 (resides in "Example1.java") and in it's
> "Example1.tml" is something like this:
> 
> in Example1.tml is
> --
> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"; >
> ...
> ${message:any-message-text-requires-parameter}
> ...
>
> 
> --
> 
> in "Example1.properties" is
> --
> any-message-text-requires-parameter=Any text which "%s" here requires
> parameter
> --
>
> And now, I would like pass the "%s" value directly in TML file (to avoid
> divide those text to two or more fragments).
> I know possibility to prepare entire message in JAVA class, but it is more
> coding, more getters ...
>
> Thanks.
>
>
>
>
> ---------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se

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



Re: [T5.1] Avoiding "new"

2009-07-28 Thread Olle Hallin
Have a look at the ApplicationStateManager. It is responsible for
instantiating SessionStateObjects (aka ApplicationStateObjects), that can't
be created with new.

HTH,
Olle


2009/7/29 xfile80303 

>
> Thanks Thiago,
>
> Your insight, as always, is appreciated.
>
> Unfortunately there seems to be a snag...
>
> In my page I have this:
>
>@SessionState
>private User ssUser;
>
> In my Module I have this:
>
>public static void bind(ServiceBinder binder)
>{
>//...
>binder.bind(User.class, UserImpl.class);
>//...
>}
>
> (I've commented out the contribution of the new service scope for now)
>
> and I get this:
>
> org.apache.tapestry5.runtime.ComponentEventException
> Class com.java.dse.cwp.eos.idm.User does not contain a public constructor
> needed to autobuild.
>
> It's as if Tapestry does not recognize the binding.  Other bindings I have
> work as expected... is there something special about SessionState objects?
>
> BTW, User and UserImpl are in my services package, with my other, working,
> bound services.
>
> Thanks,
>
> Levi
>
>
> Thiago H. de Paula Figueiredo wrote:
> >
> > Hi!
> >
> > I guess you need a new service scope. Tapestry-IoC provides two
> > out-of-the-box: singleton (default) and per-thread (one object created
> for
> > each different thread). You can add a new lifecycle that always returns a
> > new object. In Spring, this is called the prototype scope.
> >
> http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/ioc/annotations/Scope.html
> > will give you some hints about how to add new scopes.
> >
> > A less elegant solution is to inject ObjectLocator and use its
> autobuild()
> > method.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/-T5.1--Avoiding-%22new%22-tp3346190p3346523.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Tapestry 5 and JSR-303 plans?

2009-06-25 Thread Olle Hallin
Ideally, there should be a pluggability layer here.

I started using Hibernate Validator a couple of years ago, but abandoned it
since it's not multi-lingual. (see
http://opensource.atlassian.com/projects/hibernate/browse/HV-44).

Now I use JaValid instead. Similar feature set, but better implementation.
JSR-303 is yet another validation framework.

Just my 2c.

Olle


2009/6/24 Thiago H. de Paula Figueiredo 

> Em Wed, 24 Jun 2009 15:17:56 -0300, Patrick Moore 
> escreveu:
>
>  Hi there --
>>
>
> Hi!
>
>  I just found out about JSR-303 ( bean validation JSR ). It may be too soon
>> to ask.
>>
>
> A little bit, as it was not approved tyet..
>
>  but any plans on implementing this JSR inside of Tapestry?
>>
>
> I implemented something very similar, but with Hibernate Validator, so it
> must be easy, as JSR 303 looks like Hibernate Validator standerdized and
> more powerful :). It is in an unreleased version of Tapestry CRUD-Hibernate
> Validator (
> http://www.arsmachina.com.br/project/tapestrycrudhibernatevalidator, you
> can find sources there) It has two parts: some classes that implement
> ValidationConstraintGenerator, automatically adding the required validation
> for properties annotated with @NotNull, for example, and a mixin,
> HibernateValidatorMixin, that executes all the validations again, including
> the ones defined by @AssertTrue and @AssertFalse, in BaseEditPage (from
> Tapestry CRUD) subclasses.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [Tapestry Central] Why chose Tapestry?

2009-06-17 Thread Olle Hallin
on in any
>>>> technology. The image I'm getting is one where there is no build
>>>> server, no continuous integration, at best CVS for source code
>>>> management (or possibly one of those "shared directory"
>>>> monstrosities)  i.e., a chaotic environment where errors are
>>>> allowed to be checked in to the trunk and can go unnoticed for some
>>>> time.
>>>> The solution to coding errors in pages or components is not to wait
>>>> until your testers (or end users) find the bugs, but to identify and
>>>> fix the bugs early. That's called "engineering discipline" and the
>>>> reality is that even self-professed "mediocre" developers can do it.
>>>> Tapestry helps because it fails early and has great exception reporting
>>>> to guide you right the problem so that you can fix it.
>>>> Another factor here is enforced helplessness. If only Fred understands
>>>> page B and he's out when it's broken, then all development stops
>>>> waiting for Fred to get back. I hit this problem myself, years ago
>>>> working on a large Struts application (those words give me the heebie
>>>> jeebies now!). We had lots of code, a fragile and slow build process,
>>>> and many little code "fiefdoms". I spent too much wasted time twiddling
>>>> my thumbs.
>>>> Nobody should "own the code"; if page B is is broken, Julie (who
>>>> normally develops page A) should be free to fix it. Julie will need to
>>>> understand the page B code well enough to fix it, but also you need an
>>>> overall environment with shared source, no repository locks (that is,
>>>> nothing that says "Only Fred can change this file"), and no management
>>>> PHB's getting in the way. Pair programming is the best way for Fred and
>>>> Julie to share knowledge so that they can understand each other's code.
>>>> Even if pairing occurs only part time, it's very effective at knowledge
>>>> transfer as well as ordinary coding.
>>>> The idea that "mediocre" developers should use JSF as it is more
>>>> tolerant of errors is absurd! Tapestry 5 is designed to improve
>>>> productivity for all developers, by streamlining, simplifying, being
>>>> smart and being concise ... not to mention live class reloading and
>>>> best-of-breed exception reporting, which makes it fast to identify and
>>>> fix those errors.
>>>> If your doctor tells you to eat less red meat, that doesn't mean you
>>>> should switch to a diet of fried chicken three meals a day! Likewise,
>>>> if you have concerns with code quality from your developers, you should
>>>> not switch to a less agile, more code-intensive, less supportive
>>>> development model and hope to catch all the bugs in QA. Sweeping
>>>> problems under the rug is never a winning strategy.
>>>> Coming down off my soap box, I should also add that Tapestry 5.1 works
>>>> a little bit differently than 5.0 in this respect, so it does (in fact)
>>>> defer more of the page loading and validation until a link is actually
>>>> clicked. This is more for performance reasons than to shield developers
>>>> from application problems. Even in 5.0, the loading and validation was
>>>> the "reach" from page A to pages explicitly referenced (usually via
>>>> PageLink during the rendering of page A), so it's a highly unlikely
>>>> case that a single error in a 1000 page application will keep the
>>>> application from starting up, unless the start page of the application
>>>> links to all 999 other pages.
>>>> Re-reading the above post I can't emphasize enough: you can't ignore
>>>> quality problems. Quality problems lead to development failures,
>>>> schedule slips, missing functionality, low morale and high turnover.
>>>> Saying "we don't have time to fix the quality problem first" is to
>>>> ignore the the second law of Thermodynamics. You are expecting a
>>>> miracle, literally writing it into your project plan.
>>>> Formos addresses this issue two ways: First, we use Scrum and deliver
>>>> on (typically) 4 week cycles. Thus we set real deadlines and have a
>>>> constant check on quality (we're providing working code constantly). We
>>>> don't even try to predict what we'll be doing six months or two years
>>>> from now, we just deliver a steady, manageable stream of software.
>>>> Secondly, Formos uses Tapestry because of all the reasons that the
>>>> anonymous developer's organization rejected it, and for many, many more
>>>> reasons besides.
>>>>
>>>> --
>>>> Posted By Howard to Tapestry Central at 6/16/2009 03:45:00 PM
>>>>
>>>
>>>
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [Tapestry Central] Why chose Tapestry?

2009-06-16 Thread Olle Hallin
strategy.
> Coming down off my soap box, I should also add that Tapestry 5.1 works
> a little bit differently than 5.0 in this respect, so it does (in fact)
> defer more of the page loading and validation until a link is actually
> clicked. This is more for performance reasons than to shield developers
> from application problems. Even in 5.0, the loading and validation was
> the "reach" from page A to pages explicitly referenced (usually via
> PageLink during the rendering of page A), so it's a highly unlikely
> case that a single error in a 1000 page application will keep the
> application from starting up, unless the start page of the application
> links to all 999 other pages.
> Re-reading the above post I can't emphasize enough: you can't ignore
> quality problems. Quality problems lead to development failures,
> schedule slips, missing functionality, low morale and high turnover.
> Saying "we don't have time to fix the quality problem first" is to
> ignore the the second law of Thermodynamics. You are expecting a
> miracle, literally writing it into your project plan.
> Formos addresses this issue two ways: First, we use Scrum and deliver
> on (typically) 4 week cycles. Thus we set real deadlines and have a
> constant check on quality (we're providing working code constantly). We
> don't even try to predict what we'll be doing six months or two years
> from now, we just deliver a steady, manageable stream of software.
> Secondly, Formos uses Tapestry because of all the reasons that the
> anonymous developer's organization rejected it, and for many, many more
> reasons besides.
>
> --
> Posted By Howard to Tapestry Central at 6/16/2009 03:45:00 PM




-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Hooks for code on every page request

2009-06-15 Thread Olle Hallin
...or just the sample timing filter that the quickstart archetype creates!

Olle


2009/6/15 Thiago H. de Paula Figueiredo 

> On Mon, Jun 15, 2009 at 11:06 AM, Jason Lotz wrote:
> > Thanks, I think the request filter is what I was looking for.
>
> You're welcome!
> You can use the Tapestry Access Logger
> (http://www.arsmachina.com.br/project/tapestryaccesslogger) for a
> request filter example.
>
> --
> Thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: t5: archetype create for 5.1.0.5

2009-05-13 Thread Olle Hallin
You probably have an old version of the maven-archetype-plugin in your local
repo.

Try adding -cpu to the command.

If that does not help, remove
$HOME/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin and try
again.

HTH,
Olle



2009/5/13 Angelo Chen 

>
> Hi,
>
> Thanks for pointing out the link, I tried this:
>
> mvn archetype:generate
> -DarchetypeCatalog=http://tapestry.formos.com/maven-repository
>
> but found this:
>
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO]
> 
> [ERROR] BUILD FAILURE
> [INFO]
> 
> [INFO] Required goal not found: archetype:generate
> [INFO] 
>
> any idea?
>
>
>
>
> Ulrich Stärk wrote:
> >
> > http://tapestry.apache.org/tapestry5.1/quickstart/
> >
> > Am 13.05.2009 10:31 schrieb Angelo Chen:
> >> Hi,
> >> This creates a project for 5.0.18:
> >> mvn archetype:create -DarchetypeGroupId=org.apache.tapestry
> >> -DarchetypeArtifactId=quickstart -DgroupId=org.example
> -DartifactId=myapp
> >> -DpackageName=org.example.myapp -DarchetypeVersion=5.0.18
> >>
> >> and this does not create a project for 5.1.0.5:
> >>
> >> mvn archetype:create -DarchetypeGroupId=org.apache.tapestry
> >> -DarchetypeArtifactId=quickstart -DgroupId=org.example
> -DartifactId=myapp
> >> -DpackageName=org.example.myapp -DarchetypeVersion=5.1.0.5
> >>
> >> instead, it gives error:
> >> [ERROR] BUILD ERROR
> >> [INFO]
> >> 
> >> [INFO] Error creating from archetype
> >>
> >> Embedded error: The META-INF/maven/archetype.xml descriptor cannot be
> >> found.
> >> why?
> >>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/t5%3A-archetype-create-for-5.1.0.5-tp23517591p23519676.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [5.1.0.1]How to use multiple zone refresh

2009-03-11 Thread Olle Hallin
Howard,

There is a missing "private" in the example:

@Inject Block registrationHelp;

Olle

2009/3/10 Howard Lewis Ship 

Did this documentation:
>
> http://tapestry.formos.com/nightly/tapestry5/guide/ajax.html
>
> help?
>
> On Tue, Mar 10, 2009 at 8:54 AM, Yannick Martel 
> wrote:
> > Hi!
> >
> > I want to refresh two or more blocks in my UI. With the current stable
> > version, I have seen it is not possible, but it is fixed on 5.1.0.1
> > version [1].
> >
> > In the issue ticket, there is a little example, but I don't understand
> > exactly how does it work in practical terms (with a tml).
> >
> > Can somebody help me ?
> >
> > [1] https://issues.apache.org/jira/browse/TAP5-108
> >
> > --
> > Yannick 
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> -----
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: IoC question - introducing a time delay in an ASO

2009-02-11 Thread Olle Hallin
What happens in a clustered environment?

Tapestry services aren't part of normal HTTP session clustering.

Olle



2009/2/11 Thiago H. de Paula Figueiredo 

> On Wed, Feb 11, 2009 at 11:16 AM, Ulrich Stärk  wrote:
> > Something like a singleton tapestry service with an access-synchronized
> map
> > inside maybe?
>
> That's what I'd do.
> James: sorry for mistaking your message as someone else's. :)
>
> --
> Thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Tapestry With Connector

2009-01-15 Thread Olle Hallin
http://mavensearch.net is a good tool for these kinds of issues.

It's written by a friend of mine.

Olle


2009/1/15 Gutemberg A. Da Silva 

> thanks for you help guy.
>
> 2009/1/15 Thiago H. de Paula Figueiredo 
>
> > Em Thu, 15 Jan 2009 11:39:04 -0300, Gutemberg A. Da Silva <
> > sag@gmail.com> escreveu:
> >
> >  nothing wrong for me. I was with doubts and tapestry-users community
> >> serves for resolution of doubts what others users DIDN'T get resolve for
> >> other way (google, ...). thanks for all.
> >>
> >
> > Maybe you should refine your engine search skills. :) Searching for
> "oracle
> > maven dependency" in Google, for example, the first result has the answer
> to
> > your question. The same applies to SQL Server and PostgreSQL.
> >
> > Another issue in this thread is that this is *not* a Tapestry-related
> > question.  In fact, it is a Maven-related one.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> Gutemberg A. Da Silva
>



-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: T5: need to update pom when uprading to 5.0.18?

2009-01-13 Thread Olle Hallin
Standard remedy in cases like this: clean the local Maven repository (or
rename it).

Olle


2009/1/13 Angelo Chen 

>
> Hi,
>
> lately I'm getting following errors, any idea why? thanks.
>
> Angelo
>
> [INFO]task-segment: [clean]
> [INFO]
> 
> [INFO] artifact org.apache.maven.plugins:maven-clean-plugin: checking for
> updates from tapestry-snapshots
> [WARNING] repository metadata for: 'artifact
> org.apache.maven.plugins:maven-clean-plugin' could not be retrieved from
> repository: tapestry-snapshots due to an error: Error transferring file
> [INFO] Repository 'tapestry-snapshots' will be blacklisted
> Downloading:
>
> http://repo1.maven.org/maven2/org/mortbay/jetty/maven-jetty-plugin/6.1.14/maven-jetty-plugin-6.1.14.pom
> 5K<http://repo1.maven.org/maven2/org/mortbay/jetty/maven-jetty-plugin/6.1.14/maven-jetty-plugin-6.1.14.pom5K>downloaded
> Downloading:
>
> http://repo1.maven.org/maven2/org/mortbay/jetty/project/6.1.14/project-6.1.14.pom
> 8K<http://repo1.maven.org/maven2/org/mortbay/jetty/project/6.1.14/project-6.1.14.pom8K>downloaded
> Downloading:
>
> http://repo1.maven.org/maven2/org/mortbay/jetty/maven-jetty-plugin/6.1.14/maven-jetty-plugin-6.1.14.jar
> 44K<http://repo1.maven.org/maven2/org/mortbay/jetty/maven-jetty-plugin/6.1.14/maven-jetty-plugin-6.1.14.jar44K>downloaded
> [INFO] [clean:clean]
>
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-need-to-update-pom-when-uprading-to-5.0.18--tp21430302p21430302.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -----
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: t5: when running tomcat behind Apache

2009-01-12 Thread Olle Hallin
There are options in Tomcat that work in concert with Apache's mod_proxy.

I have done this, but unfortunately I cannot remember the exact details...

Olle


2009/1/12 Peter Stavrinides 

> > Should Tapestry assume it is running behind Apache and correctly
> > operate on those special headers?
> I agree with Massimo absolutely not. This configuration is far too
> implementation specific... IMHO there are other options you could explore,
> for instance checking if this header is being used or not, or using a start
> up configuration parameter to switch it on manually.
>
> regards,
> Peter
>
> - Original Message -
> From: "Massimo Lusetti" 
> To: "Tapestry users" 
> Sent: Monday, 12 January, 2009 10:00:25 AM GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> Subject: Re: t5: when running tomcat behind Apache
>
> On Mon, Jan 12, 2009 at 8:53 AM, Howard Lewis Ship 
> wrote:
>
> > Should Tapestry assume it is running behind Apache and correctly
> > operate on those special headers?
>
> By my point of view, not at all. There are plenty of installation
> where tomcat/jetty/whatever is running as a direct front end as there
> are plenty where apache is used.
>
> As there's a way from Request to get the header that's fine for me.
>
> --
> Massimo
> http://meridio.blogspot.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
> -----
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Reloading component templates from Maven's jetty plugin

2008-12-23 Thread Olle Hallin
How is your IDE configured?
In Eclipse, it is possible to set it to build automatically when a file is
saved.
For .tml files, "build" means copy it from src/main/resources to
target/classes.

It is also possible to turn this feature off, requiring one to both save
(Ctrl-S) and build (Ctrl-B) before a change is picked up by Tapestry.

HTH,
Olle


2008/12/23 Josh Long 

> Hello,
> What configuration, exactly, is anyone using to achieve this? I'm not
> getting any results, alas.
> I tried excluding **/components/**, **/pages/**, etc from src/main,
> src/main/tesources, src/main/java, etc
>
> No luck.Would anybody mind sharing this with me? I'm simply looking to be
> able to type a character in a component template and see it change
> immediately, without jetty having to restart. I don't, frankly, understand
> why there's any difference in the first place between the two.. why can't
> the template for a component be the same as the template for a page,
> which... is after all a component?
>
> Any help would be appreciated,
>
> Thanks,
> Josh
>
>
>
>
> On Mon, Dec 22, 2008 at 1:38 PM, Olle Hallin 
> wrote:
>
> > See http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
> > .<http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>Search
> > for .
> >
> > Olle
> >
> >
> > 2008/12/22 kace 
> >
> > >
> > > Ive done the following
> > >
> > > - src/main/resources configured as a source directory in IntelliJ.
> > > - you have configured IntelliJ to compile .tml files. (Settings ->
> > Compiler
> > > -> Resource Patterns)
> > >
> > > still only picks up changes to tml files under webapp folder ie to
> pages
> > > not
> > > components.
> > >
> > > @Olle - how do you exclude myapp.components, myapp.pages from the jetty
> > > hot-deploy feature?
> > >
> > > Right now in target/classes I have three folders -
> > > components/pages/services.  Components folder has both .tml files and
> > > .class
> > > files. Pages directory has only .class files.
> > >
> > > ..kace
> > > --
> > > View this message in context:
> > >
> >
> http://www.nabble.com/Reloading-component-templates-from-Maven%27s-jetty-plugin-tp21112833p21127419.html
> > > Sent from the Tapestry - User mailing list archive at Nabble.com.
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > Olle Hallin
> > Senior Java Developer and Architect
> > olle.hal...@crisp.se
> > www.crisp.se
> >
>
>
>
> --
> Joshua Long
> http://www.joshlong.com/
>



-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Reloading component templates from Maven's jetty plugin

2008-12-22 Thread Olle Hallin
See http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
.<http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin>Search
for .

Olle


2008/12/22 kace 

>
> Ive done the following
>
> - src/main/resources configured as a source directory in IntelliJ.
> - you have configured IntelliJ to compile .tml files. (Settings -> Compiler
> -> Resource Patterns)
>
> still only picks up changes to tml files under webapp folder ie to pages
> not
> components.
>
> @Olle - how do you exclude myapp.components, myapp.pages from the jetty
> hot-deploy feature?
>
> Right now in target/classes I have three folders -
> components/pages/services.  Components folder has both .tml files and
> .class
> files. Pages directory has only .class files.
>
> ..kace
> --
> View this message in context:
> http://www.nabble.com/Reloading-component-templates-from-Maven%27s-jetty-plugin-tp21112833p21127419.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Reloading component templates from Maven's jetty plugin

2008-12-22 Thread Olle Hallin
Classes under myapp.components, myapp.pages, myapp.base and myapp.mixins are
hot-deployed by Tapestry.
Exclude these from the Jetty hot-deploy feature.

Olle


2008/12/22 Josh Long 

> Thank you for the help. I've adjusted my IntelliJ environment as you
> suggested and its working, sort of.
> It does seem like a waste, though. For my page templates I need only make a
> change and jetty scans it and makes the change. With the component
> templates, jetty perceives it as a class change, which necessitates a
> restart of the web app.
>
> This is, frankly, no better than using JSF with the jetty plugin.
>
> What, exactly, is the use case described in the docs where it says
> component
> and page templates will be reloaded? I have no doubt it works somewhere,
> but
> it's not fully elaborated upon. What do I have to use/ do to have true
> reloading of component an page templates without restarting the app? Do I
> need Eclipse on OS X with Tomcat? What's the happy path of that feature?
> I'm
> willing to switch to whatever it is...
>
> Thanks, as usual, for your indulgence,
> Josh
> http://www.joshlong.com
>
>
>
>
>
> On Sun, Dec 21, 2008 at 2:41 PM, Hugo Palma 
> wrote:
>
> > I have that same setup running without any problems, T5 + Jetty + Maven +
> > IntelliJ.
> > Can you check if IntelliJ is copying your templates to the build
> directory
> > (target/classes) ?
> >
> > If not then check if you have the following configured:
> >
> > - src/main/resources configured as a source directory in IntelliJ.
> > - you have configured IntelliJ to compile .tml files. (Settings ->
> Compiler
> > -> Resource Patterns)
> >
> > On Sun, Dec 21, 2008 at 7:46 AM, Josh Long  wrote:
> >
> > > Hi,
> > >
> > > I have a maven project generated usig the stock mvn archetype for
> > tapestry
> > > 5.
> > >
> > > According to the docs, component templates should be in
> > > src/main/resources/.  I can't seem to get those to 'reload' correctly,
> > > forcing me to ctrl + c the maven jetty plug in and re run.
> > >
> > > Any input on how to change this (from tapestry or the maven jetty plug
> > > in?) would be appreciated. I'm editing in Intellij (I opened the pom
> > > with IntelliJ, which in turn created a project). Im doing Build >
> > > Rebuild project to try and trigger the refresh, but no go.
> > >
> > > Any input on possible configuration changes/options woud be
> appreciated.
> > >
> > > Thanks
> > > Josh
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>
>
>
> --
> Joshua Long
> http://www.joshlong.com/
>



-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Reloading component templates from Maven's jetty plugin

2008-12-21 Thread Olle Hallin
I'm not an IntelliJ user myself, but I have a vague memory of a collegue
that had problems like these.
I think you must configure IntelliJ to copy .tml files from
src/main/resources to target/classes (where Tapestry can find them).
It does not do this out of the box.

HTH,
Olle


2008/12/21 kace 

>
> I have the same setup but haven't been able to get my project to pick up
> changes to classes or component templates  but it does work for pages
> within
> webabb.
>
> I run the maven command from within itellij IDEA `process classes` for it
> to
> pick up the changes to the classes and `process resources` to pick up
> changes made to the component templates inside src/main/resources without
> having to re-run the app.
>
> Hope this helps for now...
>
> ..kace
> --
> View this message in context:
> http://www.nabble.com/Reloading-component-templates-from-Maven%27s-jetty-plugin-tp21112833p21114527.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Q : Select using value encoder ?

2008-12-20 Thread Olle Hallin
Why not use an enum and BeanEditForm?
Olle



2008/12/20 dwi ardi irawan 

> hi alli got a little problem here
>
> i want to make this into a select component :
> if the label is "user" then the value would be : 0(Integer)
> if the label is "administrator" then the value would be : 1(Integer)
>
> i did that in this way :
> *User.java*
> private String username;
> private String password
> private Integer status;
> ..
>
> *userForm.tml*
> 
>  
>    :
>value="User.status" encoder="statusValueEncoder" label="Status"/>
> 
>
> *userForm.java*
> ..
> @Property
> private User user;
> ..
>
> public List getStatusList() {
>if(statusList==null){
>statusList = new ArrayList();
>statusList.add("user");
>statusList.add("administrator");
>}
>return statusList;
> }
> public StatusSelectionModel getStatusSelectionModel() {
>return new StatusSelectionModel(getStatusList());
> }
>
> public ValueEncoder getStatusValueEncoder(){
>return new StringValueEncoder();
> }
>
> *StatusSelectionModel.java*
>
> public class StatusSelectionModel implements SelectModel{
>
>private List statusList;
>
>public StatusSelectionModel(List formationList){
>this.statusList = formationList;
>}
>public List getOptionGroups() {
>return getSelectModel().getOptionGroups();
>}
>
>public List getOptions() {
>return getSelectModel().getOptions();
>}
>
>public void visit(SelectModelVisitor visitor) {
>getSelectModel().visit(visitor);
>
>}
>
>public SelectModel getSelectModel() {
>List optionModelList = new ArrayList();
>
>
>for(String status: statusList) {
>if(status.equals("user")){
>optionModelList.add(new OptionModelImpl(status,new
> Integer(0)));
>}else if (status.equals("administrator")) {
>optionModelList.add(new OptionModelImpl(status,new
> Integer(1)));
>}
>
>}
>return new SelectModelImpl(null, optionModelList);
>}
>
> }
>
> *StringValueEncoder .java*
> public class StringValueEncoder implements ValueEncoder {
>
>public String toClient(Integer value) {
>return value.toString();
>}
>
>public Integer toValue(String value) {
>// TODO Auto-generated method stub
>return Integer.parseInt(value);
>}
>
> }
>
>
> but i got following error when i tried to submit it :
>
> *Failure writing parameter 'value' of component UserFormPage:statusselect:
> Coercion of user to type java.lang.Integer (via String --> Long, Long -->
> Integer) failed: For input string: "user"*
>
>
> *
> *
>
> could somebody help me
>
>
> thnx u very much
>
> --
> http://dwiardiirawan.blogspot.com
> "cos everyone could be extraordinary...lighten up !"
>



-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [T5] Testing Pages with injected Spring beans

2008-12-17 Thread Olle Hallin
Is there a problem using tapestry-spring.jar?

Olle

2008/12/17 mraible 

>
> Is the following still the best way to inject Spring beans into a page when
> testing?
>
> http://wiki.apache.org/tapestry/Tapestry5SpringIntegrationAlternative1
>
> With Tapestry 4, I could populate a Map with with the bean name and a real
> (or mock) implementation and instantiate the page, then call methods
> accordingly. Is this possible with Tapestry 5 w/o creating a lot of
> infrastructure code (which the above seems to require)?
>
> Thanks,
>
> Matt
> --
> View this message in context:
> http://www.nabble.com/-T5--Testing-Pages-with-injected-Spring-beans-tp21057429p21057429.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: T5: a default notification page

2008-12-16 Thread Olle Hallin
I think that you can do this with Apache mod_rewrite and use the presence of
a certain file as an indicator that the site is in maintenance mode.

Search for the ContPattern -F in
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html

This will make it extremely simple to maintain. The backup script starts by
touching a certain well-known file that mod_rewrite looks for, and
ends by removing that file. The down-side is that the mod_rewrite -F
conditional affects performance negatively.

Should you need to put the site in maintenance mode for other reasons, just
touch the marker file manually.

HTH,
Olle


2008/12/16 Angelo Chen 

>
> Thanks to all replies, I think good idea to have Apache in front of tomcat.
> a
> related question is, say you need to backup the database at certain time in
> a day, this has to be automated, you can't manually pointing the page to
> another location, any good practice on this? I'm thinking of putting a
> dispatcher, and a global variable, when it is set, all the page will be
> redirected in the dispatcher to a 'maintenance page' until the backup is
> done which will set the global variable to false and the dispatcher again
> will not redirect anything, what do you think?
>
>
> Angelo Chen wrote:
> >
> > Hi,
> > Often I need to shutdown tomcat in order to do some maintenance work, is
> > there a way to define a page in a T5 application so that all links to the
> > application goes to that page? thanks.
> >
> > Angelo
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-a-default-notification-page-tp21023653p21029929.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: T5: a default notification page

2008-12-15 Thread Olle Hallin
IMO it is recommended to do a cold start of Tomcat after *each* redeploy of
webapps.
Else you will sooner or later run into mysterious problems, caused by memory
leaks and such.
This will also verify that Tomcat is able to start after a power outage.

(In development mode, this is of course not necessary.)

So I'd advice you to put an Apache in front, and let it redirect to the
static service page when you take Tomcat down.
This will also give you freedom to do maintenance on Tomcat itself.

Olle

2008/12/16 Peter Stavrinides 

> It is a major pain with Tomcat IMHO. As Andreas points out if you stop
> Tomcat nothing will run, if you run Apache in front then Apache uses the
> directive 'ErrorDocument' that allows you to override a '503 Service
> Unavailable' error displaying your custom page.
>
> If you don't run Apache in front and simply stop the application, Tomcat
> will show its standard 503 page which can *NOT be overridden without
> fiddling with Tomcats internals, as Tomcat uses embedded code to generate
> 503 pages on the fly, why it does it for 503 pages and not the other is a
> mystery. The one thing you could do though if your configuration allows, is
> override the 404 page in Tomcats root (not your application) and use
> undeploy instead of stop before doing your changes.
>
> cheers,
> Peter
>
> - Original Message -
> From: "Andreas Andreou" 
> To: "Tapestry users" 
> Sent: Tuesday, 16 December, 2008 2:16:21 AM GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> Subject: Re: T5: a default notification page
>
> if you shutdown tomcat, tapestry app wont be running ;)
>
> If you have apache setup in front of tomcat, you can add redirect
> rules to a static html page
> see
> http://significantbits.wordpress.com/2007/03/15/setting-a-maintenance-page-in-apache-2/
> or similar
> posts
>
> On Tue, Dec 16, 2008 at 1:50 AM, Thiago H. de Paula Figueiredo
>  wrote:
> > Em Mon, 15 Dec 2008 19:41:19 -0300, Angelo Chen <
> angelochen...@yahoo.com.hk>
> > escreveu:
> >
> >> Hi,
> >> Often I need to shutdown tomcat in order to do some maintenance work, is
> >> there a way to define a page in a T5 application so that all links to
> the
> >> application goes to that page? thanks.
> >
> > I haven't tested, but maybe you can decorate
> > ComponentClassResolver.resolvePageNameToClassName() and
> > ComponentClassResolver.resolvePageClassNameToPageName() to always return
> > your application-out-of-order page. The AOP possibilities in Tapestry 5
> are
> > almost endless . . .
> >
> >>
> >> Angelo
> >
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > Consultor, desenvolvedor e instrutor em Java
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
>
> --
> Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
> ---------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: T5: How to initialize page members

2008-12-15 Thread Olle Hallin
Well, I'm not totally convinced.
I think it's too kludgy to be forced to write a setupRender() and a test
against null/0/false just to initialize a member.

There must be a simpler way...

Perhaps a field-level annotation?

Olle

2008/12/16 Thiago H. de Paula Figueiredo 

> Em Mon, 15 Dec 2008 10:32:00 -0300, Olle Hallin 
> escreveu:
>
>  You're correct about static final. Didn't think of that [?].
>>
>
> Sometimes a good solution is so simple that we try the complex ones first.
> :P
>
>  Why is it prohibited to initialize rowsPerPage in the declaration? An int
>> is definitely immutable. It's not even an object...
>>
>
> Tapestry polls pages. When it needs one instance, it would need to know if
> it is a never used one or a used one and initialize it accordingly. How
> would Tapestry know that, as primitives do not accept null values?
>
> AFAIK, the Tapestry philosphy is to have just one way to do things.
> Accepting initialization of primitive fiels and not acception other fields
> would not fit. ;)
>
> Nice discussion. :)
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Custom Errors on Bean Edit Form

2008-12-15 Thread Olle Hallin
For example like this (very simplified):
@Component private Form myForm; // links to 

@Component private PasswordField password1; // links to 

Object onSuccess() {
  if (passwords unequal) {
myForm.recordError(password1, "Passwords does not match");
return null;
  }
  // else proceed with persisting the user
}

HTH
Olle


2008/12/15 Charles Mason 

> Hi All,
>
> I have a fairly straight forward bean edit form on a page. Its a
> create new user form so, I want to check the user doesn't already
> exist and that the two password fields match. I do this validation in
> the onSubmit method but I am struggling to use the error reporting
> mechanism to inform the user.
>
> How do I get access to the form component to generate the proper error
> messages?
>
>
> Charlie M
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: T5: How to initialize page members

2008-12-15 Thread Olle Hallin
What is most important: consistency or ease of use?
Olle


2008/12/15 Peter Stavrinides 

> >Why is it prohibited to initialize rowsPerPage in the declaration? An int
> is definitely immutable. It's not even an object...
> True, but then the question arises will it become more confusing and appear
> inconsisant?  Especially for new users still learning Tapestry, they may get
> confused as to why primitives can be initialized but not Objects?
>
>
> - Original Message -
> From: "Olle Hallin" 
> To: "Tapestry users" 
> Sent: Monday, 15 December, 2008 3:32:00 PM GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> Subject: Re: T5: How to initialize page members
>
> You're correct about static final. Didn't think of that .
>
> But still I think there is room for improvement:
>
> Consider this use case that is quite clumsy to implement as it is today:
>
> public class APageThatContainsAGrid {
> @Persist private int rowsPerPage = 10; // forbidden!
> void onAction(int rows) {
> this.rowsPerPage = rows;
> }
> }
>
> and in the template a  and a couple
> of action links for modifying rowsPerPage.
>
> Why is it prohibited to initialize rowsPerPage in the declaration? An int
> is definitely immutable. It's not even an object...
>
> Olle
>
>
> 2008/12/15 Thiago H. de Paula Figueiredo < thiag...@gmail.com >
>
>
> Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin < olle.hal...@gmail.com >
> escreveu:
>
>
>
> Hi,
>
>
> Hi!
>
>
>
> Beginning with 5.0.17 is is forbidden to have initial values on page
> members, in order to prohibit state leakage between sessions.
> This is fine, since it prevents bugs that can be very tricky to isolate.
>
> You're right.
>
>
>
>
> This contradicts to the Tapestry principle *the simplest choice should be
> the correct choice.*
>
> I don't think so. You have to remember that Tapestry polls page instances,
> so, after one request, Tapestry must restart the page fields values. And
> that the value of a non-primitive field is a reference to an object, not an
> object itself.
>
>
>
>
> IMHO it should be ok to initialize the member in the declaration if it can
> be guaranteed that the value is immutable.
>
> IMHO, the best way to declare a field that is immutable is to make it final
> and static (i.e. constant) for it, not a private field. ;)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>
>
> --
> Olle Hallin
> Senior Java Developer and Architect
> olle.hal...@crisp.se
> www.crisp.se
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [T5]: query regarding streaming data

2008-12-15 Thread Olle Hallin
Yes, there is.

Let your handler method return a StreamResponse object.

See http://tapestry.apache.org/tapestry5/guide/pagenav.html
and
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/StreamResponse.html.

Olle


2008/12/15 tapestryphoto 

> Hi,
>
> possibly not Tapestry specific and I'm not knowledgable enough on this
> subject, so apologies.
>
> I would like to be able to display a PDF that I obtain from a database
> using Hibernate via Tapestry. Is there a way to stream the data?
>
> thanks,
> p.
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: T5: How to initialize page members

2008-12-15 Thread Olle Hallin
You're correct about static final. Didn't think of that [?].

But still I think there is room for improvement:

Consider this use case that is quite clumsy to implement as it is today:

public class APageThatContainsAGrid {
  @Persist private int rowsPerPage = 10; // forbidden!
  void onAction(int rows) {
this.rowsPerPage = rows;
  }
}

and in the template a  and a couple
of action links for modifying rowsPerPage.

Why is it prohibited to initialize rowsPerPage in the declaration? An int is
definitely immutable. It's not even an object...

Olle

2008/12/15 Thiago H. de Paula Figueiredo 

> Em Mon, 15 Dec 2008 06:47:18 -0300, Olle Hallin 
> escreveu:
>
>  Hi,
>>
>
> Hi!
>
>  Beginning with 5.0.17 is is forbidden to have initial values on page
>> members, in order to prohibit state leakage between sessions.
>> This is fine, since it prevents bugs that can be very tricky to isolate.
>>
>
> You're right.
>
>  This contradicts to the Tapestry principle *the simplest choice should be
>> the correct choice.*
>>
>
> I don't think so. You have to remember that Tapestry polls page instances,
> so, after one request, Tapestry must restart the page fields values. And
> that the value of a non-primitive field is a reference to an object, not an
> object itself.
>
>  IMHO it should be ok to initialize the member in the declaration if it can
>> be guaranteed that the value is immutable.
>>
>
> IMHO, the best way to declare a field that is immutable is to make it final
> and static (i.e. constant) for it, not a private field. ;)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -----
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Layout Border component problem

2008-12-15 Thread Olle Hallin
In 5.0.17+ you will get a runtime exception if you try to initialize a page
member in the declaration.

At least for me it works that way.

Olle


2008/12/15 kawes 

>
> Ok found an answer to my second question,
> some info is provided here:
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html
>
> but still would be happy if you could answer to my first question.
>
> cheers
>
>
> kawes wrote:
> >
> > Olle,
> >
> > thanks a lot. I knew what was wrong but had no idea how to deal with
> that.
> > I am gonna check it out at home 'cause now I am at work.
> >
> > But I have some questions to the resolve you suggetsed:
> >  -  Starting with 5.0.17,  it is forbidden to have initial values on page
> > - what does it mean it is forbidden? I did not notice any repoerts during
> > runtime and no during compilantion neither.
> >
> >  - what is setupRender() method? it will be called automatically ?
> >
> > thanks again
> >
> >
> > Olle Hallin wrote:
> >>
> >> What happens is that TeacherMode is mutable, and hence leaks state
> >> between
> >> different users. You are *not* given a fresh instance on each request.
> >> Instead, instances are pooled and reused.
> >>
> >> (Starting with 5.0.17,  it is forbidden to have initial values on page
> >> member variables in order to prevent bugs like this.)
> >>
> >> One way to handle this situation is:
> >>
> >> *...@persist
> >> *private TeacherMode teacherMode;
> >>
> >> public void *setupRender()* {
> >>   if (teacherMode == null) {
> >> teacherMode = new TeacherMode(); // This will be a private instance
> >> per
> >> session
> >>   }
> >> }
> >>
> >> HTH,
> >>
> >> Olle
> >>
> >>
> >> 2008/12/15 kawes 
> >>
> >>>
> >>> Hi Jonathan,
> >>>
> >>> thanks for your quick response.
> >>> As you asked I uploaded classes I hit the problem in.
> >>>
> >>> Small description: One of my sub-application is Teacher (should be able
> >>> to
> >>> provide a word in foreign language and accept user's answer checks
> >>> wheather
> >>> it is correct)
> >>>
> >>> When user logs in, clicks teacher link is redirected to AvailabaleSets
> >>> (which is wrapped by TeacherBorder).
> >>>
> >>> T5.zip file uploaded and it contains:
> >>>  - Border.java
> >>>  - Border.tml (pagelinks to all stuff provided by my app)
> >>>
> >>>  - TeacherBorder.java
> >>>  - TeacherBorder.tml (contains all links to navigate my Teacher
> >>> sub-application - i.e. TeacherMode - resposnible for 'asking question',
> >>> registering results etc)
> >>>
> >>>  - AvailableSets.java
> >>>  - AvailableSets.tml (displays available sets containg words)
> >>>
> >>>  - TeacherModePage1.java
> >>>  - TeacherModePage1.tml (lets user to choose the word's set and decide
> >>> about
> >>> the questioning mode (mingled or the sequence of words had been added
> to
> >>> the
> >>> set) )
> >>>
> >>>  - TeacherModePage2.java
> >>>  - TeacherModePage2.tml (displays questions and lets to type in
> answers)
> >>>
> >>> TeacherModePage1.java contains the following line:
> >>>  private TeacherMode teacherMode = new TeacherMode();
> >>>
> >>> I belived that when new page would be displayed (whe user clicks
> >>> TeacherMode
> >>> in TeacherBorder) a brand new TeacherMode instance would be returned
> but
> >>> is
> >>> not. And is not because all the classes are already instantiated and T5
> >>> gives them back to the user for efficiency.
> >>>
> >>> Please keep in mind this is just the beggining of the work, so not
> >>> everything is like it should be from architectural point of view (i.e.
> >>> @Persist will be replaced by onPassvate and onActivate). I just wanted
> >>> to
> >>> see how it works.
> >>>
> >>> If any more details are reqiured let me know.
> >>>
> >>> Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/Layout-Border-component-problem-tp21004400p21009484.html
> >>> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>> -
> >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >>> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>>
> >>>
> >>
> >>
> >> --
> >> Olle Hallin
> >> Senior Java Developer and Architect
> >> olle.hal...@crisp.se
> >> www.crisp.se
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Layout-Border-component-problem-tp21004400p21010909.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


T5: How to initialize page members

2008-12-15 Thread Olle Hallin
Hi,

Beginning with 5.0.17 is is forbidden to have initial values on page
members, in order to prohibit state leakage between sessions.
This is fine, since it prevents bugs that can be very tricky to isolate.

On the other hand, it leads to clumsy code.

Instead of

*private Foo foo = new Foo();
*
you have to write

*...@persist private Foo foo;
void setupRender() {
  if (foo == null) {
foo = new Foo();
  }
}
*
This contradicts to the Tapestry principle *the simplest choice should be
the correct choice.*

IMHO it should be ok to initialize the member in the declaration if it can
be guaranteed that the value is immutable.

Therefore, I propose that classes that are known to be immutable
(java.lang.Integer et&al) and classes that are annotated @Immutable should
be allowed as initializers.
See http://www.jcip.net/annotations/doc/net/jcip/annotations/Immutable.html.

The package is available at the Maven repo (group:net.jcip
artifact:jcip-annotations version:1.0), and it's license (
http://creativecommons.org/licenses/by/2.5) is AFAIK compatible with
Tapestry's.

Regards,
Olle


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Layout Border component problem

2008-12-15 Thread Olle Hallin
What happens is that TeacherMode is mutable, and hence leaks state between
different users. You are *not* given a fresh instance on each request.
Instead, instances are pooled and reused.

(Starting with 5.0.17,  it is forbidden to have initial values on page
member variables in order to prevent bugs like this.)

One way to handle this situation is:

*...@persist
*private TeacherMode teacherMode;

public void *setupRender()* {
  if (teacherMode == null) {
teacherMode = new TeacherMode(); // This will be a private instance per
session
  }
}

HTH,

Olle


2008/12/15 kawes 

>
> Hi Jonathan,
>
> thanks for your quick response.
> As you asked I uploaded classes I hit the problem in.
>
> Small description: One of my sub-application is Teacher (should be able to
> provide a word in foreign language and accept user's answer checks wheather
> it is correct)
>
> When user logs in, clicks teacher link is redirected to AvailabaleSets
> (which is wrapped by TeacherBorder).
>
> T5.zip file uploaded and it contains:
>  - Border.java
>  - Border.tml (pagelinks to all stuff provided by my app)
>
>  - TeacherBorder.java
>  - TeacherBorder.tml (contains all links to navigate my Teacher
> sub-application - i.e. TeacherMode - resposnible for 'asking question',
> registering results etc)
>
>  - AvailableSets.java
>  - AvailableSets.tml (displays available sets containg words)
>
>  - TeacherModePage1.java
>  - TeacherModePage1.tml (lets user to choose the word's set and decide
> about
> the questioning mode (mingled or the sequence of words had been added to
> the
> set) )
>
>  - TeacherModePage2.java
>  - TeacherModePage2.tml (displays questions and lets to type in answers)
>
> TeacherModePage1.java contains the following line:
>  private TeacherMode teacherMode = new TeacherMode();
>
> I belived that when new page would be displayed (whe user clicks
> TeacherMode
> in TeacherBorder) a brand new TeacherMode instance would be returned but is
> not. And is not because all the classes are already instantiated and T5
> gives them back to the user for efficiency.
>
> Please keep in mind this is just the beggining of the work, so not
> everything is like it should be from architectural point of view (i.e.
> @Persist will be replaced by onPassvate and onActivate). I just wanted to
> see how it works.
>
> If any more details are reqiured let me know.
>
> Thanks in advance http://www.nabble.com/file/p21009484/T5.zip T5.zip
> --
> View this message in context:
> http://www.nabble.com/Layout-Border-component-problem-tp21004400p21009484.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -----
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: Tapestry 5.0 Final Release - 5.0.18

2008-12-15 Thread Olle Hallin
Congrats Howard (and others who have contributed)!

Just a naming question: wouldn't it be appropriate to name the release
version something in line with 5.0.GA?
It will clarify the release status of the version, considering the line of
versions preceding it (5.0.1, 5.0.2, ...)

Just my 2c.

Olle


2008/12/15 Michael Gerzabek 

> Thank you Howard and Team!
>
> This is really a great piece of software. In my humble opinion it's the
> best web application framework available. Development is straight forward,
> though you have to learn the Tapestry way of doing things. But that's also
> true for any other framework out in space.
>
> Special thanks also to the list for coaching people on the usage of T5.
> This is a big help in acquiring the knowledge to use T5 effectively.
>
> Michael
>
> Howard Lewis Ship schrieb:
>
>  Apache Tapestry 5.0 final release (5.0.18)
>>
>> After nearly three years of development, the final release of Apache
>> Tapestry 5.0 is now available for download.
>>
>> Apache Tapestry 5 is a total rewrite of the Tapestry web application
>> framework, bringing forward Tapestry's core concepts: reusable
>> components, true encapsulation, readable templates, well thought-out
>> localization/internationalization, and easy management of server-side
>> state.
>>
>> Tapestry 5 builds on top of this with a host of new features:
>>
>> * True POJO component classes: no base classes to extend, no
>>  interfaces to implement.
>>
>> * Live class reloading: no need to redeploy to see code changes.
>>
>> * XML templates with namespaces.
>>
>> * Minimal configuration via naming conventions and annotations.
>>
>> * Integrated Ajax support, built on top of Prototype and
>>  Scriptaculous.
>>
>> * Automatic client-side form input validation.
>>
>> * High performance via pooled objects (and by avoiding the use of
>>  reflection).
>>
>> * Automatic REST-style URLs.
>>
>> * Built-in integration with Hibernate and Spring.
>>
>> * Best-of-breed exception reporting.
>>
>> * Built-in extensible mega-components: BeanEditForm, BeanDisplay and
>>  Grid (to edit and display any JavaBean or collection of JavaBeans).
>>
>> Tapestry organizes your application into pages, and components within
>> pages; pages and components are ordinary POJOs: not singletons (like
>> servlets). Tapestry combines pages, page templates, components,
>> component templates, and other resources together for you, managing
>> server-side state, the creation of URLs and the dispatch of incoming
>> requests. You build your application in terms of the methods and
>> properties of your objects, not in terms of URLs or the Servlet API.
>>
>> Tapestry features great exception reporting to keep you on track, and
>> live class reloading to keep you agile.  Tapestry templates are XML
>> documents, using a namespace for Tapestry-specific elements. Tapestry
>> is designed to be easy to develop, using any standard IDE with an XML
>> editor.
>>
>> Tapestry is simple, sensible and fun. It keeps you productive by
>> freeing you from the boring, mechanical aspects of web application
>> development. You can stay focused on what makes your application
>> interesting and unique, and let Tapestry handle all the ugly plumbing.
>>
>> Tapestry is made available under the Apache Software License 2.0.
>> Tapestry is free to download, free to use, free to redistribute and
>> free to modify.
>>
>> Tapestry 5.0.18
>>
>> * Project page: http://tapestry.apache.org/tapestry5/
>>
>> * Download: http://tapestry.apache.org/download.html
>>
>> * Release Notes:
>>  http://tapestry.apache.org/tapestry5/release-notes.html
>>
>> * Upgrade Notes: http://tapestry.apache.org/tapestry5/upgrade.html
>>
>> * Via Maven:
>>
>>
>>org.apache.tapestry
>>tapestry-core
>>5.0.18
>>
>>
>>
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
olle.hal...@crisp.se
www.crisp.se


Re: [T5] Strange problems using jetty:run

2008-12-02 Thread Olle Hallin
This is not a Maven problem.
You probably have some sh:t in your source tree.

Try this:

1) rm -fr target
2) rm -fr src (DON'T DO THIS UNLESS YOU HAVE VERSION CONTROL)
2) restore a clean src/ from version control
3) mvn jetty:run

If it still does not work, repeat, stepping back in time until it works.

Olle


2008/12/2 gringoac <[EMAIL PROTECTED]>

>
>
> Thank you a lot for the response
>
> However, I'm still having the same error...
> Now, I do the following steps:
>
> - mvn clean install
> - mvn eclipse:clean eclipse:eclipse
> - mvn tomcat:run (or jetty:run)
>
> And the problem lingers on...
>
> Still hearing solutions...
>
> Ariel
>
>
>
> Olle Hallin wrote:
> >
> > Hi,
> >
> > Try this:
> > mvn clean install jetty:run
> >
> > This should solve your problem.
> >
> > For the eclipse part, mvn eclipse:clean eclipse:eclipse should do the
> > trick.
> >
> > (Or preferably, use the m2eclipse plugin from within Eclipse).
> >
> > Oh, and another thing: of the steps
> > 1 mvn clean install
> > 2 mvn war:war
> > 3 mvn package
> > 4 mvn eclipse:eclipse
> > 5 mvn tomcat:run (or mvn jetty:run)
> >
> > only step 1 and 5 (and optionally step 4) are necessary.
> >
> > The install phase implies package, which for a web app is a synonym to
> > war:war.
> >
> > It could even be shortened to mvn clean jetty:run.
> >
> > Step 4 is only necessary when you have modified pom.xml
> >
> > HTH,
> > Olle
> >
> >
> >
> >
> >
> > 2008/12/1 gringoac <[EMAIL PROTECTED]>
> >
> >>
> >>
> >> I'm using Eclipse. However, I'm trying to run the project without
> >> Eclipse,
> >> only from console...
> >>
> >> I do this steps:
> >>
> >> - mvn clean install
> >> - mvn war:war
> >> - mvn package
> >> - mvn eclipse:eclipse
> >> - mvn tomcat:run (or mvn jetty:run)
> >>
> >> Then, going to "localhost:8080/trunk" in my browser, and get the "Index
> >> did
> >> not generate any markup when rendered..."
> >>
> >> If I go to Eclipse and hit MyProject->Run On Server, it opens the
> browser
> >> and get the same error.
> >>
> >> If I do project->clean from Eclipse, and then "mvn tomcat:run" again or
> >> "Run
> >> on Server" from Eclipse, both of them works fine.
> >>
> >> Does anybody know how to solve this problem without using Eclipse...
> only
> >> from Maven and the console (cmd)? Do I need to restore the project's
> >> build
> >> path (if it was wipe in the mvn clean as you said)? How Can i Do that
> >> from
> >> console, pom.xml or any place like that?
> >>
> >> Thanks a lot,
> >>
> >> Ariel
> >>
> >>
> >>
> >>
> >> Thiago H. de Paula Figueiredo wrote:
> >> >
> >> > Em Mon, 01 Dec 2008 11:12:15 -0300, gringoac <[EMAIL PROTECTED]
> >
> >> > escreveu:
> >> >
> >> >> Hi guys... I really need to solve the same problem urgently...
> >> >> How can I restore my project's build path from Maven? Can I do it
> from
> >> >> the pom.xml or from anywhere else?
> >> >
> >> > Try mvn eclipse:eclipse and then refresh your project.
> >> >
> >> > --
> >> > Thiago H. de Paula Figueiredo
> >> > Independent Java consultant, developer, and instructor
> >> > http://www.arsmachina.com.br/thiago
> >> >
> >> > -
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/-T5--Strange-problems-using-jetty%3Arun-tp20067500p20773278.html
> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > Olle Hallin
> > Senior Java Developer and Architect
> > [EMAIL PROTECTED]
> > www.crisp.se
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-T5--Strange-problems-using-jetty%3Arun-tp20067500p20789479.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se


Re: [T5] Strange problems using jetty:run

2008-12-01 Thread Olle Hallin
Hi,

Try this:
mvn clean install jetty:run

This should solve your problem.

For the eclipse part, mvn eclipse:clean eclipse:eclipse should do the trick.

(Or preferably, use the m2eclipse plugin from within Eclipse).

Oh, and another thing: of the steps
1 mvn clean install
2 mvn war:war
3 mvn package
4 mvn eclipse:eclipse
5 mvn tomcat:run (or mvn jetty:run)

only step 1 and 5 (and optionally step 4) are necessary.

The install phase implies package, which for a web app is a synonym to
war:war.

It could even be shortened to mvn clean jetty:run.

Step 4 is only necessary when you have modified pom.xml

HTH,
Olle





2008/12/1 gringoac <[EMAIL PROTECTED]>

>
>
> I'm using Eclipse. However, I'm trying to run the project without Eclipse,
> only from console...
>
> I do this steps:
>
> - mvn clean install
> - mvn war:war
> - mvn package
> - mvn eclipse:eclipse
> - mvn tomcat:run (or mvn jetty:run)
>
> Then, going to "localhost:8080/trunk" in my browser, and get the "Index did
> not generate any markup when rendered..."
>
> If I go to Eclipse and hit MyProject->Run On Server, it opens the browser
> and get the same error.
>
> If I do project->clean from Eclipse, and then "mvn tomcat:run" again or
> "Run
> on Server" from Eclipse, both of them works fine.
>
> Does anybody know how to solve this problem without using Eclipse... only
> from Maven and the console (cmd)? Do I need to restore the project's build
> path (if it was wipe in the mvn clean as you said)? How Can i Do that from
> console, pom.xml or any place like that?
>
> Thanks a lot,
>
> Ariel
>
>
>
>
> Thiago H. de Paula Figueiredo wrote:
> >
> > Em Mon, 01 Dec 2008 11:12:15 -0300, gringoac <[EMAIL PROTECTED]>
> > escreveu:
> >
> >> Hi guys... I really need to solve the same problem urgently...
> >> How can I restore my project's build path from Maven? Can I do it from
> >> the pom.xml or from anywhere else?
> >
> > Try mvn eclipse:eclipse and then refresh your project.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-T5--Strange-problems-using-jetty%3Arun-tp20067500p20773278.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se


Re: @CommitAfter and HibernateExceptions

2008-11-20 Thread Olle Hallin
Try to flush then Hibernate Session. It will make things happen in the
database immediately.
HTH,
Olle


2008/11/21 Angelo Chen <[EMAIL PROTECTED]>

>
> good question, I like to know too.
>
>
> César Lesc wrote:
> >
> > Hi, i am learning how to use the @CommitAfter annotation, but i want
> > to catch the exception when the database does not allows to delete a
> > record and thus to show the user a friendly  messages like "X can't be
> > deleted, check if it is not being in use in Z", or other messages
> > based on the hibernateException thrown.
> > The case is that when i do XDAO.delete(X) in the page method
> > onActionFromDelete annotated with @CommitAfter, hibernate does not
> > actually delete the record at this moment, instead is "scheduled" for
> > deletion, so the deletion is attempted when the commit method is
> > called, but this is not doit inside my action method so i can't catch
> > it.
> >  I don´t want to do this checks manually because de database is doing
> > this job for me (may be i'm too lazy ;).
> >
> > That may be the best approach for this?
> >
> > Thanks
> >
> > César.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/%40CommitAfter-and-HibernateExceptions-tp20611252p20612890.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se


Re: Exception injecting Block

2008-11-20 Thread Olle Hallin
Try to @InjectComponent private Block myBlock instead.
HTH
Olle


2008/11/20 Thiago H. de Paula Figueiredo <[EMAIL PROTECTED]>

> Hi!
>
> I'm writing a presentation about Tapestry 5 for an developer's event here
> in Belo Horizonte, Brazil. Suggestions are always welcome. :)
>
> I'm having a strange problem trying to write a Zone and Block example
> (5.0.16):
>
> java.lang.RuntimeException: Class
> br.com.arsmachina.introducaotapestry.pages.ajax.Block contains field(s)
> (_$resources) that are not private. You should change these fields to
> private, and add accessor methods if needed.
>
> My page class hasn't any non-private members and the exception only ocurrs
> when I try to inject a Block. Even when I comment out everything but a
> single @Inject private Block block this exception is raised.
>
> Source:
>
> public class Block {
>
>@Persist
>@Property
>private int contador;
>
>@Inject
>private Block bandeiraBrasil;
>
>@Inject
>private Block bandeiraReinoUnido;
>
>@Inject
>private Block soTexto;
>
>@InjectComponent
>private Zone zone;
>
>@OnEvent("rodarZona")
>public Object mudarZona() {
>
>contador++;
>
>if (contador % 4 == 0) {
>return bandeiraBrasil;
>}
>else if (contador % 4 == 1) {
>return bandeiraReinoUnido;
>}
>else if (contador % 4 == 3) {
>return soTexto;
>}
>else {
>return zone;
>}
>
>}
>
>@OnEvent("brasil")
>public Object mostrarBandeiraBrasil() {
>contador++;
>return bandeiraBrasil;
>}
>
>@OnEvent("reinounido")
>public Object mostrarBandeiraReinoUnido() {
>contador++;
>return bandeiraReinoUnido;
>}
>
>@OnEvent("sotexto")
>public Object mostrarSoTexto() {
>contador++;
>return soTexto;
>}
>
> }
>
> Any ideas?
>
> Thanks in advance. :)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se


Re: [T5] Persistent fields may not be updated until after the page has finished loading

2008-11-20 Thread Olle Hallin
Why not allow one to assign objects that are annotated with
http://www.javaconcurrencyinpractice.com/annotations/doc/net/jcip/annotations/Immutable.html
plus
all standard java.lang wrappers (Integer ...) in the declaration, but throw
exception for the rest?
The package that contains that annotation (and a few other marker
annotations) is available from the Maven repo
(net.jcip:jcip-annotations:1.0), so
I guess that adding that dependency to Tapestry is a no-brainer.

BTW: FindBugs understands these annotations as well.

Just my 2c.

Olle


2008/11/20 Marcelo Lotif <[EMAIL PROTECTED]>

> I had exactly the same problem in one of our apps, and was pretty awkward,
> one of my object was shared between all users, just like a static field. We
> spent as much as 2 days trying to find out where was the problem, and when
> we got nothing left to do, we took off the initial assignment and then the
> problem disappeared. This was a hint I found when I was searching the
> mailing list, but we had no clue if this was related to the problem. After
> this, we adapt our apps to initialize the variables at another time
> (SetupRender phase or when we are about to enter in a page).
>
> I think this kind of error report is a good point, and I recommend you to
> take this off your pages before you have major problems. =)
>
> On Thu, Nov 20, 2008 at 3:17 PM, Howard Lewis Ship <[EMAIL PROTECTED]>
> wrote:
>
> > Tapestry has not way to determine if a value is mutable or immutable.
> >
> > What was happening is that people were assigning mutable values
> > (lists, maps, user-defined objects) as the initial value of a
> > persistent field.  The end result was that these mutable objects were
> > being shared between users, as page instances got re-used.
> >
> > The change forces devs to be aware of this issue and to explicitly
> > assign to it at a time when the value can be persisted in the session.
> >
> > On Wed, Nov 19, 2008 at 11:39 AM, Eric Ma <[EMAIL PROTECTED]> wrote:
> > >
> > > Why was this restriction introduced in 5.0.16?  It completely breaks
> our
> > > application.  If the benefit is marginal, can we roll back to the
> > original
> > > behavior?  Or alternatively, what is a "better" practice under 5.0.16?
> > >
> > > Thanks,
> > > --
> > > View this message in context:
> >
> http://www.nabble.com/-T5--Persistent-fields-may-not-be-updated-until-after-the-page-has-finished-loading-tp20587662p20587662.html
> > > Sent from the Tapestry - User mailing list archive at Nabble.com.
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator Apache Tapestry and Apache HiveMind
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Atenciosamente,
>
> Marcelo Lotif
> Programador Java e Tapestry
> FIEC - Federação das Indústrias do Estado do Ceará
> (85) 3477-5910
>



-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se


Re: Tapestry 5, WAR files and deployment

2008-11-07 Thread Olle Hallin
The standard cure-most-dependency-problems medicin for Maven is to wipe your
local repository and try again.
Delete (or rename) $HOME/.m2/repository (Linux) or
%USERPROFILE%\.m2\repository (Windows).

Also: the standard way to package a any Maven project is mvn package.
mvn war:war happens to work here, since it is bound to the package goal for
a war project.

HTH,
Olle

2008/11/6 Fernando Padilla <[EMAIL PROTECTED]>

> This is probably because it can't download the files..
>
> I would double check your networking, but because you're emailing us I'll
> assume it's working.
>
> Someone I know also had issue like this, and the cause for him was he
> installed it as root on his laptop, so when he tried to build it as his user
> he didn't have permissions to actually modify the repository.  So it could
> not successfully fetch any dependencies.
>
> Though I don't recommend it, he runs all maven with sudo.
>
> Not sure what the best way to install it is, but I installed maven on my
> laptop simply by extracting it into a directory as my user, then adding the
> bin directory to my user's path..
>
>
>
>
>
>
> tapestryphoto wrote:
>
>> Quoting Olle Hallin <[EMAIL PROTECTED]>:
>>
>>  Does it work from the command line?
>>> Olle
>>>
>>>
>> I tried mvn war:war from the project directory.
>>
>> Bizarrely it gives even more problems.  I find Maven very frustrating...
>>
>>
>> [INFO] Failed to resolve artifact.
>>
>> Missing:
>> --
>> 1) org.apache.maven:maven-archiver:jar:2.2
>>
>>  Try downloading the file manually from the project website.
>>
>>  Then, install it using the command:
>>  mvn install:install-file -DgroupId=org.apache.maven
>> -DartifactId=maven-arc
>> hiver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file
>>
>>  Alternatively, if you host your own repository you can deploy the file
>> there:
>>
>>  mvn deploy:deploy-file -DgroupId=org.apache.maven
>> -DartifactId=maven-archi
>> ver -Dversion=2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
>> -DrepositoryI
>> d=[id]
>>
>>  Path to dependency:
>>1)
>> org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1
>>2) org.apache.maven:maven-archiver:jar:2.2
>>
>> 2) org.codehaus.plexus:plexus-utils:jar:1.4.7
>>
>>  Try downloading the file manually from the project website.
>>
>>  Then, install it using the command:
>>  mvn install:install-file -DgroupId=org.codehaus.plexus
>> -DartifactId=plexus
>> -utils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file
>>
>>  Alternatively, if you host your own repository you can deploy the file
>> there:
>>
>>  mvn deploy:deploy-file -DgroupId=org.codehaus.plexus
>> -DartifactId=plexus-u
>> tils -Dversion=1.4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
>> -Dreposito
>> ryId=[id]
>>
>>  Path to dependency:
>>1)
>> org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1
>>2) org.codehaus.plexus:plexus-utils:jar:1.4.7
>>
>> 3) com.thoughtworks.xstream:xstream:jar:1.2.2
>>
>>  Try downloading the file manually from the project website.
>>
>>  Then, install it using the command:
>>  mvn install:install-file -DgroupId=com.thoughtworks.xstream
>> -DartifactId=x
>> stream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file
>>
>>  Alternatively, if you host your own repository you can deploy the file
>> there:
>>
>>  mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream
>> -DartifactId=xst
>> ream -Dversion=1.2.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
>> -Dreposito
>> ryId=[id]
>>
>>  Path to dependency:
>>1)
>> org.apache.maven.plugins:maven-war-plugin:maven-plugin:2.1-alpha-1
>>2) com.thoughtworks.xstream:xstream:jar:1.2.2
>>
>> --
>> 3 required artifacts are missing.
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin
Senior Java Developer and Architect
[EMAIL PROTECTED]
www.crisp.se


Re: Tapestry 5, WAR files and deployment

2008-11-06 Thread Olle Hallin
Does it work from the command line?
Olle


2008/11/6 tapestryphoto <[EMAIL PROTECTED]>

> Thanks Olle, much appreciated!
>
> Although when I try Maven I get:
>
>
> Error message: Failed to resolve plugin for mojo binding:
> org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test
> Root error message: Unable to download the artifact from any repository
>
> p.
>
> Quoting Olle Hallin <[EMAIL PROTECTED]>:
>
>  Hi,
>>
>> This is most easily done with mvn package. The resulting WAR is found in
>> the
>> target folder of your project.
>> Drop it into Tomcat/Jetty, and you're done.
>>
>> If you insist on doing it from within Eclipse, then
>>
>>   1. install the m2eclipse plugin
>>   2. enable Maven for your project
>>   3. right-click pom.xml and invoke Run As -> Maven package
>>
>>
>>
>> Olle
>>
>>
>> 2008/11/6 James Sherwood <[EMAIL PROTECTED]>
>>
>>  Hello,
>>>
>>> I deploy to tomcat but war essentials should be the same.  I think the
>>> only
>>> difference between tomcat and Jetty are Tomcats classloaders which maven
>>> takes care of apparently.
>>>
>>> Just create the WAR with eclipse and drop it in your deploy folder(tomcat
>>> is
>>> the webapps directory and you don't even have to create a context) but
>>> for
>>> Jetty you may have too. Just do a quick search on deploying war's to
>>> jetty.
>>>
>>> This is one example that might help you(I am not familiar with Jetty):
>>>
>>> http://markmail.org/message/csnnytlurso7b3ut
>>>
>>> --James
>>>
>>> -Original Message-
>>> From: tapestryphoto [mailto:[EMAIL PROTECTED]
>>> Sent: November-06-08 10:19 AM
>>> To: users@tapestry.apache.org
>>> Subject: Tapestry 5, WAR files and deployment
>>>
>>> Hi,
>>>
>>> Having gone through the Tapestry tutorials, got to grips with it,
>>> developed a small application and have got it running well I'd like to
>>> actually deploy it.
>>>
>>> I notice there are no documents, examples or tutorials (as far as I
>>> can see) that address how to do this. Even the "Tapestry 5" book is
>>> pretty silent on the issue (apart from telling me what a WAR file is -
>>> and even I know that). Perhaps someone could whip up a Wiki entry?
>>>
>>>
>>> I'm using Eclipse. I'd like to:
>>>
>>> 1) create a WAR from my project
>>>
>>> 2) deploy it on a server that has Jetty running.
>>>
>>>
>>> Do I need something like the following build.xml:
>>>
>>> 
>>> 
>>>  
>>>   
>>>   
>>> 
>>> 
>>>
>>> Is there anthing else I need to do for this Ant target?
>>>
>>> Or do I use Maven?  And is that something like a command line call:
>>> mvn war:war
>>> or are there other things I need to do first?
>>>
>>>
>>> I then place the resulting WAR in the "webapps" directory under Jetty
>>> and start Jetty.
>>>
>>> Correct?
>>>
>>>
>>> p.
>>>
>>>
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>> __ Information from ESET Smart Security, version of virus
>>> signature
>>> database 3536 (20081019) __
>>>
>>> The message was checked by ESET Smart Security.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>> __ Information from ESET Smart Security, version of virus
>>> signature
>>> database 3536 (20081019) __
>>>
>>> The message was checked by ESET Smart Security.
>>>
>>> http://www.eset.com
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>> --
>> Olle Hallin M.Sc.
>> +46 70 6653071
>> [EMAIL PROTECTED]
>> www.hit.se
>>
>>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: Tapestry 5, WAR files and deployment

2008-11-06 Thread Olle Hallin
Everyday one learns something new is a good day :D
Olle


2008/11/6 Thiago H. de Paula Figueiredo <[EMAIL PROTECTED]>

> Em Thu, 06 Nov 2008 12:05:50 -0300, Olle Hallin <[EMAIL PROTECTED]>
> escreveu:
>
>  Hi,
>> If you insist on doing it from within Eclipse, then
>>
>>   1. install the m2eclipse plugin
>>   2. enable Maven for your project
>>   3. right-click pom.xml and invoke Run As -> Maven package
>>
>
> You can also right-click the project and invoke Run As -> Maven package.
> Just a little faster than finding the pom.xml. :)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: Tapestry 5, WAR files and deployment

2008-11-06 Thread Olle Hallin
Hi,

This is most easily done with mvn package. The resulting WAR is found in the
target folder of your project.
Drop it into Tomcat/Jetty, and you're done.

If you insist on doing it from within Eclipse, then

   1. install the m2eclipse plugin
   2. enable Maven for your project
   3. right-click pom.xml and invoke Run As -> Maven package


Olle


2008/11/6 James Sherwood <[EMAIL PROTECTED]>

> Hello,
>
> I deploy to tomcat but war essentials should be the same.  I think the only
> difference between tomcat and Jetty are Tomcats classloaders which maven
> takes care of apparently.
>
> Just create the WAR with eclipse and drop it in your deploy folder(tomcat
> is
> the webapps directory and you don't even have to create a context) but for
> Jetty you may have too. Just do a quick search on deploying war's to jetty.
>
> This is one example that might help you(I am not familiar with Jetty):
>
> http://markmail.org/message/csnnytlurso7b3ut
>
> --James
>
> -Original Message-
> From: tapestryphoto [mailto:[EMAIL PROTECTED]
> Sent: November-06-08 10:19 AM
> To: users@tapestry.apache.org
> Subject: Tapestry 5, WAR files and deployment
>
> Hi,
>
> Having gone through the Tapestry tutorials, got to grips with it,
> developed a small application and have got it running well I'd like to
> actually deploy it.
>
> I notice there are no documents, examples or tutorials (as far as I
> can see) that address how to do this. Even the "Tapestry 5" book is
> pretty silent on the issue (apart from telling me what a WAR file is -
> and even I know that). Perhaps someone could whip up a Wiki entry?
>
>
> I'm using Eclipse. I'd like to:
>
> 1) create a WAR from my project
>
> 2) deploy it on a server that has Jetty running.
>
>
> Do I need something like the following build.xml:
>
> 
> 
>   
>
>
> 
> 
>
> Is there anthing else I need to do for this Ant target?
>
> Or do I use Maven?  And is that something like a command line call:
> mvn war:war
> or are there other things I need to do first?
>
>
> I then place the resulting WAR in the "webapps" directory under Jetty
> and start Jetty.
>
> Correct?
>
>
> p.
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> __ Information from ESET Smart Security, version of virus signature
> database 3536 (20081019) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> __ Information from ESET Smart Security, version of virus signature
> database 3536 (20081019) __
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Has anyone integrated tapestry-acegi with CAS?

2008-11-06 Thread Olle Hallin
Hi!
I'm looking for examples/code for how to configure tapestry-acegi to use
CAS.

Anyone out there that have done this?

TIA,
Olle Hallin


Re: Development Environment

2008-09-27 Thread Olle Hallin
Or "mvnDebug jetty:run" and then attach the debugger to the running jvm.
Regards,
Olle

2008/9/27 Luther Baker <[EMAIL PROTECTED]>

> I love this forum!
>
>
> On Sep 27, 2008, at 10:44 AM, Martin Strand wrote:
>
>  With m2eclipse:
>> Right click your project, select "Debug As" --> "Maven build..." and start
>> jetty:run from there
>>
>> On Sat, 27 Sep 2008 17:20:54 +0200, Luther Baker <[EMAIL PROTECTED]>
>> wrote:
>>
>>  :-) Nice analogy.
>>>
>>> So, how do I use the eclipse debugger with mvn jetty:run?
>>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: Hibernate validator

2008-05-18 Thread Olle Hallin
+1!

FYI, see http://opensource.atlassian.com/projects/hibernate/browse/HV-44 .

Good luck!

Olle


2008/5/18 Toby Hobson <[EMAIL PROTECTED]>:

> Hi
>
> I was thinking of integrating the hibernate-validator with T5's validation
> framework (or trying to!) so I can re-use the validation rules I have
> already defined on my model (kinda like JBoss seam). Firstly is anyone else
> working on anything like this? Secondly do you think this would be useful to
> the Tapestry community?
>
> Thanks
>
> Toby
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: Ant based T5 application

2008-04-01 Thread Olle Hallin
Or why not let Maven generate your Ant scripts, which then can be maintained
you?

See http://maven.apache.org/plugins/maven-ant-plugin/

This way, you can use the Tapestry QuickStart archetype to get going really
fast, and then switch to Ant.

HTH,
Olle


2008/3/31, 宁德辉 <[EMAIL PROTECTED]>:
>
> What about tapestry jumpstart?
> http://files.doublenegative.com.au/jumpstart/.
> It uses Ant to build.
>
> DH
>
>
> - Original Message -
> From: "HHB" <[EMAIL PROTECTED]>
> To: 
> Sent: Monday, March 31, 2008 10:36 PM
> Subject: Ant based T5 application
>
>
> >
> > Hi.
> > T5 prefers Maven as the building tool, do know any on line sample T5
> > application that uses Ant instead of Maven?
> > I can write one by hand but I'm looking for Ant script that is
> production
> > aware.
> > Thanks.
> > --
> > View this message in context:
> http://www.nabble.com/Ant-based-T5-application-tp16396283p16396283.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >




-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: T5: Cannot get org.acegisecurity.CredentialsExpiredException to work

2008-03-28 Thread Olle Hallin
Hi again,

I've made a new version of the SecurityModule.java that follows the usual
build + contribute pattern in tapestry-ioc.

Sorry for the changed formatting, I hit Ctrl-Shift-F by accident in Eclipse.

Regards,
Olle

2008/3/28, Olle Hallin <[EMAIL PROTECTED]>:
>
> Hi, I found the solution.
>
> It was an empty AuthenticationProcessingFilter.exceptionMappings that
> caused all
> AuthenticationExceptions to be treated equally.
>
> I added a default public static Properties
> buildAuthenticationExceptionMappings() to SecurityModule.java, which maps
> certain AuthenticationExceptions to "${acegi.accessDenied.url}" if it is
> defined, and then sets this mapping in
> buildAuthenticationProcessingFilter().
>
> The user of the tapestry5-acegi module can then override this default
> mapping
> in his own AppModule, e.g., to map CredentialsExpiredException and
> LockedException to different URLs.
>
> I've attached the modified SecurityModule.java, with my changes marked
> with "// patch"
>
> Regards,
> Olle
>
>
/*
 * Copyright 2007 Ivan Dubrov
 * Copyright 2007 Robin Helgelin
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nu.localhost.tapestry.acegi.services;

import java.util.List;
import java.util.Map;
import java.util.Properties;

import nu.localhost.tapestry.acegi.services.internal.AcegiExceptionTranslationFilter;
import nu.localhost.tapestry.acegi.services.internal.AcegiWorker;
import nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper;
import nu.localhost.tapestry.acegi.services.internal.LogoutServiceImpl;
import nu.localhost.tapestry.acegi.services.internal.RequestFilterWrapper;
import nu.localhost.tapestry.acegi.services.internal.SecurityChecker;
import nu.localhost.tapestry.acegi.services.internal.StaticSecurityChecker;

import org.acegisecurity.AccessDecisionManager;
import org.acegisecurity.AccountExpiredException;
import org.acegisecurity.AuthenticationManager;
import org.acegisecurity.AuthenticationTrustResolver;
import org.acegisecurity.AuthenticationTrustResolverImpl;
import org.acegisecurity.CredentialsExpiredException;
import org.acegisecurity.LockedException;
import org.acegisecurity.context.HttpSessionContextIntegrationFilter;
import org.acegisecurity.context.SecurityContextImpl;
import org.acegisecurity.providers.AuthenticationProvider;
import org.acegisecurity.providers.ProviderManager;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider;
import org.acegisecurity.providers.anonymous.AnonymousProcessingFilter;
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
import org.acegisecurity.providers.dao.SaltSource;
import org.acegisecurity.providers.dao.salt.SystemWideSaltSource;
import org.acegisecurity.providers.encoding.PasswordEncoder;
import org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider;
import org.acegisecurity.ui.AccessDeniedHandlerImpl;
import org.acegisecurity.ui.AuthenticationEntryPoint;
import org.acegisecurity.ui.ExceptionTranslationFilter;
import org.acegisecurity.ui.logout.LogoutHandler;
import org.acegisecurity.ui.logout.SecurityContextLogoutHandler;
import org.acegisecurity.ui.rememberme.RememberMeProcessingFilter;
import org.acegisecurity.ui.rememberme.RememberMeServices;
import org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices;
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilter;
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint;
import org.acegisecurity.userdetails.UserDetailsService;
import org.acegisecurity.userdetails.memory.UserAttribute;
import org.acegisecurity.userdetails.memory.UserAttributeEditor;
import org.acegisecurity.vote.AccessDecisionVoter;
import org.acegisecurity.vote.AffirmativeBased;
import org.acegisecurity.vote.RoleVoter;
import org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter;
import org.apache.tapestry.ioc.Configuration;
import org.apache.tapestry.ioc.MappedConfiguration;
import org.apache.tapestry.ioc.OrderedConfiguration;
import org.apache.tapestry.ioc.ServiceBinder;
import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.ioc.annotations.InjectService;
import org.apache.tapestry.ioc.annotations.Marker;
import org.apache.tapestry.ioc.annotations.Value;
import org.apache.tapestry.services.ComponentClassTransf

Re: T5: Cannot get org.acegisecurity.CredentialsExpiredException to work

2008-03-28 Thread Olle Hallin
Hi, I found the solution.

It was an empty AuthenticationProcessingFilter.exceptionMappings that caused
all
AuthenticationExceptions to be treated equally.

I added a default public static Properties
buildAuthenticationExceptionMappings() to SecurityModule.java, which maps
certain AuthenticationExceptions to "${acegi.accessDenied.url}" if it is
defined, and then sets this mapping in
buildAuthenticationProcessingFilter().

The user of the tapestry5-acegi module can then override this default
mapping
in his own AppModule, e.g., to map CredentialsExpiredException and
LockedException to different URLs.

I've attached the modified SecurityModule.java, with my changes marked with
"// patch"

Regards,
Olle



2008/3/17, Robin Helgelin <[EMAIL PROTECTED]>:
>
> On Mon, Mar 17, 2008 at 8:40 AM, Olle Hallin <[EMAIL PROTECTED]>
> wrote:
> >  It properly catches the CredentialsExpiredException that was thrown by
> the
> >  UsernamePasswordAuthenticationToken and tries to publish the event, but
> the
> >  ProviderManager.applicationEventPublisher is null.
> >
> >  I don't know the inner mechanics of Acegi nor tapestry-ioc well enough
> to
> >  inject that dependency myself, so help would be appreciated.
>
>
> Looking at the code it seems there must be an
> ApplicationEventPublished defined. I''m too green in spring for this,
> but I'll look into it.
>
>
> --
>
> regards,
>   Robin
>
> ---------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se
/*
 * Copyright 2007 Ivan Dubrov
 * Copyright 2007 Robin Helgelin
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nu.localhost.tapestry.acegi.services;

import java.util.List;
import java.util.Properties;

import nu.localhost.tapestry.acegi.services.internal.AcegiExceptionTranslationFilter;
import nu.localhost.tapestry.acegi.services.internal.AcegiWorker;
import nu.localhost.tapestry.acegi.services.internal.HttpServletRequestFilterWrapper;
import nu.localhost.tapestry.acegi.services.internal.LogoutServiceImpl;
import nu.localhost.tapestry.acegi.services.internal.RequestFilterWrapper;
import nu.localhost.tapestry.acegi.services.internal.SecurityChecker;
import nu.localhost.tapestry.acegi.services.internal.StaticSecurityChecker;

import org.acegisecurity.AccessDecisionManager;
import org.acegisecurity.AccountExpiredException;
import org.acegisecurity.AuthenticationManager;
import org.acegisecurity.AuthenticationTrustResolver;
import org.acegisecurity.AuthenticationTrustResolverImpl;
import org.acegisecurity.CredentialsExpiredException;
import org.acegisecurity.LockedException;
import org.acegisecurity.context.HttpSessionContextIntegrationFilter;
import org.acegisecurity.context.SecurityContextImpl;
import org.acegisecurity.providers.AuthenticationProvider;
import org.acegisecurity.providers.ProviderManager;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider;
import org.acegisecurity.providers.anonymous.AnonymousProcessingFilter;
import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
import org.acegisecurity.providers.dao.SaltSource;
import org.acegisecurity.providers.dao.salt.SystemWideSaltSource;
import org.acegisecurity.providers.encoding.PasswordEncoder;
import org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider;
import org.acegisecurity.ui.AccessDeniedHandlerImpl;
import org.acegisecurity.ui.AuthenticationEntryPoint;
import org.acegisecurity.ui.ExceptionTranslationFilter;
import org.acegisecurity.ui.logout.LogoutHandler;
import org.acegisecurity.ui.logout.SecurityContextLogoutHandler;
import org.acegisecurity.ui.rememberme.RememberMeProcessingFilter;
import org.acegisecurity.ui.rememberme.RememberMeServices;
import org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices;
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilter;
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint;
import org.acegisecurity.userdetails.UserDetailsService;
import org.acegisecurity.userdetails.memory.UserAttribute;
import org.acegisecurity.userdetails.memory.UserAttributeEditor;
import org.acegisecurity.vote.AccessDe

Re: T5: Problems with Tapestry5-Acegi

2008-03-27 Thread Olle Hallin
c void contributeApplicationDefaults(
> MappedConfiguration configuration)
> {
>
> configuration.add("tapestry.supported-locales", "en");
> configuration.add("acegi.loginform.url", "/loginPage");
>
> configuration.add("acegi.password.salt", "");
> configuration.add("acegi.accessDenied.url", "/SecurityException");
> }
>
>
> public static void contributeProviderManager(
> OrderedConfiguration configuration,
> @InjectService("DaoAuthenticationProvider")
>
> AuthenticationProvider daoAuthenticationProvider) {
>
> configuration.add("daoAuthenticationProvider",
> daoAuthenticationProvider);
> }
>
> I have a UserDetailsServiceImpl like this:
> public class UserDetailsServiceImpl implements UserDetailsService {
>
> /* PRIVATE MEMBERS */
> private AppUserDao appUserDao;
>
> /* DAO SETTERS */
> public void setAppUserDao(AppUserDao appUserDao){
> this.appUserDao = appUserDao;
> }
>
> public UserDetails loadUserByUsername(String username) throws
> UsernameNotFoundException, DataAccessException {
> return new UserDetailsBean(appUserDao.findById(username));
> }
> }
>
> I hoocked up this service using spring:
>  class="com.bergoo.webshop.services.internal.UserDetailsServiceImpl">
> 
> 
>
> UserDetailsBean is the same as from the example for Tapestry5-Acegi
> project
> except that I added a constructor that take in my AppUser object and I
> added
> a new toString() method so I can see the content.
>
> GrantedAuthorityBean.java, Start.java, Start.tml, LoginPage.java,
> LoginPage.tml, Secure.java, Secure.tml are the same as in the example...
>
> I put a system.out.println() in the end of the constructor where I create
> the UserDetailsBean and this is what the sysout returns:
>
> UserDetailsBean {
> username = jacob
> password = jacob
> accountNonExpired = true
> passwordaccountNonLocked = true
> credentialsNonExpired = true
> enabled = true
> grantedAuthorities {
> 'ROLE_ADMIN'
> 'ROLE_MANAGER'
> 'ROLE_USER'
> }
> }
>
> That means that The part where I access the database and gets the user
> information for the security check is working... but it looks like I get
> this exception when I am in the loginSuccess method
>
> Does anybody have any idears on how to fix this exception?
> I have spring-web in my pom.xml...
>
> thanks in advance for any help, pointers...
>
> Jacob
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-Problems-with-Tapestry5-Acegi-tp16266687p16321412.html
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: [T5] Maven2 or Ivy?

2008-03-25 Thread Olle Hallin
I could agree to Howards despair over some of the Maven oddities, but
all-in-all I think Maven2 is a very good tool. We use it on all our
products, ranging from 5 to 20 modules.

We have recently converted from Ant+Ivy, and I surely don''t want to go
back!

Regards,
Olle


2008/3/25, Peter Beshai <[EMAIL PROTECTED]>:
>
> Sorry if this has been mentioned before, but I couldn't find any
> information
> about it in my searches (which is perhaps the answer already). I noticed
> on
> Howard's blog he condemned the use of Maven2, and I was wondering if there
> have been any changes to Tapestry5 that make it less maven-centric, or if
> there are tutorials on building Tapestry applications without maven.
>
> Is everyone still using maven2? Ivy?
>
> Thanks,
>
> Peter Beshai
>



-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: T5: Tapestry-Hibernate and Hibernate validator

2008-03-25 Thread Olle Hallin
Horay to that!

It would also be great if someone could help me and vote on
http://opensource.atlassian.com/projects/hibernate/browse/HV-44 (Make
Hibernate Validator multi-lingual).

Regards,
Olle

2008/3/24, Howard Lewis Ship <[EMAIL PROTECTED]>:
>
> Eventually, it would be nice if we could come up with a way to extract
> the validation meta data and use that to generate Tapestry
> validations. Maybe in 5.1.
>
>
> On Mon, Mar 24, 2008 at 9:37 AM, Josh Canfield <[EMAIL PROTECTED]>
> wrote:
> > Tapestry doesn't do anything with the hibernate Validators so you use
> >  them just like you would outside of a tapestry project. In tapestry
> >  you'd handle them the same way you do other constraint violoations.
> >
> >
> >  On Fri, Mar 21, 2008 at 3:38 PM, Angelo Chen <
> [EMAIL PROTECTED]> wrote:
> >  >
> >
> >
> > > Hi Josh,
> >  >
> >  > Anything need to be done in order to use it? thanks.
> >  >
> >  > A.C.
> >  >
> >  >
> >  > joshcanfield wrote:
> >  > >
> >  > > yes
> >  > >
> >  > >
> >  >
> >  > --
> >  > View this message in context:
> http://www.nabble.com/T5%3A-Tapestry-Hibernate-and-Hibernate-validator-tp16198439p16210329.html
> >  >
> >  > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >  >
> >  >
> >  > -
> >  > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > For additional commands, e-mail: [EMAIL PROTECTED]
> >  >
> >  >
> >
> >
> >
> >
> > --
> >  --
> >  TheDailyTube.com. Sign up and get the best new videos on the internet
> >  delivered fresh to your inbox.
> >
> >  -----
> >
> >
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: T5: Cannot get org.acegisecurity.CredentialsExpiredException to work

2008-03-17 Thread Olle Hallin
Correction to myself: tapestry5-acegi version: 1.0.3

As I said, it looks like there is a missing collaborator in the standard
Acegi ProviderManager.

It properly catches the CredentialsExpiredException that was thrown by the
UsernamePasswordAuthenticationToken and tries to publish the event, but the
ProviderManager.applicationEventPublisher is null.

I don't know the inner mechanics of Acegi nor tapestry-ioc well enough to
inject that dependency myself, so help would be appreciated.

Regards,
Olle


2008/3/14, Olle Hallin <[EMAIL PROTECTED]>:
>
> Hi!
>
> I single-stepped through the problem, and it looks like
> org.acegisecurity.providers.ProviderManager.publishEvent() is swallowing
> the exception
> because the
> org.acegisecurity.providers.ProviderManager.applicationEventPublisher ==
> null.
>
> Acegi Security version = 1.0.6
>
> Regards,
> Olle
>
>
> 2008/3/14, Robin Helgelin <[EMAIL PROTECTED]>:
> >
> > On Fri, Mar 14, 2008 at 2:55 PM, Olle Hallin <[EMAIL PROTECTED]>
> > wrote:
> > > Hi!
> >
> > Hi.
> >
> >
> > >  Now the problem is that despite having the symbol "
> > acegi.accessDenied.url"
> > >  defined to "/loginrejected", no forwarding to this page occurs.
> > >
> > >  I have verified that the AccessDeniedHandlerImpl has been injected
> > with this
> > >  value by removing the leading slash. (AccessDeniedHandlerImpl throws
> > when
> > >  errorPage
> > >  does not start with '/')
> >
> >
> > What does acegi-logging say? I heard a few others say that access
> > denied was non-working, and as I haven't tested this code myself I
> > don't really know whethers it's tapestry5-acegi or Acegi itself.
> >
> >
> > --
> >   regards,
> >   Robin
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Olle Hallin M.Sc.
> +46 70 6653071
> [EMAIL PROTECTED]
> www.hit.se
>



-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: T5: Cannot get org.acegisecurity.CredentialsExpiredException to work

2008-03-14 Thread Olle Hallin
Hi!

I single-stepped through the problem, and it looks like
org.acegisecurity.providers.ProviderManager.publishEvent() is swallowing the
exception
because the
org.acegisecurity.providers.ProviderManager.applicationEventPublisher ==
null.

Acegi Security version = 1.0.6

Regards,
Olle


2008/3/14, Robin Helgelin <[EMAIL PROTECTED]>:
>
> On Fri, Mar 14, 2008 at 2:55 PM, Olle Hallin <[EMAIL PROTECTED]>
> wrote:
> > Hi!
>
> Hi.
>
>
> >  Now the problem is that despite having the symbol "
> acegi.accessDenied.url"
> >  defined to "/loginrejected", no forwarding to this page occurs.
> >
> >  I have verified that the AccessDeniedHandlerImpl has been injected with
> this
> >  value by removing the leading slash. (AccessDeniedHandlerImpl throws
> when
> >  errorPage
> >  does not start with '/')
>
>
> What does acegi-logging say? I heard a few others say that access
> denied was non-working, and as I haven't tested this code myself I
> don't really know whethers it's tapestry5-acegi or Acegi itself.
>
>
> --
>   regards,
>   Robin
>
> -----
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


OutOfMemoryError when missing ".tml" on page template

2008-03-14 Thread Olle Hallin
Hi!

Just an observation, I'm not sure if it's worth to create JIRA issue for it.

When I created a new LoginRejected page, I named the template file just
"LoginRejected", i.e., without the .tml suffix.

This lead to a java.lang.OutOfMemoryError when starting the app.

Renaming the template to LoginRejected.tml solved the issue.

Regards,
Olle


Re: T5: Cannot get org.acegisecurity.CredentialsExpiredException to work

2008-03-14 Thread Olle Hallin
Oh, I forgot to mention the versions:

Tapestry 5.0.11
tapestry5-acegi 1.0.4

Olle

2008/3/14, Olle Hallin <[EMAIL PROTECTED]>:
>
> Hi!
>
> We use tapestry5-acegi for our app, but I'm not sure if this is a Tapestry
> or Acegi problem.
>
> When setting forcePasswordChange=true in the database for a user, Acegi
> throws org.acegisecurity.CredentialsExpiredException (since
> our implementation of UserDetails.isCredentialsNonExpired() returns
> false).
>
> So far so good.
>
> Now the problem is that despite having the symbol "acegi.accessDenied.url"
> defined to "/loginrejected", no forwarding to this page occurs.
>
> I have verified that the AccessDeniedHandlerImpl has been injected with
> this value by removing the leading slash. (AccessDeniedHandlerImpl throws
> when errorPage
> does not start with '/')
>
> Instead, the user is redirected to the normal login page.
>
> Any ideas?
>
> Regards,
> Olle
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


T5: Cannot get org.acegisecurity.CredentialsExpiredException to work

2008-03-14 Thread Olle Hallin
Hi!

We use tapestry5-acegi for our app, but I'm not sure if this is a Tapestry
or Acegi problem.

When setting forcePasswordChange=true in the database for a user, Acegi
throws org.acegisecurity.CredentialsExpiredException (since
our implementation of UserDetails.isCredentialsNonExpired() returns false).

So far so good.

Now the problem is that despite having the symbol "acegi.accessDenied.url"
defined to "/loginrejected", no forwarding to this page occurs.

I have verified that the AccessDeniedHandlerImpl has been injected with this
value by removing the leading slash. (AccessDeniedHandlerImpl throws when
errorPage
does not start with '/')

Instead, the user is redirected to the normal login page.

Any ideas?

Regards,
Olle


Re: Does Tapestry5 support Portlets specs JSR168 and 286

2007-12-28 Thread Olle Hallin
Hi,

Consider this as interest in having T5 support portlets. We are just about
starting porting a largish JSP-hell application to a proper CMS system plus
Tapestry and portlets, and I would very much like to see that we can jump
right onto T5.

To us, portlets are more important that AJAX (since we don't have much of
that in the current app anyway).

Regards,
Olle Hallin

2007/12/28, Howard Lewis Ship <[EMAIL PROTECTED]>:
>
> It's really the other way around; a Portlet is defined in terms of a
> T5 application, where the application pages are mapped to different
> views of the portlet. A portal would contain many portlets, some T5
> applications, some natively implemented.
>
> On Dec 28, 2007 11:19 AM, Michael Lake <[EMAIL PROTECTED]> wrote:
> >
> >
> > would it be completely ridiculous for a T5 component to house a
> > portlet? is that at all feasible?
> >
> > -mike
> >
> >
> > On Dec 28, 2007, at 2:06 PM, Howard Lewis Ship wrote:
> >
> > > Currently there are not plans to support Portlets in T5 for the
> > > initial release. If there is enough interest, it will be added as a
> > > follow on. It will be much easier to add to T5 than it was to T4,
> > > since a lot of the ideas in T5 came from T4 and its portlet support.
> > > such as the action request / render request split present in T5 (and
> > > in portlets).
> > >
> > > On Dec 28, 2007 10:09 AM, Cardenas, Juan Carlos
> > > <[EMAIL PROTECTED]> wrote:
> > >> I can't seem to find a reference in the documentation.
> > >>
> > >> I know Tapestry4 at least covers 168
> > >>
> > >> What are the plans for covering JSR 286 Portlet 2.0 spec?
> > >>
> > >> Carlos
> > >>
> > >
> > >
> > >
> > > --
> > > Howard M. Lewis Ship
> > >
> > > Creator Apache Tapestry and Apache HiveMind
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > -----
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: In T4.1.2 How to LinkTo NonTapestry URIs(link to my jsp page)

2007-10-26 Thread Olle Hallin
But how do I do this in T5?

Olle


2007/9/17, Renat Zubairov <[EMAIL PROTECTED]>:
>
> You can send redirect to any page and/or URL you want via direct
> access to WebRequest or via RedirectException
> See
>
>
> http://tapestry.apache.org/tapestry4/tapestry/apidocs/org/apache/tapestry/RedirectException.html
>
> BR
> Renat
>
> On 17/09/2007, Doublel <[EMAIL PROTECTED]> wrote:
> > Hello
> > In t5 can redirect login and logouts to Acegi's special URIs.In t 4.1.2.
> I
> > want to Redirect to my some old jsp pages?How to do it ??
> > --
> > 得与失都是生活
> >
>
>
> --
> Best regards,
> Renat Zubairov
>



-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: [t4] How do I inject arbitrary services into a custom service encoder?

2007-08-07 Thread Olle Hallin
Hi,

My problems has nothing to do with Spring. The problem is that the
HiveMind's Lightweight Instance Initialization (
http://hivemind.apache.org/hivemind1/instance-initialization.html) simply is
not usable in cases like this.

So I rewrote hivemodule.xml this way:

  
Encode/decode current foo in request URLs

  

  

  

  







  

Now it works.

Regards,
Olle


2007/8/7, Lutz Hühnken <[EMAIL PROTECTED]>:
>
> Hi there,
>
> to me it seems the error message indicates that you don't have a
> method "setSpringContext" in your CurrentFooEncoder. I think hivemind
> will try to set that property using that method. Or maybe you need a
> constructor with an argument of that type.
>
> For a slightly different approach you might want to look at the
> tapestry-spring library at
> http://howardlewisship.com/tapestry-javaforge/tapestry-spring/. That
> will allow you to reference objects defined in your spring application
> context in your hivemodule.xml using the spring: - prefix. I'm not
> sure how the syntax would be for your encoders, though.
> I think you could just create an instance, and within the class you
> can inject spring objects using the @InjectSpring annotation. I use it
> in some places, works great, just can't seem to remember the
> syntactical sugar..
>
> Hope this helps anyway,
>
> Lutz
>
>
> On 8/7/07, Olle Hallin <[EMAIL PROTECTED]> wrote:
> > Hi again,
> >
> > I tried your suggestion, but I get an ApplicationRuntimeException: No
> > property editor exists for property springContext of class
> > foo.web.CurrentFooEncoder.
> >
> > What else must I do? It smells writing some glue code...
> >
> > Regards,
> > Olle
> >
> >
> > 2007/8/7, Richard Kirby <[EMAIL PROTECTED]>:
> > >
> > > Hi Olle,
> > >
> > > Try
> > >
> > >  > > object="instance:CurrentFooEncoder,springContext=spring:springContext"
> />
> > >
> > > Basically the instance: allows for properties to be set using comma
> > > separated property=value
> > >
> > > Hope that works for you
> > >
> > > Richard
> > >
> > > Olle Hallin wrote:
> > > > Hi!
> > > >
> > > > I have written a simple (Tapestry4) custom service encoder
> > > > (CurrentFooEncoder) which works ok for now. It inserts/removes
> "/foo"
> > > first
> > > > in the encoding.getServletPath().
> > > >
> > > > It is declared in hivemodule.xml like
> > > >
> > > >   
> > > >  />
> > > >  > > service="external"
> > > > />
> > > >  > > > stateful-extension="sdirect" />
> > > > 
> > > > 
> > > >
> > > >  object="instance:CurrentFooEncoder"
> > > > before="*" />
> > > >   
> > > >
> > > > Now I wan't my CurrentFooEncoder to do some useful work, for which
> it
> > > needs
> > > > my Spring context. How do I achieve that?
> > > > I have already have a HiveMind service-point called
> > > SpringContextFactory.
> > > >
> > > > I guess that I shall write something magic in the object attribute,
> but
> > > > what?
> > > >
> > > > Regards,
> > > > Olle Hallin
> > > >
> > > >
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Olle Hallin M.Sc.
> > +46 70 6653071
> > [EMAIL PROTECTED]
> > www.hit.se
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


Re: [t4] How do I inject arbitrary services into a custom service encoder?

2007-08-07 Thread Olle Hallin
Hi again,

I tried your suggestion, but I get an ApplicationRuntimeException: No
property editor exists for property springContext of class
foo.web.CurrentFooEncoder.

What else must I do? It smells writing some glue code...

Regards,
Olle


2007/8/7, Richard Kirby <[EMAIL PROTECTED]>:
>
> Hi Olle,
>
> Try
>
>  object="instance:CurrentFooEncoder,springContext=spring:springContext" />
>
> Basically the instance: allows for properties to be set using comma
> separated property=value
>
> Hope that works for you
>
> Richard
>
> Olle Hallin wrote:
> > Hi!
> >
> > I have written a simple (Tapestry4) custom service encoder
> > (CurrentFooEncoder) which works ok for now. It inserts/removes "/foo"
> first
> > in the encoding.getServletPath().
> >
> > It is declared in hivemodule.xml like
> >
> >   
> > 
> >  service="external"
> > />
> >  > stateful-extension="sdirect" />
> > 
> > 
> >
> >  > before="*" />
> >   
> >
> > Now I wan't my CurrentFooEncoder to do some useful work, for which it
> needs
> > my Spring context. How do I achieve that?
> > I have already have a HiveMind service-point called
> SpringContextFactory.
> >
> > I guess that I shall write something magic in the object attribute, but
> > what?
> >
> > Regards,
> > Olle Hallin
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Olle Hallin M.Sc.
+46 70 6653071
[EMAIL PROTECTED]
www.hit.se


[t4] How do I inject arbitrary services into a custom service encoder?

2007-08-07 Thread Olle Hallin
Hi!

I have written a simple (Tapestry4) custom service encoder
(CurrentFooEncoder) which works ok for now. It inserts/removes "/foo" first
in the encoding.getServletPath().

It is declared in hivemodule.xml like

  







  

Now I wan't my CurrentFooEncoder to do some useful work, for which it needs
my Spring context. How do I achieve that?
I have already have a HiveMind service-point called SpringContextFactory.

I guess that I shall write something magic in the object attribute, but
what?

Regards,
Olle Hallin