Re: Tapestry 4.1 injecting the wrong application state object

2011-02-03 Thread Howard Lewis Ship
Well, the idea in Tapestry has ever been that the locale for a page is
fixed, once determined, and it's hard to say what the effect of your
change would be ... but good detective work getting this far.

I don't currently remember where in Tapestry 4.1 the determination of
client locale is made; when I have some time, I'll try and look in the
code and see what turns up.

On Wed, Feb 2, 2011 at 6:28 AM, Pepijn Schmitz capt...@chaos.demon.nl wrote:
 Hi Howard,

 Further to my last message, I just discovered that I was making a faulty
 assumption. When the pages are checked out of the pool, the engine locale is
 used to build the page key, but when they are released to the pool, the
 *page* locale is used! So overriding getLocale() on the page is indeed
 causing problems.

 Can you tell me what the correct way of doing this is? Apart from wanting to
 give the users the ability to configure their language in their user
 settings in our application, it is also problematic that the locale that the
 browser provides is often missing the country, and Java often does not use
 correct date, time and number formats if the locale does not include the
 country.

 And do you have any idea if this could also the root cause of my original
 problem? I don't really see how, since all this means as far as I can tell
 is that Tapestry will needlessly instantiate pages, but I still don't see
 how a page which still contains values from one session can end up on
 another session.

 Kind regards,
 Pepijn Schmitz

 On 26-01-11 21:40, Howard Lewis Ship wrote:

 It isn't familiar to me.  Once possible way things could go awry would
 be for you to keep a reference to some page as a property of some
 other page ... that can result in data moving into and out of the page
 without Tapestry's normal lifecycle to initialize it and clean it out.
 I'd look along those lines.

 On Wed, Jan 26, 2011 at 3:21 AM, Pepijn Schmitzcapt...@chaos.demon.nl
  wrote:

 No, not yet! :-(

 Anyone else have any idea?

 In short: my Page objects occasionally get the wrong application state
 object injected by Tapestry 4.1!

 I've been looking into it, but it's very hard to see what's going on with
 all the synthetic classes created by Hivemind. But one clue I got by
 making
 a heap dump and analysing it: all application state objects (of closed
 sessions) were still in memory, with references from Page classes in a
 TapestryKeyedObjectPool!

 I'm pretty sure the Page properties are supposed to be cleaned out at the
 end of a request cycle, when the page is returned to the pool, but
 apparently for some reason that is not happening! Is this a familiar
 problem
 to anyone?

 Kind regards,
 Pepijn Schmitz

 On 25-01-11 11:59, Koka Kiknadze wrote:

 Did you find root of the problem? Just curious :)

 Good luck


 On Tue, Jan 11, 2011 at 11:00 PM, Pepijn
 Schmitzcapt...@chaos.demon.nlwrote:

 Hi,

 Thanks! But I don't think that's it. We're already using HTTPS, but
 also
 that would not explain how the correct application state object can be
 on
 the HttpSession, even though Tapestry injected the wrong one...

 We are using Apache 2 using mod_proxy as a front-end though. Apache
 takes
 care of the SSL and forwards the requests to Glassfish over HTTP. I'll
 look
 into the possibility that something is going wrong there, although it
 seems
 unlikely due to the above reason...

 Cheers,
 Pepijn


 On 11-01-11 19:04, Koka Kiknadze wrote:

 I did have exactly similar problem couple of years ago - JSF app
 worked
 fine
 from intranet, but messed up user sessions when accessed from WAN
 side.

 So initial suspect was the squid proxy configuration of our ISP. The
 problem
 disappeared as soon as we turned encryption on for the whole site (so
 that
 proxy could not mess things up). Well, as the performance was
 acceptable
 even with HTTPS we just left everything as is.

 Hence I'd suggest temporarily requiring HTTPS for the whole site and
 if
 the
 problem disappears, you'll know for sure it's not your application or
 tapestry to be blamed.

 Good luck.




 On Tue, Jan 11, 2011 at 8:37 PM, Pepijn
 Schmitztapes...@chaos.demon.nl

 wrote:

  Hi everyone,

 I'm having a bizarre problem with Tapestry, and I'm hoping someone
 here
 might be able to point me to a solution. Before I go into detail I'd
 like
 to
 describe the problem generally, in the hopes that it might be a known
 problem or someone may have encountered something similar.

 The problem is that Tapestry 4.1.6 sometimes injects the wrong
 application
 state object on my pages! As you can imagine, this plays havoc with
 my
 application, with users seeing other users' details, or even worse,
 changing
 other users' information! It's a support and security nightmare.

 I'm using Tapestry 4.1.6, and I'm using annotations instead of XML
 files.
 My pages all descend from a base class:

 public abstract SupplierDNAPage extends BasePage {
    @InjectState
    public abstract SupplierDnaSession 

Re: Nothing happens when overriding default validation messages

2011-02-03 Thread Howard Lewis Ship
It was the before: vs. after: ... contributing before: means that the
key/values you contributed were themselves overwritten by the default
validation messages from the default contribution.  I haven't checked
the code, but I belive it all would have worked had you ordered it
after:Default.

That being said, yes you can see in 5.2 that ValidationMessagesSource
is going away in terms of multiple contributions to the Global
messages (which itself is now an @Inject-able object, for use in the
services layer).  The idea was to unify the application messages w/
validation messages, make it possible for libraries to make use of
global messages, and make it possible for an application (or even a
library) to override the values for messages provided by the
framework.

On Wed, Feb 2, 2011 at 7:55 AM, Igor Drobiazko igor.drobia...@gmail.com wrote:
 Stephan,

 your previous code was absolutely ok and should have worked. So, there might
 be another issue with your app, which you probably should fix.

 On Wed, Feb 2, 2011 at 4:05 PM, Stephan Windmüller 
 stephan.windmuel...@tu-dortmund.de wrote:

 On 02.02.2011 12:22, Thiago H. de Paula Figueiredo wrote:

  No. But I am adding the whole default validation messages to the
  componentMessagesSource. Could this cause the problem?
  Have you tried using after:* or before:*? It's an ordered
  contribution, so sorting matters.

 Using after:* works. But I do not need the ValidationMessagesSource
 now, contributing to ComponentMessagesSource did the trick.

 Thanks
  Stephan

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




 --
 Best regards,

 Igor Drobiazko
 http://tapestry5.de




-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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

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



Re: Who uses Tapestry ? ... eOfficeo!!!

2011-02-03 Thread bagou

Hi George

Yes all pages were implemented with T5... and it works! We are lucky  ;-)

Erwan

On Thu, Feb 3, 2011 at 7:11 AM, George Banus [via Tapestry Users] 
ml-node+5987708-1009986671-279...@n2.nabble.comml-node%2b5987708-1009986671-279...@n2.nabble.com
 wrote:

 Hi Erwan,

 I'm confused here a bit. From your previous post you seem to indicate that
 only the login pages were implemented with Tapestry but your screen shots
 seems to cover the whole application.

 On Mon, Jan 31, 2011 at 5:16 PM, bagou [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5987708i=0
 wrote:

 
  Now yes ...
 
  http://www.eofficeo.com/fr/services/coffre-fort-numerique
  http://www.eofficeo.com/fr/services/gestionnaire-de-taches
  http://www.eofficeo.com/fr/services/liens-externes
  http://www.eofficeo.com/fr/services/operations-bancaires
  http://www.eofficeo.com/fr/services/mots-de-passe-80
  http://www.eofficeo.com/fr/services/partage-et-collaboration
 
  For better resolution, click on the images...
 
  Erwan LE BESCOND
 
  On Thu, Jan 27, 2011 at 7:08 PM, Howard Lewis Ship [via Tapestry Users] 

  [hidden email] 
  http://user/SendEmail.jtp?type=nodenode=5987708i=1[hidden
 email] http://user/SendEmail.jtp?type=nodenode=5987708i=2
  [hidden email] 
  http://user/SendEmail.jtp?type=nodenode=5987708i=3[hidden
 email] http://user/SendEmail.jtp?type=nodenode=5987708i=4
  
   wrote:
 
   Very nice ... do you have some screenshots of the running application
 to
   share?
  
   On Thu, Jan 27, 2011 at 4:58 AM, bagou [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5967276i=0
   wrote:
  
   
Hello,
   
For almost 3 years, we have been developping a service online with
   Tapestry
5 : eOfficeo ( http://www.eofficeo.com http://www.eofficeo.com )
   
This is a very complex and complete collaborative platform and could
  be,
   I
think, a good showcase for Tapestry.
   
Services provided :
   
 * highly secure online storage
 * task and project management
 * password managemment
 * mail management
 * bookmarking
 * right management
 * file transfer
 * personal finance
   
Other technologies involved :
   
 * hibernate
 * lucene
 * jasypt
 * jquery
 * spring
   
We would like to be added to your web page
https://tapestry.apache.org/applications.html
https://tapestry.apache.org/applications.html  and we think that
 would
   be
very valuable for Tapestry popularity (in particular in France).
   
We think it is a fantastic technology and would love to share and
   contribute
to its popularity.
   
Please, let us know what we need to do to be referenced.
   
Regards,
   
Erwan
--
View this message in context:
  
 
 http://tapestry-users.832.n2.nabble.com/Who-uses-Tapestry-eOfficeo-tp5966218p5966218.htmlhttp://tapestry-users.832.n2.nabble.com/Who-uses-Tapestry-eOfficeo-tp5966218p5966218.html?by-user=t
  
 
 http://tapestry-users.832.n2.nabble.com/Who-uses-Tapestry-eOfficeo-tp5966218p5966218.html?by-user=thttp://tapestry-users.832.n2.nabble.com/Who-uses-Tapestry-eOfficeo-tp5966218p5966218.html?by-user=tby-user=t

  
Sent from the Tapestry Users mailing list archive at Nabble.com.
   
-

To unsubscribe, e-mail: [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5967276i=1
For additional commands, e-mail: [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5967276i=2
   
   
  
  
  
   --
   Howard M. Lewis Ship
  
   Creator of Apache Tapestry
  
   The source for Tapestry training, mentoring and support. Contact me to
   learn how I can get you up and productive in Tapestry fast!
  
   (971) 678-5210
   http://howardlewisship.com
  
  
   -
   To unsubscribe, e-mail: [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5967276i=3
   For additional commands, e-mail: [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5967276i=4
  
  
  
   --
If you reply to this email, your message will be added to the
 discussion
   below:
  
  
 
 http://tapestry-users.832.n2.nabble.com/Who-uses-Tapestry-eOfficeo-tp5966218p5967276.htmlhttp://tapestry-users.832.n2.nabble.com/Who-uses-Tapestry-eOfficeo-tp5966218p5967276.html?by-user=t
To start a new topic under Tapestry Users, email
   [hidden email] 
   http://user/SendEmail.jtp?type=nodenode=5987708i=5[hidden
 email] http://user/SendEmail.jtp?type=nodenode=5987708i=6
  [hidden email] 
  http://user/SendEmail.jtp?type=nodenode=5987708i=7[hidden
 email] http://user/SendEmail.jtp?type=nodenode=5987708i=8
  
   To unsubscribe from Tapestry Users, click here
 
 

t5: adding http header

2011-02-03 Thread Angelo C.

Hi,

I need to add some http headers into response, like 
Access-Control-Allow-Origin: *, how to achieve this? Thanks,

Angelo
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t5-adding-http-header-tp3369097p3369097.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: t5: adding http header

2011-02-03 Thread Thiago H. de Paula Figueiredo
On Thu, 03 Feb 2011 09:10:11 -0200, Angelo C. angelochen...@gmail.com  
wrote:



Hi,


Hi!


I need to add some http headers into response, like
Access-Control-Allow-Origin: *, how to achieve this? Thanks,


The better way depends on which pages do you want to do this. If it's all,  
create a RequestFilter and use the Response's setHeader(String name,  
String value) method. If it's just one, @Inject Response and use the same  
method.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Tapestry 4.1 injecting the wrong application state object

2011-02-03 Thread Ivano Luberti
In our case we were lucky enough that we can ask user to change language
only on a given page.
So the solution we adopted was to duplicate that page and to have
listeners for changing language that where pointing to the other page.
This because the language is changed only when page is rendered:

http://tapestry.apache.org/tapestry4.1/usersguide/localization.html

So you have pageA with a link changeLanguageLink pointing to listener

public pageB changeLanguage(String locale){
this.getRequestCycle().getEngine().setLocale(new Locale(locale));
return getPageB();
};

Conversely you have a similar link in pageB returning pageA.

Hope this helps


Il 03/02/2011 9.01, Howard Lewis Ship ha scritto:
 Well, the idea in Tapestry has ever been that the locale for a page is
 fixed, once determined, and it's hard to say what the effect of your
 change would be ... but good detective work getting this far.

 I don't currently remember where in Tapestry 4.1 the determination of
 client locale is made; when I have some time, I'll try and look in the
 code and see what turns up.

 On Wed, Feb 2, 2011 at 6:28 AM, Pepijn Schmitz capt...@chaos.demon.nl wrote:
 Hi Howard,

 Further to my last message, I just discovered that I was making a faulty
 assumption. When the pages are checked out of the pool, the engine locale is
 used to build the page key, but when they are released to the pool, the
 *page* locale is used! So overriding getLocale() on the page is indeed
 causing problems.

 Can you tell me what the correct way of doing this is? Apart from wanting to
 give the users the ability to configure their language in their user
 settings in our application, it is also problematic that the locale that the
 browser provides is often missing the country, and Java often does not use
 correct date, time and number formats if the locale does not include the
 country.

 And do you have any idea if this could also the root cause of my original
 problem? I don't really see how, since all this means as far as I can tell
 is that Tapestry will needlessly instantiate pages, but I still don't see
 how a page which still contains values from one session can end up on
 another session.

 Kind regards,
 Pepijn Schmitz

 On 26-01-11 21:40, Howard Lewis Ship wrote:
 It isn't familiar to me.  Once possible way things could go awry would
 be for you to keep a reference to some page as a property of some
 other page ... that can result in data moving into and out of the page
 without Tapestry's normal lifecycle to initialize it and clean it out.
 I'd look along those lines.

 On Wed, Jan 26, 2011 at 3:21 AM, Pepijn Schmitzcapt...@chaos.demon.nl
  wrote:
 No, not yet! :-(

 Anyone else have any idea?

 In short: my Page objects occasionally get the wrong application state
 object injected by Tapestry 4.1!

 I've been looking into it, but it's very hard to see what's going on with
 all the synthetic classes created by Hivemind. But one clue I got by
 making
 a heap dump and analysing it: all application state objects (of closed
 sessions) were still in memory, with references from Page classes in a
 TapestryKeyedObjectPool!

 I'm pretty sure the Page properties are supposed to be cleaned out at the
 end of a request cycle, when the page is returned to the pool, but
 apparently for some reason that is not happening! Is this a familiar
 problem
 to anyone?

 Kind regards,
 Pepijn Schmitz

 On 25-01-11 11:59, Koka Kiknadze wrote:
 Did you find root of the problem? Just curious :)

 Good luck


 On Tue, Jan 11, 2011 at 11:00 PM, Pepijn
 Schmitzcapt...@chaos.demon.nlwrote:

 Hi,

 Thanks! But I don't think that's it. We're already using HTTPS, but
 also
 that would not explain how the correct application state object can be
 on
 the HttpSession, even though Tapestry injected the wrong one...

 We are using Apache 2 using mod_proxy as a front-end though. Apache
 takes
 care of the SSL and forwards the requests to Glassfish over HTTP. I'll
 look
 into the possibility that something is going wrong there, although it
 seems
 unlikely due to the above reason...

 Cheers,
 Pepijn


 On 11-01-11 19:04, Koka Kiknadze wrote:

 I did have exactly similar problem couple of years ago - JSF app
 worked
 fine
 from intranet, but messed up user sessions when accessed from WAN
 side.

 So initial suspect was the squid proxy configuration of our ISP. The
 problem
 disappeared as soon as we turned encryption on for the whole site (so
 that
 proxy could not mess things up). Well, as the performance was
 acceptable
 even with HTTPS we just left everything as is.

 Hence I'd suggest temporarily requiring HTTPS for the whole site and
 if
 the
 problem disappears, you'll know for sure it's not your application or
 tapestry to be blamed.

 Good luck.




 On Tue, Jan 11, 2011 at 8:37 PM, Pepijn
 Schmitztapes...@chaos.demon.nl
 wrote:
  Hi everyone,
 I'm having a bizarre problem with Tapestry, and I'm hoping someone
 here
 might be able to point me to a solution. 

Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread m...@raibledesigns.com

I'm doing this to solve @Inject in unit tests. If there's a better way to do
it, I'd love to hear about it.

http://source.appfuse.org/browse/appfuse/trunk/web/tapestry/src/test/java/org/appfuse/webapp/pages/BasePageTestCase.java?r=HEAD
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Compiler-error-when-upgrading-from-tapestry-spring-5-0-18-to-5-2-4-tp3368139p3369288.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: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Josh Canfield
I don't use spring but pagetester has a constructor that takes extra
modules. Do you have to construct the modules yourself or can you just pass
SpringModule.class to the constructor?

Alternatively you can add a @SubModule(SpringModule.class) annotation to
your AppModule and not have to worry about it.
On Feb 3, 2011 6:05 AM, m...@raibledesigns.com m...@raibledesigns.com
wrote:

 I'm doing this to solve @Inject in unit tests. If there's a better way to
do
 it, I'd love to hear about it.


http://source.appfuse.org/browse/appfuse/trunk/web/tapestry/src/test/java/org/appfuse/webapp/pages/BasePageTestCase.java?r=HEAD
 --
 View this message in context:
http://tapestry.1045711.n5.nabble.com/Compiler-error-when-upgrading-from-tapestry-spring-5-0-18-to-5-2-4-tp3368139p3369288.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: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Igor Drobiazko
So you want your Spring beans to be injectable in Tapestry pages. RIght?
Instead of using @ContextConfiguration and subclassing your test from
AbstractTransactionalJUnit4SpringContextTests , you can let Tapestry create
the ApplicationContext. There a several posibilities to do that:

1) you can provide contextConfigLocation context parameter in your web.xml
2) alternatively you can create a TestModule in which you contribute an
ApplicationContextCustomizer. See here:

http://code.google.com/p/tapestrybook/source/browse/trunk/tapestry-spring/src/main/java/de/t5book/services/AppModule.java

This test module can be passed as 4th parameter into PageTester's
constructor.

On Thu, Feb 3, 2011 at 3:04 PM, m...@raibledesigns.com 
m...@raibledesigns.com wrote:


 I'm doing this to solve @Inject in unit tests. If there's a better way to
 do
 it, I'd love to hear about it.


 http://source.appfuse.org/browse/appfuse/trunk/web/tapestry/src/test/java/org/appfuse/webapp/pages/BasePageTestCase.java?r=HEAD
 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/Compiler-error-when-upgrading-from-tapestry-spring-5-0-18-to-5-2-4-tp3368139p3369288.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




-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Werner Keil
At least in 5.2, is @Inject already coming from the JSR/CDI?

On Thu, Feb 3, 2011 at 7:34 PM, m...@raibledesigns.com 
m...@raibledesigns.com wrote:


 I'm doing this to solve @Inject in unit tests. If there's a better way to
 do
 it, I'd love to hear about it.


 http://source.appfuse.org/browse/appfuse/trunk/web/tapestry/src/test/java/org/appfuse/webapp/pages/BasePageTestCase.java?r=HEAD
 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/Compiler-error-when-upgrading-from-tapestry-spring-5-0-18-to-5-2-4-tp3368139p3369288.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




-- 

Werner Keil | UOMo Lead | Eclipse Foundation | Agile Coach, Principal
Consultant | *emergn* limited

590 Madison Avenue. New York. NY 10022 | 68 Lombard Street. London EC3V 9LJ
UK

US Toll Free:  +1-877.964.1981 | Worldwide Toll Free:  +800.225.53482
Skype: werner.keil|www.emergn.com | Reshaping IT

* STP Conference  Expo: March 24, 2011, Nashville, TN. Werner Keil, Agile
Coach and Principal Consultant, will be presenting Agile Test Automation


Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Howard Lewis Ship
A little context:

In 5.2, the Spring support was reworked a little bit, based on user
feedback.   The primary change is that Spring beans are no longer
exposed as Tapestry service BUT they are still injectable (by type).
There's also a compatibility mode that continues to attempt to expose
Spring beans as Tapestry IoC services.

The intent is that users will configure Spring as they did prior to
using Tapestry, using web.xml entries. However, the API expects a
ServletContext, which you might have to mock up to make use of the new
code.

However, as a short term fix, you can continue to use the 5.1.0.5
version of tapestry-spring, even if the rest of Tapestry is at version
5.2.4.

On Wed, Feb 2, 2011 at 9:17 AM, m...@raibledesigns.com
m...@raibledesigns.com wrote:

 I'm trying to upgrade my project from tapestry-spring 5.0.18 to 5.2.4. I have
 the following in a test class:

 @ContextConfiguration(locations = {
        classpath:/applicationContext-resources.xml,
 classpath:/applicationContext-dao.xml,
        classpath:/applicationContext-service.xml,
 classpath*:/applicationContext.xml,
        /WEB-INF/applicationContext*.xml})
 public abstract class BasePageTestCase extends
 AbstractTransactionalJUnit4SpringContextTests {
    protected PageTester tester;

    @Before
    public void before() {
        String appPackage = org.appfuse.webapp;
        String appName = app;
        tester = new PageTester(appPackage, appName, src/main/webapp) {
            @Override
            protected ModuleDef[] provideExtraModuleDefs() {
                return new ModuleDef[]{new
 SpringModuleDef(applicationContext)};
            }
        };

 However, it looks like SpringModuleDef no longer takes an
 ApplicationContext. What's the new way to do this?

 [ERROR] symbol  : constructor
 SpringModuleDef(org.springframework.context.ApplicationContext)
 [ERROR] location: class org.apache.tapestry5.internal.spring.SpringModuleDef

 Thanks,

 Matt
 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Compiler-error-when-upgrading-from-tapestry-spring-5-0-18-to-5-2-4-tp3368139p3368139.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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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

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



Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread m...@raibledesigns.com

I tried changing my base test class to use a ServletContext instead:

final MockServletContext servletContext = new
MockServletContext();
servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM,
classpath:/applicationContext-resources.xml,
classpath:/applicationContext-dao.xml,  +
classpath:/applicationContext-service.xml,
classpath*:/applicationContext.xml,  +
/WEB-INF/applicationContext*.xml);

tester = new PageTester(appPackage, appName, src/main/webapp) {
@Override
protected ModuleDef[] provideExtraModuleDefs() {
return new ModuleDef[]{new SpringModuleDef(servletContext)};
}
};

No dice though. The error is below. 

I also tried created a TestModule as Igor recommended, but had a similar
issue.

public class TestModule {
public void
contributeApplicationContextCustomizer(OrderedConfigurationApplicationContextCustomizer
config) {
ApplicationContextCustomizer customizer = new
ApplicationContextCustomizer() {
public void customizeApplicationContext(ServletContext
servletContext,
   
ConfigurableWebApplicationContext appContext) {
   
appContext.setConfigLocation(classpath:/applicationContext-resources.xml, 
+
classpath:/applicationContext-dao.xml,
classpath:/applicationContext-service.xml,  +
classpath*:/applicationContext.xml,
/WEB-INF/applicationContext*.xml);
}
};
config.add(MyApplicationContextCustomizer, customizer);
}
}


Running org.appfuse.webapp.pages.UserEditTest
ERROR [main] Registry.log(108) | Error obtaining injected value for field
org.appfuse.webapp.pages.admin.UserList.userManager: No service implements
the interface org.appfuse.service.UserManager.
ERROR [main] Registry.log(109) | Operations trace:
ERROR [main] Registry.log(118) | [ 1] Constructing instance of page class
org.appfuse.webapp.pages.admin.UserList
ERROR [main] Registry.log(118) | [ 2] Creating ComponentAssembler for
org.appfuse.webapp.pages.admin.UserList
ERROR [main] Registry.log(118) | [ 3] Transforming component class
org.appfuse.webapp.pages.admin.UserList
ERROR [main] Registry.log(118) | [ 4] Injecting field userManager
ERROR [main] RequestExceptionHandler.handleRequestException(63) | Processing
of request failed with uncaught exception: java.lang.ClassNotFoundException:
caught an exception while obtaining a class file for
org.appfuse.webapp.pages.admin.UserList
java.lang.RuntimeException: java.lang.ClassNotFoundException: caught an
exception while obtaining a class file for
org.appfuse.webapp.pages.admin.UserList
at
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:309)
at
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl.getInstantiator(ComponentInstantiatorSourceImpl.java:285)
at
$ComponentInstantiatorSource_12dec96c460.getInstantiator($ComponentInstantiatorSource_12dec96c460.java)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:222)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl$4.invoke(PageLoaderImpl.java:219)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl.createAssembler(PageLoaderImpl.java:218)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl.getAssembler(PageLoaderImpl.java:208)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:180)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl$3.invoke(PageLoaderImpl.java:174)
at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
at
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:68)
at
org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1063)
at
org.apache.tapestry5.internal.pageload.PageLoaderImpl.loadPage(PageLoaderImpl.java:173)
at $PageLoader_12dec96c47b.loadPage($PageLoader_12dec96c47b.java)
at
org.apache.tapestry5.internal.services.PageSourceImpl.getPage(PageSourceImpl.java:81)
at $PageSource_12dec96c47a.getPage($PageSource_12dec96c47a.java)
at
org.apache.tapestry5.internal.services.NonPoolingRequestPageCacheImpl.get(NonPoolingRequestPageCacheImpl.java:74)
at
$RequestPageCache_12dec96c479.get($RequestPageCache_12dec96c479.java)
at

Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Thiago H. de Paula Figueiredo
On Thu, 03 Feb 2011 14:22:45 -0200, Werner Keil werner.k...@gmail.com  
wrote:



At least in 5.2, is @Inject already coming from the JSR/CDI?


The support for the JSR 330 annotations is already in the Tapestry-IoC  
trunk and the latest snapshot. I guess it'll be included in the next  
release. CDI is another beast . . .


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Thiago H. de Paula Figueiredo
On Thu, 03 Feb 2011 15:34:23 -0200, m...@raibledesigns.com  
m...@raibledesigns.com wrote:


Caused by: java.lang.RuntimeException: No service implements the  
interface org.appfuse.service.UserManager.


There's no configured UserManager service in your setup. Is it a Tapestry  
or Spring-created bean?


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Compiler error when upgrading from tapestry-spring 5.0.18 to 5.2.4

2011-02-03 Thread Werner Keil
So 5.2.x or 5.3 should have JSR 330?

Don't worry about CDI, getting more synergies out of that for Java EE I aim
at helping some of the other frameworks (from Matt's survey[?]) first and
foremost JSF, since it is official part of the JCP like those JSRs, too.

Where applicable, all interested EE frameworks should get involved with EE7
at an early stage. Early enough to tame the beast before it grows too big
for that [?]


RE: t5: adding http header

2011-02-03 Thread Wechsung, Wulf
Hello Angelo,

best use a request Filter. For example:

public class IEStandardModeHeader implements RequestFilter {


private static final String HEADER_KEY = X-UA-Compatible;

@Override
public boolean service(Request request, Response response,
RequestHandler handler) throws IOException {

response.setHeader(HEADER_KEY, IE=8);
return handler.service(request, response);   

}

}

To activate the filter you need to contribute it in AppModule:

public static void contributeRequestHandler(
OrderedConfigurationRequestFilter configuration) {
Configuration.add(...);
}


Hope this helps!

Kind Regards,
Wulf

-Original Message-
From: Angelo C. [mailto:angelochen...@gmail.com] 
Sent: Donnerstag, 3. Februar 2011 12:10
To: users@tapestry.apache.org
Subject: t5: adding http header


Hi,

I need to add some http headers into response, like 
Access-Control-Allow-Origin: *, how to achieve this? Thanks,

Angelo
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/t5-adding-http-header-tp3369097p3369097.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



Fast name-value pair persistent storage?

2011-02-03 Thread Kalle Korhonen
I have yet another tapestry-security add-on module in the works, this
time for remember me. For context, read
http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/
(and re-read until you agree that's the best way) for doing
authenticating remember me while minimizing other security
implications. I've been using different variations of the same concept
for years in my web applications.

However, hat's not the subject of the email. For the purposes of the
module, I need to store simple name-value pairs (principal, token)
persistently. Currently, I'm using a simple JPA/Hibernate
ExpiringRollingToken entity and that works fine (and I really love
that its so simple with Tapestry to contribute additional persistent
entities not part of the application model) but to make the module
truly generic, I'm thinking it might be better to use a separate,
overridable persistence model for this. After all, we are just talking
about name-value pairs here and obviously it also needs to be fast
since rememberMe can typically be invoked as part of any request.

Memcached is pretty popular these days. I'm currently evaluating
http://code.google.com/p/jmemcache-daemon and I like that it allows
in-process access to the cache, thereby making it suitable for
embedding but also allowing to scale out as needed. Does anybody have
experience on this particular implementation and/or any other
contenders that you'd suggest checking out?

Kalle

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



T5: getting json value in tml

2011-02-03 Thread Angelo C.

Hi,

How to get the value of a json object in tml file, following does not work:

in page class:

public JSONObject getJS() {
   JSONObject js = new JSONObject();
   js.put(name1,123);
   return js;
}


in the tmp, 

 ${js} // this shows key/value pair
 ${js.name1}  // does not show anything

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-getting-json-value-in-tml-tp3370385p3370385.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