You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephen Robinson <ro...@yellowpen.com> on 2005/01/23 00:28:41 UTC

disable-caching causes problems with persistent="yes"

Hi Everyone,

I've bought the book and worked through all the examples (and many 
others online) I've invested a lot of time trying to learn tapestry but 
can't get beyond one major issue for me. I've used Howard's 'ant' auto 
update deployment scripts (using eclipse and spindle) but whenever I 
change any tiny aspect of my app I'm forced to relogin and navigate back 
to the changed page - pain for each minor change in development.

I thought that setting tomcat's "disable-caching" would be the solution 
after pointing the server config to something like <Context path="/crud" 
docBase="C:\java\eclipse\workspace_tapestry\crud\src\webapp" 
reloadable="true" />, however I then get another problem - 
<property-specification...persistent="yes"/> stops working and hence so 
does my app that uses the persistent properties feature.

Is there a way to...
1) work around the persistent="yes" by storing these parameters 
explicitly to the visit class? (you hint at this in the book on page 308 
section 7.7 "Although it is possible to implement persistent properties 
yourself, there's no reason to do so")
2) Have you used "disable-caching" for development and noted that is 
causes problems with persistent="yes" on tomcat?

I've done a lot of searching and testing on this one and just seem to be 
stumped, *any* insight that you might have on this would be greatly 
appreciated - thanks again,

Best regards,

Steve Robinson


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


Re: disable-caching causes problems with persistent="yes"

Posted by Jamie Orchard-Hays <ja...@dang.com>.
Steve, I'm very glad that we were able to give you a shot in the arm to  
hang in there. Kudos for persisting and thanks for the info, as well.

One thing I noted in your email is that you had differences with your  
non-persistent properties between caching on and caching off. This  
indicates to me that you aren't handling those page properties  
correctly somehow. Are you declaring all of the properties in the .page  
file and then using abstract getters/setters in the java class? That's  
the preferred way of using page properties because they will be  
properly initialized when retrieved and returned to the page pool. If  
you are using standard bean-style properties on the java class (private  
field, public getters/setters) then you have to override the  
initialize() method in the class and set those properties (usually) to  
null there.

BTW, have you considered upgrading to the latest Tomcat? It's a lot  
faster. And Jetty is wonderful.

As to my memory, well Erik's right! I have really crappy memory. LOL.

Welcome aboard,

Jamie

On Jan 23, 2005, at 11:36 AM, Stephen Robinson wrote:

> Firstly, thanks to both Jamie and Erik for your considered and  
> informative replies,
>
> I arrived at Tapestry from Struts and before that from Microsoft  
> developments - probably like you all, looking to live my development  
> life in a more eutopian programming environment. But, I must admit,  
> before Jamie's email I was beginning to loose faith and nearly headed  
> back to the Struts world. I think I've fixed the problem I had (fueled  
> by both your enthusiastic responses) and if nothing else, I'd like to  
> give back to the community the message that it's worth persisting with  
> learning Tapestry - knowing two frameworks broadens the mind and rests  
> the need to want to switch again!
>
> I've been learning using a mix of the following (picked mostly because  
> it's free and mainstream):
> 1) My Development Environment - that I grew to love from Struts work -  
> except for Tapestry of course :)
> - Tapestry 3.0.1
> - Eclipse 3.0
> - Sysdeo Tomcat Plugin for eclipse
> - Tomcat 4.1.31
> - Hibernate (& Spring now that I've found out about it - nice)
>
> 1) Tapestry in Action - using the downloadable source with ToDo1 -  
> ToDo4
> - Very good to start off but uses 'deploy.xml' ant scripts to generate  
> and update tomcat
> - Problem was that each tiny change forced a redeploy of the web  
> application
> - I did get a copy cat version of the tutorial code working and I was  
> initially pretty happy
>
> 2) Sandcast's CRUD Tutorial  
> (http://www.sandcastsoftware.com/articlesandtutorials/brownbag/ 
> index.html)
> - It's good to see a different style of development that uses other  
> facets of the framework
> - Specifically informative about using a 'Global' object
> - Most illustrative example that I've seen showing the object oriented  
> nature of Tapestry (setup pages and properties then activate them -  
> nice)
>
> 3) Tapestry Tutorial  
> (http://www2.cpttm.org.mo/cyberlab/softdev/tapestry/tutorial1/ 
> GettingStartedWithTapestry.html)
> - This give me insight into how to set up the disable-caching with a  
> direct reference to my development directories
> - FYI this works if you have the libs in the shared directory and not  
> in your local application.
> - However when I set it up my application it stopped working :(
> - I was loosing faith because I worried that this might be a show  
> stopper and a little worried about the lack of Unit testing (this was  
> going to be my give up excuse).
>
> After both your "pick me up emails", I worked on and found that the  
> parameters that I'd explicitly stated as persistent="yes" were being  
> correctly persistent, however other parameters that my code relied on  
> were now not persistent (which must not have been the case with the  
> disable-cache="false"). Specifically trying to access the method  
> equals() on a String object that was null (wha whaaaa - my fault) -  
> sorry I know I should have been checking for null and reporting this  
> using log4j - but heck we all know what it's like playing around  
> prototyping ;)
>
> I'd still love to know if there are any ways of testing a Tapestry web  
> application using Unit testing. I mostly develop business applications  
> and therefore love the JUnit testing functions on the user interface.  
> Sure they are not that great, but isn't it great to run a days  
> acceptance testing in 30 seconds - from my painful MS time I still  
> can't get over that.
>
> So thanks again and I hope that this long email helps others out.
>
> Best regards,
>
> Steve Robinson
>
>
> Erik Hatcher wrote:
>
>> The re-login issue sounds more like a Tomcat redeployment issue to  
>> me.  If you're recompiling classes to redeploy and Tomcat is  
>> restarting the application context, then it makes sense you have to  
>> re-login.  Tomcat, though, can persist sessions to the filesystem so  
>> that they survive a restart - so maybe you can tweak Tomcat a bit  
>> more and get the re-login issue solved?
>>
>> If you're using Eclipse and Spindle, there is no need to use Ant  
>> (*gasp*!) for development (unless you're doing some other type of  
>> code generation steps or something like that).  I personally use, and  
>> strongly recommend, Jetty as a web container.  JettyLauncher plugin  
>> works great.  With Tapestry caching disabled, I'm able to change  
>> .page/.jwc/.html files while Jetty is running and have those changes  
>> immediately visible.  Changes to .java, however, require a Jetty  
>> restart (though I wish there was a hot deployment of .class changes  
>> available with JettyLauncher... *nudge nudge*).
>>
>> As for persistent properties and Tapestry disable caching on - how  
>> short Jamie's memory is! - we encountered this early on in our  
>> Tapestry development and it points out an underlying problem with how  
>> you've set up the properties and your Java code.  Post some specifics  
>> of a .html/.page/.java combination where you see this problem so we  
>> can work through it.
>>
>>     Erik
>>
>>
>> On Jan 22, 2005, at 7:22 PM, Jamie Orchard-Hays wrote:
>>
>>> A lot of us disable caching without this sort of problem. I'm  
>>> unfamiliar with the ant auto update, but I'd start there.
>>>
>>> Secondly, in a year and a half + of Tapestry development, I've never  
>>> had disabled caching affect persistent="yes" negatively.
>>>
>>> I'm sorry not to have more specifics for your problem, but maybe  
>>> that info will help get you going.
>>>
>>> Jamie
>>>
>>> On Jan 22, 2005, at 6:28 PM, Stephen Robinson wrote:
>>>
>>>> Hi Everyone,
>>>>
>>>> I've bought the book and worked through all the examples (and many  
>>>> others online) I've invested a lot of time trying to learn tapestry  
>>>> but can't get beyond one major issue for me. I've used Howard's  
>>>> 'ant' auto update deployment scripts (using eclipse and spindle)  
>>>> but whenever I change any tiny aspect of my app I'm forced to  
>>>> relogin and navigate back to the changed page - pain for each minor  
>>>> change in development.
>>>>
>>>> I thought that setting tomcat's "disable-caching" would be the  
>>>> solution after pointing the server config to something like  
>>>> <Context path="/crud"  
>>>> docBase="C:\java\eclipse\workspace_tapestry\crud\src\webapp"  
>>>> reloadable="true" />, however I then get another problem -  
>>>> <property-specification...persistent="yes"/> stops working and  
>>>> hence so does my app that uses the persistent properties feature.
>>>>
>>>> Is there a way to...
>>>> 1) work around the persistent="yes" by storing these parameters  
>>>> explicitly to the visit class? (you hint at this in the book on  
>>>> page 308 section 7.7 "Although it is possible to implement  
>>>> persistent properties yourself, there's no reason to do so")
>>>> 2) Have you used "disable-caching" for development and noted that  
>>>> is causes problems with persistent="yes" on tomcat?
>>>>
>>>> I've done a lot of searching and testing on this one and just seem  
>>>> to be stumped, *any* insight that you might have on this would be  
>>>> greatly appreciated - thanks again,
>>>>
>>>> Best regards,
>>>>
>>>> Steve Robinson
>>>>
>>>>
>>>> -------------------------------------------------------------------- 
>>>> -
>>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:  
>>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:  
>>> tapestry-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>> .
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: disable-caching causes problems with persistent="yes"

Posted by Stephen Robinson <ro...@yellowpen.com>.
Firstly, thanks to both Jamie and Erik for your considered and 
informative replies,

I arrived at Tapestry from Struts and before that from Microsoft 
developments - probably like you all, looking to live my development 
life in a more eutopian programming environment. But, I must admit, 
before Jamie's email I was beginning to loose faith and nearly headed 
back to the Struts world. I think I've fixed the problem I had (fueled 
by both your enthusiastic responses) and if nothing else, I'd like to 
give back to the community the message that it's worth persisting with 
learning Tapestry - knowing two frameworks broadens the mind and rests 
the need to want to switch again!

I've been learning using a mix of the following (picked mostly because 
it's free and mainstream):
1) My Development Environment - that I grew to love from Struts work - 
except for Tapestry of course :)
 - Tapestry 3.0.1
 - Eclipse 3.0
 - Sysdeo Tomcat Plugin for eclipse
 - Tomcat 4.1.31
 - Hibernate (& Spring now that I've found out about it - nice)

1) Tapestry in Action - using the downloadable source with ToDo1 - ToDo4
 - Very good to start off but uses 'deploy.xml' ant scripts to generate 
and update tomcat
 - Problem was that each tiny change forced a redeploy of the web 
application
 - I did get a copy cat version of the tutorial code working and I was 
initially pretty happy

2) Sandcast's CRUD Tutorial 
(http://www.sandcastsoftware.com/articlesandtutorials/brownbag/index.html)
 - It's good to see a different style of development that uses other 
facets of the framework
 - Specifically informative about using a 'Global' object
 - Most illustrative example that I've seen showing the object oriented 
nature of Tapestry (setup pages and properties then activate them - nice)

3) Tapestry Tutorial 
(http://www2.cpttm.org.mo/cyberlab/softdev/tapestry/tutorial1/GettingStartedWithTapestry.html)
 - This give me insight into how to set up the disable-caching with a 
direct reference to my development directories
 - FYI this works if you have the libs in the shared directory and not 
in your local application.
 - However when I set it up my application it stopped working :(
 - I was loosing faith because I worried that this might be a show 
stopper and a little worried about the lack of Unit testing (this was 
going to be my give up excuse).

After both your "pick me up emails", I worked on and found that the 
parameters that I'd explicitly stated as persistent="yes" were being 
correctly persistent, however other parameters that my code relied on 
were now not persistent (which must not have been the case with the 
disable-cache="false"). Specifically trying to access the method 
equals() on a String object that was null (wha whaaaa - my fault) - 
sorry I know I should have been checking for null and reporting this 
using log4j - but heck we all know what it's like playing around 
prototyping ;)

I'd still love to know if there are any ways of testing a Tapestry web 
application using Unit testing. I mostly develop business applications 
and therefore love the JUnit testing functions on the user interface. 
Sure they are not that great, but isn't it great to run a days 
acceptance testing in 30 seconds - from my painful MS time I still can't 
get over that.

So thanks again and I hope that this long email helps others out.

Best regards,

Steve Robinson


Erik Hatcher wrote:

> The re-login issue sounds more like a Tomcat redeployment issue to 
> me.  If you're recompiling classes to redeploy and Tomcat is 
> restarting the application context, then it makes sense you have to 
> re-login.  Tomcat, though, can persist sessions to the filesystem so 
> that they survive a restart - so maybe you can tweak Tomcat a bit more 
> and get the re-login issue solved?
>
> If you're using Eclipse and Spindle, there is no need to use Ant 
> (*gasp*!) for development (unless you're doing some other type of code 
> generation steps or something like that).  I personally use, and 
> strongly recommend, Jetty as a web container.  JettyLauncher plugin 
> works great.  With Tapestry caching disabled, I'm able to change 
> .page/.jwc/.html files while Jetty is running and have those changes 
> immediately visible.  Changes to .java, however, require a Jetty 
> restart (though I wish there was a hot deployment of .class changes 
> available with JettyLauncher... *nudge nudge*).
>
> As for persistent properties and Tapestry disable caching on - how 
> short Jamie's memory is! - we encountered this early on in our 
> Tapestry development and it points out an underlying problem with how 
> you've set up the properties and your Java code.  Post some specifics 
> of a .html/.page/.java combination where you see this problem so we 
> can work through it.
>
>     Erik
>
>
> On Jan 22, 2005, at 7:22 PM, Jamie Orchard-Hays wrote:
>
>> A lot of us disable caching without this sort of problem. I'm 
>> unfamiliar with the ant auto update, but I'd start there.
>>
>> Secondly, in a year and a half + of Tapestry development, I've never 
>> had disabled caching affect persistent="yes" negatively.
>>
>> I'm sorry not to have more specifics for your problem, but maybe that 
>> info will help get you going.
>>
>> Jamie
>>
>> On Jan 22, 2005, at 6:28 PM, Stephen Robinson wrote:
>>
>>> Hi Everyone,
>>>
>>> I've bought the book and worked through all the examples (and many 
>>> others online) I've invested a lot of time trying to learn tapestry 
>>> but can't get beyond one major issue for me. I've used Howard's 
>>> 'ant' auto update deployment scripts (using eclipse and spindle) but 
>>> whenever I change any tiny aspect of my app I'm forced to relogin 
>>> and navigate back to the changed page - pain for each minor change 
>>> in development.
>>>
>>> I thought that setting tomcat's "disable-caching" would be the 
>>> solution after pointing the server config to something like <Context 
>>> path="/crud" 
>>> docBase="C:\java\eclipse\workspace_tapestry\crud\src\webapp" 
>>> reloadable="true" />, however I then get another problem - 
>>> <property-specification...persistent="yes"/> stops working and hence 
>>> so does my app that uses the persistent properties feature.
>>>
>>> Is there a way to...
>>> 1) work around the persistent="yes" by storing these parameters 
>>> explicitly to the visit class? (you hint at this in the book on page 
>>> 308 section 7.7 "Although it is possible to implement persistent 
>>> properties yourself, there's no reason to do so")
>>> 2) Have you used "disable-caching" for development and noted that is 
>>> causes problems with persistent="yes" on tomcat?
>>>
>>> I've done a lot of searching and testing on this one and just seem 
>>> to be stumped, *any* insight that you might have on this would be 
>>> greatly appreciated - thanks again,
>>>
>>> Best regards,
>>>
>>> Steve Robinson
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> .
>


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


Re: disable-caching causes problems with persistent="yes"

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
The re-login issue sounds more like a Tomcat redeployment issue to me.  
If you're recompiling classes to redeploy and Tomcat is restarting the 
application context, then it makes sense you have to re-login.  Tomcat, 
though, can persist sessions to the filesystem so that they survive a 
restart - so maybe you can tweak Tomcat a bit more and get the re-login 
issue solved?

If you're using Eclipse and Spindle, there is no need to use Ant 
(*gasp*!) for development (unless you're doing some other type of code 
generation steps or something like that).  I personally use, and 
strongly recommend, Jetty as a web container.  JettyLauncher plugin 
works great.  With Tapestry caching disabled, I'm able to change 
.page/.jwc/.html files while Jetty is running and have those changes 
immediately visible.  Changes to .java, however, require a Jetty 
restart (though I wish there was a hot deployment of .class changes 
available with JettyLauncher... *nudge nudge*).

As for persistent properties and Tapestry disable caching on - how 
short Jamie's memory is! - we encountered this early on in our Tapestry 
development and it points out an underlying problem with how you've set 
up the properties and your Java code.  Post some specifics of a 
.html/.page/.java combination where you see this problem so we can work 
through it.

	Erik


On Jan 22, 2005, at 7:22 PM, Jamie Orchard-Hays wrote:

> A lot of us disable caching without this sort of problem. I'm 
> unfamiliar with the ant auto update, but I'd start there.
>
> Secondly, in a year and a half + of Tapestry development, I've never 
> had disabled caching affect persistent="yes" negatively.
>
> I'm sorry not to have more specifics for your problem, but maybe that 
> info will help get you going.
>
> Jamie
>
> On Jan 22, 2005, at 6:28 PM, Stephen Robinson wrote:
>
>> Hi Everyone,
>>
>> I've bought the book and worked through all the examples (and many 
>> others online) I've invested a lot of time trying to learn tapestry 
>> but can't get beyond one major issue for me. I've used Howard's 'ant' 
>> auto update deployment scripts (using eclipse and spindle) but 
>> whenever I change any tiny aspect of my app I'm forced to relogin and 
>> navigate back to the changed page - pain for each minor change in 
>> development.
>>
>> I thought that setting tomcat's "disable-caching" would be the 
>> solution after pointing the server config to something like <Context 
>> path="/crud" 
>> docBase="C:\java\eclipse\workspace_tapestry\crud\src\webapp" 
>> reloadable="true" />, however I then get another problem - 
>> <property-specification...persistent="yes"/> stops working and hence 
>> so does my app that uses the persistent properties feature.
>>
>> Is there a way to...
>> 1) work around the persistent="yes" by storing these parameters 
>> explicitly to the visit class? (you hint at this in the book on page 
>> 308 section 7.7 "Although it is possible to implement persistent 
>> properties yourself, there's no reason to do so")
>> 2) Have you used "disable-caching" for development and noted that is 
>> causes problems with persistent="yes" on tomcat?
>>
>> I've done a lot of searching and testing on this one and just seem to 
>> be stumped, *any* insight that you might have on this would be 
>> greatly appreciated - thanks again,
>>
>> Best regards,
>>
>> Steve Robinson
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: disable-caching causes problems with persistent="yes"

Posted by Jamie Orchard-Hays <ja...@dang.com>.
A lot of us disable caching without this sort of problem. I'm 
unfamiliar with the ant auto update, but I'd start there.

Secondly, in a year and a half + of Tapestry development, I've never 
had disabled caching affect persistent="yes" negatively.

I'm sorry not to have more specifics for your problem, but maybe that 
info will help get you going.

Jamie

On Jan 22, 2005, at 6:28 PM, Stephen Robinson wrote:

> Hi Everyone,
>
> I've bought the book and worked through all the examples (and many 
> others online) I've invested a lot of time trying to learn tapestry 
> but can't get beyond one major issue for me. I've used Howard's 'ant' 
> auto update deployment scripts (using eclipse and spindle) but 
> whenever I change any tiny aspect of my app I'm forced to relogin and 
> navigate back to the changed page - pain for each minor change in 
> development.
>
> I thought that setting tomcat's "disable-caching" would be the 
> solution after pointing the server config to something like <Context 
> path="/crud" 
> docBase="C:\java\eclipse\workspace_tapestry\crud\src\webapp" 
> reloadable="true" />, however I then get another problem - 
> <property-specification...persistent="yes"/> stops working and hence 
> so does my app that uses the persistent properties feature.
>
> Is there a way to...
> 1) work around the persistent="yes" by storing these parameters 
> explicitly to the visit class? (you hint at this in the book on page 
> 308 section 7.7 "Although it is possible to implement persistent 
> properties yourself, there's no reason to do so")
> 2) Have you used "disable-caching" for development and noted that is 
> causes problems with persistent="yes" on tomcat?
>
> I've done a lot of searching and testing on this one and just seem to 
> be stumped, *any* insight that you might have on this would be greatly 
> appreciated - thanks again,
>
> Best regards,
>
> Steve Robinson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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