Re: Tapestry and Clojure

2012-06-06 Thread Jochen Berger

Am 05.06.2012 19:56, schrieb Howard Lewis Ship:

The code for this is very small, and could easily be ported back to
5.3, for 5.3.4.  Any interest?


Definitely! I already did this and successfully called the doubler fn 
from a 5.3.3 webapps's page. Very useful stuff. ;-)
I think I'm going to like the way this is going. I instantly had the 
idea of being able to pass a t5-func Mapper and a Collection to clojure 
and be able to use partition and pmap to have the mapping done in 
parallel. Awesome! There's still some work to be done to get there, but 
I'm really happy that the first step is taken.


Jochen

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



Re: [t5.3.1] TextField not handling a single space

2012-06-06 Thread Muhammad Gelbana
https://issues.apache.org/jira/browse/TAP5-1948

Thank you.

On Wed, Jun 6, 2012 at 7:51 AM, Muhammad Gelbana m.gelb...@gmail.comwrote:

 Should I open an JIRA issue ?


 On Tue, Jun 5, 2012 at 8:11 PM, Muhammad Gelbana m.gelb...@gmail.comwrote:

 I did so before I sent this mail but I couldn't make use of them !
 I can't see how the NullFieldStrategy can help me and I used
 this FieldTranslator which looked like it would help but it didn't.

 public FieldTranslatorString getTrans() {
 return new FieldTranslatorString() {
 public ClassString getType() {
  return String.class;
 }
 public String parse(String input) throws ValidationException {
  return input;
 }
 public String toClient(String value) {
  return value;
 }
 public void render(MarkupWriter writer) {
  }
 };
 }

 Anyone ?

 On Tue, Jun 5, 2012 at 2:45 PM, Thiago H de Paula Figueiredo 
 thiag...@gmail.com wrote:

 On Tue, 05 Jun 2012 08:42:14 -0300, Muhammad Gelbana 
 m.gelb...@gmail.com wrote:

  Greetings to the developers of the lovely framework, tapestry5


 Hi!


  I wrote a form with a single text field, this field is bound to a string
 object. When I enter a single or multiple spaces in this text field and
 submit the form, the obtained values is always null.


 Check the nulls and translate parameters of TextField in
 http://tapestry.apache.org/**current/apidocs/org/apache/**
 tapestry5/corelib/components/**TextField.htmlhttp://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html
 .

 --
 Thiago H. de Paula Figueiredo




 --
 *Regards,*
 *Muhammad Gelbana
 Java Developer*




 --
 *Regards,*
 *Muhammad Gelbana
 Java Developer*




-- 
*Regards,*
*Muhammad Gelbana
Java Developer*


HowTo break out of a Tapestry loop?

2012-06-06 Thread dp
So, i am trying to break out of tapestry loop here.

This is my -more or less- simplified scenario:

ul
t:loop source=firstSource value=firstValue
li
t:loop source=firstValue value=secondValue
p${secondValue}/p
/t:loop
t:loop source=secondSource value=thirdValue
p${thirdValue}/p
/t:loop
/li
/t:loop
/ul

What I do not want to have is: Tapestry loops through all entries in
firstValue - then loops through all entries in secondSource. I do not want
to iterate through secondSource inside the loop of fristValue as this would
iterate through all entries in secondSource - and I just want to do 1
iteration at a time.

What I want to have is: Tapestry enters the loop for firstValue and does
some printing or whatever, then breaks after the first iteration and jumps
into secondSource to do the first iteration . After it has finished it jumps
back to firstValue and repeats these steps. This is what in Java the
break; would do.

I did not find a clue in the Tapestry documentation on how to do this, nor
in the forums.

But it has to be possible in some way. I can not imagine I am the only one
trying to do this.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HowTo-break-out-of-a-Tapestry-loop-tp5713658.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: HowTo break out of a Tapestry loop?

2012-06-06 Thread Steve Eynon
There is no 'break' in the loop component, but you can wrap your inner
loops in a conditional t:if test=.. component.

Steve.

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



Re: Tapestry-Bootstrap Beta

2012-06-06 Thread Serge Eby
Great job!

I ran it a few minor issues and log tickets in GitHub.

/Serge

--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Tapestry-Bootstrap-Beta-tp7577604p7579924.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



Tapestry output with special characters

2012-06-06 Thread arterzatij
Hi all,

I have a problem with the output of special characters in one of my
pages.

In the properties file I have the following:

code
billing=Lineamientos de facturacioacute;n
/code

But when I load the page I get exactly the same as is on the properties
file, and my expected value would be: 

/
Lineamientos de facturación
/

BTW my files have UTF-8, any suggestions?

I'm missing some configuration?

Thanks in advance!

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-output-with-special-characters-tp5713661.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



a problem about tapestry5's minxins

2012-06-06 Thread yeehuqiu
with tapestry5.3. I have some codes 
eg:
package com.ailk.mapp.tapestry.app.mixins;

import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.annotations.AfterRender;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;

@Import (library=confirm.js)
public class Confirm {

@Parameter(value = Are you sure?, defaultPrefix =
BindingConstants.LITERAL)
private String message;
@Inject
private JavaScriptSupport javaScriptSupport;
@InjectContainer
private ClientElement element;
@AfterRender
public void afterRender() {

System.out.println(confirm--);
javaScriptSupport.addScript(new Confirm('%s', '%s');,
element.getClientId(), message);
}
}

Confirm.java 's path is
/mapp/src/main/java/com/ailk/mapp/tapestry/app/mixins/Confirm.java
and confirm.js's code

var Confirm = Class.create();
Confirm.prototype = {
initialize: function(element, message) {

alert(=confirmjs)
this.message = message;
Event.observe($(element), 'click',
this.doConfirm.bindAsEventListener(this));
},

doConfirm: function(e) {
if(! confirm(this.message))
e.stop();
}
}

confirm.js 's path is
/mapp/src/main/*resources*/com/ailk/mapp/tapestry/app/mixins/confirm.js

when I user them in my page .but it doesn't work .
input t:type=submit value=delete t:mixins=confirm t:message=Are you
sure you want to delete this item?   /.
where is my problem. why it doesn't work? 
thanks in advance!
 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/a-problem-about-tapestry5-s-minxins-tp5713655.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



Tapestry 5.3.4-rc-5

2012-06-06 Thread Howard Lewis Ship
For those that are interested, I just committed some further speed
boosts to Tapestry, and generated a new preview release.

The client who I'm doing this for saw the throughput on their load
test go from 450 req/sec to 2000 req/sec ... what will your
application see?

-- 
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: HowTo break out of a Tapestry loop?

2012-06-06 Thread Thiago H de Paula Figueiredo
On Wed, 06 Jun 2012 11:38:21 -0300, Steve Eynon  
steve.ey...@alienfactory.co.uk wrote:



There is no 'break' in the loop component, but you can wrap your inner
loops in a conditional t:if test=.. component.


Or pass the Loop component a list containing just the elements you do want  
to be rendered.


--
Thiago H. de Paula Figueiredo

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



Re: Tapestry output with special characters

2012-06-06 Thread Thiago H de Paula Figueiredo
On Wed, 06 Jun 2012 13:53:14 -0300, arterzatij arterza...@gmail.com  
wrote:



Hi all,


Hi!



I have a problem with the output of special characters in one of my
pages.

In the properties file I have the following:

code
billing=Lineamientos de facturacioacute;n
/code


You're not supposed to do HTML encoding in properties files. If you want  
to encode something in them, use Java \u encoding instead.


--
Thiago H. de Paula Figueiredo

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



Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Thiago H de Paula Figueiredo
On Wed, 06 Jun 2012 14:32:02 -0300, Howard Lewis Ship hls...@gmail.com  
wrote:



For those that are interested, I just committed some further speed
boosts to Tapestry, and generated a new preview release.

The client who I'm doing this for saw the throughput on their load
test go from 450 req/sec to 2000 req/sec ... what will your
application see?


Wow! Would you like to explain how to you managed to do that? That looks  
like something everybody could learn from. :)


--
Thiago H. de Paula Figueiredo

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



Re: Tapestry output with special characters

2012-06-06 Thread arterzatij
Thanks! I works!



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-output-with-special-characters-tp5713661p5713666.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: high thread contention during load test on InternalComponentResourcesImpl.postRenderCleanup and org.apache.tapestry5.internal.util.NamedSet.getValues

2012-06-06 Thread Howard Lewis Ship
I'm writing up a little blog entry on this. I've also created
5.3.4-rc-5 with even more tweaks.  I'm happy keeping with this
process, even though were past the number of billable hours we agreed
to.

BTW, how much memory in your server?

On Fri, May 11, 2012 at 6:07 AM, Robert Lentz rob...@teksolv.de wrote:
 Hi All,

 we want to rollout a Tapestry app very shortly, but we struggle with
 load testing issues. We are currently load testing on one Tomcat 6.0.32:
 - 500 worker threads, tapestry.production-mode=true
 - Intel(R) Xeon(R) CPU X7460  @ 2.66GHz
 - OpenJDK Runtime Environment (IcedTea6 1.7.10)
 (rhel-1.20.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16,
 mixed mode))
 and 2 loadrunner test clients.

 After ramping up the concurrent requests (about 5min) we reach the
 maximum at about 450req/sec and get server busy errors. We see a high
 thread contention on InternalComponentResourcesImpl.postRenderCleanup
 currently with the Loop component, as there 10 Loop on the Index page.
 Is there a workaround possible without removing the Loop component from
 the page to increase the throughput? The thread dumps series looks like
 this: 1 thread locks 0xe3858990 and over 400 threads are
 waiting. This lock is persistent over a thread dumps series. I guess the
 private synchronized MapString, Object getRenderVariables(boolean
 create) call hits us.

 http-9080-188 daemon prio=10 tid=0x4d463000 nid=0x382a
 runnable [0x55b2f000]
   java.lang.Thread.State: RUNNABLE
    at
 org.apache.tapestry5.internal.transform.ParameterWorker$3$1.getState(ParameterWorker.java:206)
    at
 org.apache.tapestry5.internal.transform.ParameterWorker$3$1.reset(ParameterWorker.java:302)
    at
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.work(InternalComponentResourcesImpl.java:136)
    at
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl$1.work(InternalComponentResourcesImpl.java:133)
    at
 org.apache.tapestry5.internal.util.NamedSet.eachValue(NamedSet.java:171)
    - locked 0xe3858990 (a
 org.apache.tapestry5.internal.util.NamedSet)
    at
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.resetParameterConduits(InternalComponentResourcesImpl.java:546)
    - locked 0xe385c038 (a
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl)
    at
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.postRenderCleanup(InternalComponentResourcesImpl.java:522)
    at
 org.apache.tapestry5.corelib.components.Loop.postRenderCleanup(Loop.java)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl$1.run(ComponentPageElementImpl.java:85)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:956)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$1800(ComponentPageElementImpl.java:61)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl$PostRenderCleanupPhase.render(ComponentPageElementImpl.java:443)
    at
 org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
    at
 org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
    at $PageRenderQueue_135675e1f6b934.render(Unknown Source)
    at $PageRenderQueue_135675e1f6b933.render(Unknown Source)
    at
 org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
 ...
 http-9080-499 daemon prio=10 tid=0x4dffb000 nid=0x3b7d waiting
 for monitor entry [0x69063000]
   java.lang.Thread.State: BLOCKED (on object monitor)
    at
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.getRenderVariables(InternalComponentResourcesImpl.java:476)
    - waiting to lock 0xe385c038 (a
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl)
    at
 org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.postRenderCleanup(InternalComponentResourcesImpl.java:517)
    at
 org.apache.tapestry5.corelib.components.Loop.postRenderCleanup(Loop.java)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl$1.run(ComponentPageElementImpl.java:85)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:956)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$1800(ComponentPageElementImpl.java:61)
    at
 org.apache.tapestry5.internal.structure.ComponentPageElementImpl$PostRenderCleanupPhase.render(ComponentPageElementImpl.java:443)
    at
 org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72)
    at
 org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:124)
    at $PageRenderQueue_135675e1f6b934.render(Unknown Source)
    at $PageRenderQueue_135675e1f6b933.render(Unknown Source)
    at
 

Re: Tapestry and Clojure

2012-06-06 Thread Howard Lewis Ship
Possibilities for the future:

tapestry-clojure might be able to access type hints on the function
and use the TypeCoercer to convert method parameters to the correct
function argument type.

Likewise, it could (and probably should) use the method return type as
a guide to TypeCoerce the function return value into the method return
value.

On Wed, Jun 6, 2012 at 12:02 AM, Jochen Berger foober...@googlemail.com wrote:
 Am 05.06.2012 19:56, schrieb Howard Lewis Ship:

 The code for this is very small, and could easily be ported back to
 5.3, for 5.3.4.  Any interest?


 Definitely! I already did this and successfully called the doubler fn from a
 5.3.3 webapps's page. Very useful stuff. ;-)
 I think I'm going to like the way this is going. I instantly had the idea of
 being able to pass a t5-func Mapper and a Collection to clojure and be able
 to use partition and pmap to have the mapping done in parallel. Awesome!
 There's still some work to be done to get there, but I'm really happy that
 the first step is taken.

 Jochen


 -
 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



Memory Leak

2012-06-06 Thread George Christman
Hello, I've created a scheduler service and noticed a memory leak. I'm using
the exact code below to perform the test. I read an article related to class
reloading causing memory leaks,
http://tapestry.apache.org/class-reloading.html However, I don't really
understand what is being implied. I'm wondering if I'm doing something wrong
to cause this issue. After running the app from 14:56:23.026 through
15:16:30.222 with one second memory printouts I've noticed the following
loss. 

Available memory JVM (bytes) 8826784 14:56:23.026 
Available memory JVM (bytes) 6906536 15:16:30.222

//appmodule
public static void bind(ServiceBinder binder) {
binder.bind(SchedulerService.class, SchedulerServiceImpl.class);
}

@Startup
public static void initApplication(SchedulerService scheduler) {
scheduler.init();
}


public static AutocompleteCacheServiceApplicationUser
buildUserAutocompleteCache() {
return new AutocompleteCacheServiceImplApplicationUser() {
};
}

public static AutocompleteCacheServiceIfasvVendor
buildVendorAutocompleteCache() {
return new AutocompleteCacheServiceImplIfasvVendor() {
};
}

public static AutocompleteCacheServiceIfasvRequisitionCode
buildRequisitionAutocompleteCache() {
return new AutocompleteCacheServiceImplIfasvRequisitionCode() {
};
}

public static AutocompleteCacheServiceEvaluator
buildEvaluatorAutocompleteCache() {
return new AutocompleteCacheServiceImplEvaluator() {
};
}

//Impl
public class SchedulerServiceImpl implements SchedulerService {

@Inject
private RemoteUserSync remoteUserSync;

@Inject
private Session session;

@Inject
private PeriodicExecutor executor;

@InjectService(userAutocompleteCache) 
private AutocompleteCacheServiceApplicationUser userAutocompleteCache;

@InjectService(vendorAutocompleteCache) 
private AutocompleteCacheServiceIfasvVendor vendorAutocompleteCache;

@InjectService(requisitionAutocompleteCache) 
private AutocompleteCacheServiceIfasvRequisitionCode
requistionAutocompleteCache;

@InjectService(evaluatorAutocompleteCache) 
private AutocompleteCacheServiceEvaluator evaluatorAutocompleteCache;

public SchedulerServiceImpl() {
}

public void init() {
this.autocompleteCacheUpdate();
}

private void autocompleteCacheUpdate() {
this.executor.addJob(ScheduleUtils.secondlySchedule(1),
Autocomplete Cache Updates,
new Runnable() {
public void run() {
memoryUsage();
   
System.out.println(***Completed**);
}
});
}

public void memoryUsage() {
/* Total amount of free memory available to the JVM */
System.out.println(Available memory JVM (bytes):  + 
Runtime.getRuntime().freeMemory());

}

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668.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: Tapestry 5.3.4-rc-5

2012-06-06 Thread Howard Lewis Ship
http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html

Like everything else that's good in Tapestry: no magic bullet, just
discipline and determination.

On Wed, Jun 6, 2012 at 10:52 AM, Thiago H de Paula Figueiredo
thiag...@gmail.com wrote:
 On Wed, 06 Jun 2012 14:32:02 -0300, Howard Lewis Ship hls...@gmail.com
 wrote:

 For those that are interested, I just committed some further speed
 boosts to Tapestry, and generated a new preview release.

 The client who I'm doing this for saw the throughput on their load
 test go from 450 req/sec to 2000 req/sec ... what will your
 application see?


 Wow! Would you like to explain how to you managed to do that? That looks
 like something everybody could learn from. :)

 --
 Thiago H. de Paula Figueiredo

 -
 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: Memory Leak

2012-06-06 Thread Howard Lewis Ship
Tapestry has been noted to be effectively free of memory leaks.

What release of Tapestry are you using?

You seem to have a caching service here .. do you ever clear your
cache?  Could the contents of your cache account for the memory usage?

Are you checking memory usage after running at least one full GC?  If
you aren't running out of memory, Java is happy to let it clutter up
the place.

You can use VisualVM to get an idea of what objects are in memory,
that might help identify what, if anything, is leaking.

On Wed, Jun 6, 2012 at 12:19 PM, George Christman
gchrist...@cardaddy.com wrote:
 Hello, I've created a scheduler service and noticed a memory leak. I'm using
 the exact code below to perform the test. I read an article related to class
 reloading causing memory leaks,
 http://tapestry.apache.org/class-reloading.html However, I don't really
 understand what is being implied. I'm wondering if I'm doing something wrong
 to cause this issue. After running the app from 14:56:23.026 through
 15:16:30.222 with one second memory printouts I've noticed the following
 loss.

 Available memory JVM (bytes) 8826784 14:56:23.026
 Available memory JVM (bytes) 6906536 15:16:30.222

 //appmodule
    public static void bind(ServiceBinder binder) {
        binder.bind(SchedulerService.class, SchedulerServiceImpl.class);
    }

    @Startup
    public static void initApplication(SchedulerService scheduler) {
        scheduler.init();
    }


    public static AutocompleteCacheServiceApplicationUser
 buildUserAutocompleteCache() {
        return new AutocompleteCacheServiceImplApplicationUser() {
        };
    }

    public static AutocompleteCacheServiceIfasvVendor
 buildVendorAutocompleteCache() {
        return new AutocompleteCacheServiceImplIfasvVendor() {
        };
    }

    public static AutocompleteCacheServiceIfasvRequisitionCode
 buildRequisitionAutocompleteCache() {
        return new AutocompleteCacheServiceImplIfasvRequisitionCode() {
        };
    }

    public static AutocompleteCacheServiceEvaluator
 buildEvaluatorAutocompleteCache() {
        return new AutocompleteCacheServiceImplEvaluator() {
        };
    }

 //Impl
 public class SchedulerServiceImpl implements SchedulerService {

    @Inject
    private RemoteUserSync remoteUserSync;

    @Inject
    private Session session;

    @Inject
    private PeriodicExecutor executor;

    @InjectService(userAutocompleteCache)
    private AutocompleteCacheServiceApplicationUser userAutocompleteCache;

    @InjectService(vendorAutocompleteCache)
    private AutocompleteCacheServiceIfasvVendor vendorAutocompleteCache;

    @InjectService(requisitionAutocompleteCache)
    private AutocompleteCacheServiceIfasvRequisitionCode
 requistionAutocompleteCache;

    @InjectService(evaluatorAutocompleteCache)
    private AutocompleteCacheServiceEvaluator evaluatorAutocompleteCache;

    public SchedulerServiceImpl() {
    }

    public void init() {
        this.autocompleteCacheUpdate();
    }

    private void autocompleteCacheUpdate() {
        this.executor.addJob(ScheduleUtils.secondlySchedule(1),
            Autocomplete Cache Updates,
            new Runnable() {
                public void run() {
                    memoryUsage();

 System.out.println(***Completed**);
                }
            });
    }

    public void memoryUsage() {
    /* Total amount of free memory available to the JVM */
    System.out.println(Available memory JVM (bytes):  +
        Runtime.getRuntime().freeMemory());

    }

 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668.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: a problem about tapestry5's minxins

2012-06-06 Thread Howard Lewis Ship
What have you done so far to diagnose this problem?

For example, if I were dealing with this (I often do) I start by
checking that the page, and the JavaScript, rendered as I expected.

I'd then check the browser console for errors.

I'd also set breakpoints in my JS code to see if and when it is executed.

When debugging, you always want to go from a position of certainty to
another position of certainty. This requires you to gather facts as
you go.

On Tue, Jun 5, 2012 at 11:54 PM, yeehuqiu yeehu...@gmail.com wrote:
 with tapestry5.3. I have some codes
 eg:
 package com.ailk.mapp.tapestry.app.mixins;

 import org.apache.tapestry5.BindingConstants;
 import org.apache.tapestry5.ClientElement;
 import org.apache.tapestry5.annotations.AfterRender;
 import org.apache.tapestry5.annotations.Import;
 import org.apache.tapestry5.annotations.InjectContainer;
 import org.apache.tapestry5.annotations.Parameter;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.services.javascript.JavaScriptSupport;

 @Import (library=confirm.js)
 public class Confirm {

        @Parameter(value = Are you sure?, defaultPrefix =
 BindingConstants.LITERAL)
        private String message;
        @Inject
        private JavaScriptSupport javaScriptSupport;
        @InjectContainer
        private ClientElement element;
        @AfterRender
        public void afterRender() {

                System.out.println(confirm--);
        javaScriptSupport.addScript(new Confirm('%s', '%s');,
 element.getClientId(), message);
        }
 }

 Confirm.java 's path is
 /mapp/src/main/java/com/ailk/mapp/tapestry/app/mixins/Confirm.java
 and confirm.js's code

 var Confirm = Class.create();
 Confirm.prototype = {
        initialize: function(element, message) {

                        alert(=confirmjs)
                this.message = message;
                Event.observe($(element), 'click',
 this.doConfirm.bindAsEventListener(this));
        },

        doConfirm: function(e) {
                if(! confirm(this.message))
                        e.stop();
        }
 }

 confirm.js 's path is
 /mapp/src/main/*resources*/com/ailk/mapp/tapestry/app/mixins/confirm.js

 when I user them in my page .but it doesn't work .
 input t:type=submit value=delete t:mixins=confirm t:message=Are you
 sure you want to delete this item?   /.
 where is my problem. why it doesn't work?
 thanks in advance!


 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/a-problem-about-tapestry5-s-minxins-tp5713655.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: Memory Leak

2012-06-06 Thread George Christman
On Wed, Jun 6, 2012 at 3:24 PM, Howard Lewis Ship [via Tapestry] 
ml-node+s1045711n5713671...@n5.nabble.com wrote:

 Tapestry has been noted to be effectively free of memory leaks.


Hi Howard, I'm pretty new to services, so I'm just not sure if I'm using
them correctly. I've had the system go down three nights due to an out of
memory error.


 What release of Tapestry are you using?


v5.3.3


 You seem to have a caching service here .. do you ever clear your
 cache?  Could the contents of your cache account for the memory usage?


Nothing in the cache, I've disabled all caching and just let the scheduler
run outputting memory usage.



 Are you checking memory usage after running at least one full GC?  If
 you aren't running out of memory, Java is happy to let it clutter up
 the place.


Perhaps I don't completely understand how GC works. I'll read up on this
some more.


 You can use VisualVM to get an idea of what objects are in memory,
 that might help identify what, if anything, is leaking.


I'll look into that as well. Thanks Howard.


 On Wed, Jun 6, 2012 at 12:19 PM, George Christman
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5713671i=0
 wrote:

  Hello, I've created a scheduler service and noticed a memory leak. I'm
 using
  the exact code below to perform the test. I read an article related to
 class
  reloading causing memory leaks,
  http://tapestry.apache.org/class-reloading.html However, I don't really
  understand what is being implied. I'm wondering if I'm doing something
 wrong
  to cause this issue. After running the app from 14:56:23.026 through
  15:16:30.222 with one second memory printouts I've noticed the following
  loss.
 
  Available memory JVM (bytes) 8826784 14:56:23.026
  Available memory JVM (bytes) 6906536 15:16:30.222
 
  //appmodule
 public static void bind(ServiceBinder binder) {
 binder.bind(SchedulerService.class, SchedulerServiceImpl.class);
 }
 
 @Startup
 public static void initApplication(SchedulerService scheduler) {
 scheduler.init();
 }
 
 
 public static AutocompleteCacheServiceApplicationUser
  buildUserAutocompleteCache() {
 return new AutocompleteCacheServiceImplApplicationUser() {
 };
 }
 
 public static AutocompleteCacheServiceIfasvVendor
  buildVendorAutocompleteCache() {
 return new AutocompleteCacheServiceImplIfasvVendor() {
 };
 }
 
 public static AutocompleteCacheServiceIfasvRequisitionCode
  buildRequisitionAutocompleteCache() {
 return new AutocompleteCacheServiceImplIfasvRequisitionCode() {
 };
 }
 
 public static AutocompleteCacheServiceEvaluator
  buildEvaluatorAutocompleteCache() {
 return new AutocompleteCacheServiceImplEvaluator() {
 };
 }
 
  //Impl
  public class SchedulerServiceImpl implements SchedulerService {
 
 @Inject
 private RemoteUserSync remoteUserSync;
 
 @Inject
 private Session session;
 
 @Inject
 private PeriodicExecutor executor;
 
 @InjectService(userAutocompleteCache)
 private AutocompleteCacheServiceApplicationUser
 userAutocompleteCache;
 
 @InjectService(vendorAutocompleteCache)
 private AutocompleteCacheServiceIfasvVendor
 vendorAutocompleteCache;
 
 @InjectService(requisitionAutocompleteCache)
 private AutocompleteCacheServiceIfasvRequisitionCode
  requistionAutocompleteCache;
 
 @InjectService(evaluatorAutocompleteCache)
 private AutocompleteCacheServiceEvaluator
 evaluatorAutocompleteCache;
 
 public SchedulerServiceImpl() {
 }
 
 public void init() {
 this.autocompleteCacheUpdate();
 }
 
 private void autocompleteCacheUpdate() {
 this.executor.addJob(ScheduleUtils.secondlySchedule(1),
 Autocomplete Cache Updates,
 new Runnable() {
 public void run() {
 memoryUsage();
 
 
 System.out.println(***Completed**);
 }
 });
 }
 
 public void memoryUsage() {
 /* Total amount of free memory available to the JVM */
 System.out.println(Available memory JVM (bytes):  +
 Runtime.getRuntime().freeMemory());
 
 }
 
  --
  View this message in context:
 http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668.html
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=5713671i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=5713671i=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

 

Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Cezary Biernacki

On 06 June 2012 21:20:02 +0200 Howard Lewis Ship hls...@gmail.com wrote:

http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html

I am curious is there a reason to not use 'double-checked locking' pattern? I 
know that it was broken in Java 1.4 and earlier, but Java Memory Model was 
changed (JSR-133) for Java 5.0 to accommodate that pattern. Of course, you need 
to use 'volatile' field, but AFAIK it does not impose any significant penalty 
(especially for reads) on most platforms including most x86 and emt64. Am I 
missing something?

Cezary



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



Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Kalle Korhonen
On Wed, Jun 6, 2012 at 1:51 PM, Cezary Biernacki cezary...@gmail.com wrote:
 On 06 June 2012 21:20:02 +0200 Howard Lewis Ship hls...@gmail.com wrote:
 http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html
 I am curious is there a reason to not use 'double-checked locking' pattern?
 I know that it was broken in Java 1.4 and earlier, but Java Memory Model was
 changed (JSR-133) for Java 5.0 to accommodate that pattern. Of course, you
 need to use 'volatile' field, but AFAIK it does not impose any significant
 penalty (especially for reads) on most platforms including most x86 and
 emt64. Am I missing something?

Same question, and I think there's still more places in T5 code that
could simply return the object if it exists before synchronizing or
obtaining locks if the field was volatile. Specifically, even before
the try block, could you not do:
if (messages != null) return messages;

Or, depending on where it's cleaned up:
Messages messages = this.messages;
if (messages != null) return messages;

?

Kalle

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



Re: Memory Leak

2012-06-06 Thread Muhammad Gelbana
May be most of your services are singletons while this is more than needed
? Like some services actually deserve to be per-thread ? Or per session ?

I'm not even sure if that may be it, just saying.

On Wed, Jun 6, 2012 at 9:34 PM, George Christman gchrist...@cardaddy.comwrote:

 On Wed, Jun 6, 2012 at 3:24 PM, Howard Lewis Ship [via Tapestry] 
 ml-node+s1045711n5713671...@n5.nabble.com wrote:

  Tapestry has been noted to be effectively free of memory leaks.
 

 Hi Howard, I'm pretty new to services, so I'm just not sure if I'm using
 them correctly. I've had the system go down three nights due to an out of
 memory error.


  What release of Tapestry are you using?
 

 v5.3.3

 
  You seem to have a caching service here .. do you ever clear your
  cache?  Could the contents of your cache account for the memory usage?
 

 Nothing in the cache, I've disabled all caching and just let the scheduler
 run outputting memory usage.


 
  Are you checking memory usage after running at least one full GC?  If
  you aren't running out of memory, Java is happy to let it clutter up
  the place.
 

 Perhaps I don't completely understand how GC works. I'll read up on this
 some more.

 
  You can use VisualVM to get an idea of what objects are in memory,
  that might help identify what, if anything, is leaking.
 

 I'll look into that as well. Thanks Howard.

 
  On Wed, Jun 6, 2012 at 12:19 PM, George Christman
  [hidden email] http://user/SendEmail.jtp?type=nodenode=5713671i=0
  wrote:
 
   Hello, I've created a scheduler service and noticed a memory leak. I'm
  using
   the exact code below to perform the test. I read an article related to
  class
   reloading causing memory leaks,
   http://tapestry.apache.org/class-reloading.html However, I don't
 really
   understand what is being implied. I'm wondering if I'm doing something
  wrong
   to cause this issue. After running the app from 14:56:23.026 through
   15:16:30.222 with one second memory printouts I've noticed the
 following
   loss.
  
   Available memory JVM (bytes) 8826784 14:56:23.026
   Available memory JVM (bytes) 6906536 15:16:30.222
  
   //appmodule
  public static void bind(ServiceBinder binder) {
  binder.bind(SchedulerService.class, SchedulerServiceImpl.class);
  }
  
  @Startup
  public static void initApplication(SchedulerService scheduler) {
  scheduler.init();
  }
  
  
  public static AutocompleteCacheServiceApplicationUser
   buildUserAutocompleteCache() {
  return new AutocompleteCacheServiceImplApplicationUser() {
  };
  }
  
  public static AutocompleteCacheServiceIfasvVendor
   buildVendorAutocompleteCache() {
  return new AutocompleteCacheServiceImplIfasvVendor() {
  };
  }
  
  public static AutocompleteCacheServiceIfasvRequisitionCode
   buildRequisitionAutocompleteCache() {
  return new AutocompleteCacheServiceImplIfasvRequisitionCode()
 {
  };
  }
  
  public static AutocompleteCacheServiceEvaluator
   buildEvaluatorAutocompleteCache() {
  return new AutocompleteCacheServiceImplEvaluator() {
  };
  }
  
   //Impl
   public class SchedulerServiceImpl implements SchedulerService {
  
  @Inject
  private RemoteUserSync remoteUserSync;
  
  @Inject
  private Session session;
  
  @Inject
  private PeriodicExecutor executor;
  
  @InjectService(userAutocompleteCache)
  private AutocompleteCacheServiceApplicationUser
  userAutocompleteCache;
  
  @InjectService(vendorAutocompleteCache)
  private AutocompleteCacheServiceIfasvVendor
  vendorAutocompleteCache;
  
  @InjectService(requisitionAutocompleteCache)
  private AutocompleteCacheServiceIfasvRequisitionCode
   requistionAutocompleteCache;
  
  @InjectService(evaluatorAutocompleteCache)
  private AutocompleteCacheServiceEvaluator
  evaluatorAutocompleteCache;
  
  public SchedulerServiceImpl() {
  }
  
  public void init() {
  this.autocompleteCacheUpdate();
  }
  
  private void autocompleteCacheUpdate() {
  this.executor.addJob(ScheduleUtils.secondlySchedule(1),
  Autocomplete Cache Updates,
  new Runnable() {
  public void run() {
  memoryUsage();
  
  
  System.out.println(***Completed**);
  }
  });
  }
  
  public void memoryUsage() {
  /* Total amount of free memory available to the JVM */
  System.out.println(Available memory JVM (bytes):  +
  Runtime.getRuntime().freeMemory());
  
  }
  
   --
   View this message in context:
  http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668.html
   Sent from the Tapestry - User mailing list archive at Nabble.com.
  
   -
   To unsubscribe, e-mail: [hidden email]
 

Re: Memory Leak

2012-06-06 Thread Thiago H de Paula Figueiredo
On Wed, 06 Jun 2012 18:40:05 -0300, Muhammad Gelbana m.gelb...@gmail.com  
wrote:


May be most of your services are singletons while this is more than  
needed? Like some services actually deserve to be per-thread ? Or per  
session ?


I'd check your code memory usage without Tapestry-IoC and then with T-IoC  
before saying there's a memory leak in T-IoC. In addition, knowing how  
Java handles memory is very important, specially when doing benchmarks  
like that.


--
Thiago H. de Paula Figueiredo

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



Re: Memory Leak

2012-06-06 Thread George Christman
Hi Thiago, I'm not saying T-IoC is the issue, I don't know enough about
T-IoC to know whether or not I'm using it correctly. I know I have a memory
issue, three mornings in a row the server has been brought down with an out
of memory exception, so I first wanted to be sure I was using T-IoC
correctly.

On Wed, Jun 6, 2012 at 6:23 PM, Thiago H de Paula Figueiredo [via Tapestry]
ml-node+s1045711n5713677...@n5.nabble.com wrote:

 On Wed, 06 Jun 2012 18:40:05 -0300, Muhammad Gelbana [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713677i=0

 wrote:

  May be most of your services are singletons while this is more than
  needed? Like some services actually deserve to be per-thread ? Or per
  session ?

 I'd check your code memory usage without Tapestry-IoC and then with T-IoC

 before saying there's a memory leak in T-IoC. In addition, knowing how
 Java handles memory is very important, specially when doing benchmarks
 like that.

 --
 Thiago H. de Paula Figueiredo

 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713677i=1
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713677i=2



 --
  If you reply to this email, your message will be added to the discussion
 below:
 http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668p5713677.html
  To unsubscribe from Memory Leak, click 
 herehttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5713668code=Z2NocmlzdG1hbkBjYXJkYWRkeS5jb218NTcxMzY2OHwxNjMyOTYxMjA3
 .
 NAMLhttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Memory-Leak-tp5713668p5713678.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Martin Strand

On Wed, 06 Jun 2012 23:29:52 +0200, Kalle Korhonen kalle.o.korho...@gmail.com 
wrote:


On Wed, Jun 6, 2012 at 1:51 PM, Cezary Biernacki cezary...@gmail.com wrote:

On 06 June 2012 21:20:02 +0200 Howard Lewis Ship hls...@gmail.com wrote:

http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html

I am curious is there a reason to not use 'double-checked locking' pattern?
I know that it was broken in Java 1.4 and earlier, but Java Memory Model was
changed (JSR-133) for Java 5.0 to accommodate that pattern. Of course, you
need to use 'volatile' field, but AFAIK it does not impose any significant
penalty (especially for reads) on most platforms including most x86 and
emt64. Am I missing something?


Same question, and I think there's still more places in T5 code that
could simply return the object if it exists before synchronizing or
obtaining locks if the field was volatile. Specifically, even before
the try block, could you not do:
if (messages != null) return messages;

Or, depending on where it's cleaned up:
Messages messages = this.messages;
if (messages != null) return messages;



If I'm not mistaken, JSR-133 only affects final fields so we still have the 
same problem for non-final fields.
i.e any non-final fields in Messages might still be uninitialized even if the 
*reference* is visible to other threads (messages != null)

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



Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Howard Lewis Ship
On Wed, Jun 6, 2012 at 1:51 PM, Cezary Biernacki cezary...@gmail.com wrote:
 On 06 June 2012 21:20:02 +0200 Howard Lewis Ship hls...@gmail.com wrote:


 http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html

 I am curious is there a reason to not use 'double-checked locking' pattern?
 I know that it was broken in Java 1.4 and earlier, but Java Memory Model was
 changed (JSR-133) for Java 5.0 to accommodate that pattern. Of course, you
 need to use 'volatile' field, but AFAIK it does not impose any significant
 penalty (especially for reads) on most platforms including most x86 and
 emt64. Am I missing something?

double checked lock works in some cases.

You can even omit synchronized and volatile IFF:
- only a single shared field is updated
- it is ok for a race condition to exist that would create the value
on multiple threads
- (I learned this by getting schooled on the subject by Rich Hickey)

There are many things in Tapestry that don't fit this model.
Sometimes the value being lazily created is so expensive, it would be
invalid to allow multiple threads to create it.  In other cases, more
than one shared field is updated.


 Cezary




 -
 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



Checklist disabled possible bug

2012-06-06 Thread iberck
Hi tapestry members:

I'm using T5.3:
I'm trying the checklist component and I found that the disabled property in
the client side doesn't work: 

t:form
table
tr
td class=nameChecklist:/td
tdinput t:type=Checklist t:model=stationery
t:selected=checklistSelectedValues t:encoder=stringEncoder
t:disabled='true'//td
td${checklistSelectedValues}/td
/tr
/table
/t:form

@Property
private final String[] STATIONERY = {Pens, Pencils, Paper};
@Property
@Persist
@SuppressWarnings(unused)
private ListString checklistSelectedValues;
@Property
@SuppressWarnings(unused)
private final StringValueEncoder stringEncoder = new
StringValueEncoder();

public boolean isDisabled() {
return true;
}

Regards


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Checklist-disabled-possible-bug-tp5713681.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: This could be because its template file could not be located

2012-06-06 Thread Howard Lewis Ship
On Tue, Jun 5, 2012 at 5:49 PM, Ray Nicholus rnicho...@widen.com wrote:
 Turns out tml files weren't properly represented in the resource patterns
 box in the compiler section of IDEA.  As a result, they weren't copied to
 the bin directory during compilation.  I figured this out earlier but
 didn't get a chane to respond 'till now.  It's always the last thing you
 check, isn't it.

I usually check three additional things after I find the problem :-)


 On Tue, Jun 5, 2012 at 4:47 PM, Howard Lewis Ship hls...@gmail.com wrote:

 See my notes in an adjacent thread.

 On Tue, Jun 5, 2012 at 1:51 PM, Ray Nicholus rnicho...@widen.com wrote:
  I'm starting a new T5 project, and am having some difficulty.  For
 example,
  if I put my tml files alongside my java classes
  (com.mycompany.myproj.pages), when I startup my app, and navigate to a
  page, tapestry tells me that it cannot find the template file.  If I then
  move the template file into my web dir, it can find it and everything
 seems
  to work.  I don't want to put my template files in my web dir.  Why is
 this
  not working for me?



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





-- 
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: Tapestry 5.3.4-rc-5

2012-06-06 Thread Cezary Biernacki

 If I'm not mistaken, JSR-133 only affects final fields so we still have
 the same problem for non-final fields.
 i.e any non-final fields in Messages might still be uninitialized even if
 the *reference* is visible to other threads (messages != null)



Actually, JSR-133 guarantees that final fields are initialised before
reference to the object is visible to other threads even not using
volatile. Change in 'volatile' was separate:


* The semantics of volatile variables have been strengthened to have
acquire and release semantics. In the original specification, accesses to
volatile and non-volatile variables could be
freely ordered.

*  The semantics of final fields have been strengthened to allow for
thread-safe immutatability
without explicit synchronization. This may require steps such as
store-store barriers at the
end of constructors in which final fields are set.[1]


[1] http://www.cs.umd.edu/~pugh/java/memoryModel/jsr133.pdf



Cezary


Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Cezary Biernacki
On Thu, Jun 7, 2012 at 1:27 AM, Howard Lewis Ship hls...@gmail.com wrote:

 You can even omit synchronized and volatile IFF:
 - only a single shared field is updated
 - it is ok for a race condition to exist that would create the value
 on multiple threads
 - (I learned this by getting schooled on the subject by Rich Hickey)

 There are many things in Tapestry that don't fit this model.
 Sometimes the value being lazily created is so expensive, it would be
 invalid to allow multiple threads to create it.  In other cases, more
 than one shared field is updated.



Hm, but the second check inside 'synchronized' block is supposed to avoid
creating value on multiple threads. For example:

private volatile Messages messages;

public Messages getMessages()
{
if (messages != null)
{
return messages;
}

   synchronized (this) {
   if (messages != null)
   {
   return messages;
   }

   messages = elementResources.getMessages(componentModel);
// --- only called if no other thread did this before
   }

return messages;
}




Cezary


Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Martin Strand

On Thu, 07 Jun 2012 02:24:35 +0200, Cezary Biernacki cezary...@gmail.com 
wrote:


* The semantics of volatile variables have been strengthened to have
acquire and release semantics. In the original specification, accesses to
volatile and non-volatile variables could be
freely ordered.


Aha, so does this mean that volatile introduces the same memory semantics 
that a read lock does?
If message is declared volatile, even its non-final fields would be guaranteed 
to be published properly?
But if it's not volatile we have the usual problem with uninitialized fields?

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



Re: HowTo break out of a Tapestry loop?

2012-06-06 Thread dp
Thanks, I have done it with some conditional testing for now but am pretty
sure that for a long term solution creating a new data structure with all
necessary fields would be easier to manage.

Please also refer to the stackoverflow question:
http://stackoverflow.com/questions/10916019/howto-break-out-of-a-tapestry-loop

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/HowTo-break-out-of-a-Tapestry-loop-tp5713658p5713686.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: a problem about tapestry5's minxins

2012-06-06 Thread yeehuqiu
 I ‘m learning tapestry5 just beginning. Now I'm doing a example about
deleting some records.So  I have searched some tutorial.But I can't
understand all those tutorial. Now I click the SUBMIT button. It doesn't
popup the confirm delete dialog box. (I'm doing the example reference
tutorial).So, I don't know the reason that  It doesn't popup the confirm
box.
HELP ME PLEASE. THANKS VERY MUCH!

2012/6/7 Howard Lewis Ship [via Tapestry] 
ml-node+s1045711n5713672...@n5.nabble.com

 What have you done so far to diagnose this problem?

 For example, if I were dealing with this (I often do) I start by
 checking that the page, and the JavaScript, rendered as I expected.

 I'd then check the browser console for errors.

 I'd also set breakpoints in my JS code to see if and when it is executed.

 When debugging, you always want to go from a position of certainty to
 another position of certainty. This requires you to gather facts as
 you go.

 On Tue, Jun 5, 2012 at 11:54 PM, yeehuqiu [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713672i=0
 wrote:

  with tapestry5.3. I have some codes
  eg:
  package com.ailk.mapp.tapestry.app.mixins;
 
  import org.apache.tapestry5.BindingConstants;
  import org.apache.tapestry5.ClientElement;
  import org.apache.tapestry5.annotations.AfterRender;
  import org.apache.tapestry5.annotations.Import;
  import org.apache.tapestry5.annotations.InjectContainer;
  import org.apache.tapestry5.annotations.Parameter;
  import org.apache.tapestry5.ioc.annotations.Inject;
  import org.apache.tapestry5.services.javascript.JavaScriptSupport;
 
  @Import (library=confirm.js)
  public class Confirm {
 
 @Parameter(value = Are you sure?, defaultPrefix =
  BindingConstants.LITERAL)
 private String message;
 @Inject
 private JavaScriptSupport javaScriptSupport;
 @InjectContainer
 private ClientElement element;
 @AfterRender
 public void afterRender() {
 
 System.out.println(confirm--);
 javaScriptSupport.addScript(new Confirm('%s', '%s');,
  element.getClientId(), message);
 }
  }
 
  Confirm.java 's path is
  /mapp/src/main/java/com/ailk/mapp/tapestry/app/mixins/Confirm.java
  and confirm.js's code
 
  var Confirm = Class.create();
  Confirm.prototype = {
 initialize: function(element, message) {
 
 alert(=confirmjs)
 this.message = message;
 Event.observe($(element), 'click',
  this.doConfirm.bindAsEventListener(this));
 },
 
 doConfirm: function(e) {
 if(! confirm(this.message))
 e.stop();
 }
  }
 
  confirm.js 's path is
  /mapp/src/main/*resources*/com/ailk/mapp/tapestry/app/mixins/confirm.js
 
  when I user them in my page .but it doesn't work .
  input t:type=submit value=delete t:mixins=confirm t:message=Are
 you
  sure you want to delete this item?   /.
  where is my problem. why it doesn't work?
  thanks in advance!
 
 
  --
  View this message in context:
 http://tapestry.1045711.n5.nabble.com/a-problem-about-tapestry5-s-minxins-tp5713655.html
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=5713672i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=5713672i=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=5713672i=3
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713672i=4



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://tapestry.1045711.n5.nabble.com/a-problem-about-tapestry5-s-minxins-tp5713655p5713672.html
  To unsubscribe from a problem about tapestry5's minxins, click 
 herehttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5713655code=eWVlaHVxaXVAZ21haWwuY29tfDU3MTM2NTV8LTE3NDYyMDg3NDg=
 .
 NAMLhttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




-- 

thanks and regards!

=

MSN: yeehu...@gmail.com

=


--
View this message in context: 

Re: a problem about tapestry5's minxins

2012-06-06 Thread Taha Siddiqi
Have you tried firebox or some other js debugger to check if there is an error ?

On Jun 7, 2012, at 8:04 AM, yeehuqiu wrote:

 I ‘m learning tapestry5 just beginning. Now I'm doing a example about
 deleting some records.So  I have searched some tutorial.But I can't
 understand all those tutorial. Now I click the SUBMIT button. It doesn't
 popup the confirm delete dialog box. (I'm doing the example reference
 tutorial).So, I don't know the reason that  It doesn't popup the confirm
 box.
 HELP ME PLEASE. THANKS VERY MUCH!
 
 2012/6/7 Howard Lewis Ship [via Tapestry] 
 ml-node+s1045711n5713672...@n5.nabble.com
 
 What have you done so far to diagnose this problem?
 
 For example, if I were dealing with this (I often do) I start by
 checking that the page, and the JavaScript, rendered as I expected.
 
 I'd then check the browser console for errors.
 
 I'd also set breakpoints in my JS code to see if and when it is executed.
 
 When debugging, you always want to go from a position of certainty to
 another position of certainty. This requires you to gather facts as
 you go.
 
 On Tue, Jun 5, 2012 at 11:54 PM, yeehuqiu [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713672i=0
 wrote:
 
 with tapestry5.3. I have some codes
 eg:
 package com.ailk.mapp.tapestry.app.mixins;
 
 import org.apache.tapestry5.BindingConstants;
 import org.apache.tapestry5.ClientElement;
 import org.apache.tapestry5.annotations.AfterRender;
 import org.apache.tapestry5.annotations.Import;
 import org.apache.tapestry5.annotations.InjectContainer;
 import org.apache.tapestry5.annotations.Parameter;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.services.javascript.JavaScriptSupport;
 
 @Import (library=confirm.js)
 public class Confirm {
 
   @Parameter(value = Are you sure?, defaultPrefix =
 BindingConstants.LITERAL)
   private String message;
   @Inject
   private JavaScriptSupport javaScriptSupport;
   @InjectContainer
   private ClientElement element;
   @AfterRender
   public void afterRender() {
 
   System.out.println(confirm--);
   javaScriptSupport.addScript(new Confirm('%s', '%s');,
 element.getClientId(), message);
   }
 }
 
 Confirm.java 's path is
 /mapp/src/main/java/com/ailk/mapp/tapestry/app/mixins/Confirm.java
 and confirm.js's code
 
 var Confirm = Class.create();
 Confirm.prototype = {
   initialize: function(element, message) {
 
   alert(=confirmjs)
   this.message = message;
   Event.observe($(element), 'click',
 this.doConfirm.bindAsEventListener(this));
   },
 
   doConfirm: function(e) {
   if(! confirm(this.message))
   e.stop();
   }
 }
 
 confirm.js 's path is
 /mapp/src/main/*resources*/com/ailk/mapp/tapestry/app/mixins/confirm.js
 
 when I user them in my page .but it doesn't work .
 input t:type=submit value=delete t:mixins=confirm t:message=Are
 you
 sure you want to delete this item?   /.
 where is my problem. why it doesn't work?
 thanks in advance!
 
 
 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/a-problem-about-tapestry5-s-minxins-tp5713655.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 -
 To unsubscribe, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713672i=1
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713672i=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=5713672i=3
 For additional commands, e-mail: [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5713672i=4
 
 
 
 --
 If you reply to this email, your message will be added to the discussion
 below:
 
 http://tapestry.1045711.n5.nabble.com/a-problem-about-tapestry5-s-minxins-tp5713655p5713672.html
 To unsubscribe from a problem about tapestry5's minxins, click 
 herehttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5713655code=eWVlaHVxaXVAZ21haWwuY29tfDU3MTM2NTV8LTE3NDYyMDg3NDg=
 .
 NAMLhttp://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 
 
 
 
 -- 
 
 thanks and regards!
 
 =
 
 MSN: 

Re: Checklist disabled possible bug

2012-06-06 Thread Thiago H de Paula Figueiredo

On Wed, 06 Jun 2012 20:37:18 -0300, iberck ibe...@gmail.com wrote:


Hi tapestry members:


Hi!


I'm using T5.3:
I'm trying the checklist component and I found that the disabled  
property in the client side doesn't work:


It would be nice if you had said what doesn't work so we don't need to  
test your code to figure that out. ;)


--
Thiago H. de Paula Figueiredo

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



Re: Memory Leak

2012-06-06 Thread Thiago H de Paula Figueiredo
On Wed, 06 Jun 2012 19:37:41 -0300, George Christman  
gchrist...@cardaddy.com wrote:



Hi Thiago, I'm not saying T-IoC is the issue, I don't know enough about
T-IoC to know whether or not I'm using it correctly. I know I have a  
memory issue, three mornings in a row the server has been brought down  
with an out of memory exception, so I first wanted to be sure I was  
using T-IoC

correctly.


Your Tapestry-IoC code looks fine. I'd check the cache implementation  
itself and whether there are some points in your code that allocate too  
many objects and still have references pointing to them (so they cannot be  
garbage collected).


--
Thiago H. de Paula Figueiredo

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



Re: Checklist disabled possible bug

2012-06-06 Thread iberck
I'm Sorry Thiago, the problem is in the client side, the checkbox control
doesn't render disabled


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Checklist-disabled-possible-bug-tp5713681p5713691.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: a problem about tapestry5's minxins

2012-06-06 Thread Thiago H de Paula Figueiredo

On Wed, 06 Jun 2012 23:34:52 -0300, yeehuqiu yeehu...@gmail.com wrote:


 I ‘m learning tapestry5 just beginning.


IMHO, mixins are an advanced concept, so my advice is that you shouldn't  
try to write your own nor trying to understand now. You're mixing too many  
things (pages, components, mixins, using JavaScript in Tapestry) to learn  
at the same time and this bringing you confusion and not knowledge. Before  
mixins, you need to really understand pages and components. In other  
words, start from the basics. ;)


Regarding your problem, the first thing you need to do, as already said  
here, is to check for JavaScript errors. Firebug is a very nice tool for  
that (and lots of other web development too).


--
Thiago H. de Paula Figueiredo

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