Re: generics and pages, components and edit blocks
Which is why I'm anxious to release Tapestry 5.1 and demonstrate the seriousness concerning backwards compatibility. On Sun, Mar 8, 2009 at 7:58 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Sun, 08 Mar 2009 23:46:41 -0300, Luther Baker lutherba...@gmail.com escreveu: Further, the design of Tapestry 5 was created specifically to make it possible to continue adding features without breaking backwards compatibility going forward. There will not need to be a Tapestry 6. There was a very annoying troll in this list, some time ago, that always talked about the lack of backward compatibility of major Tapestry releases . . . Talking about trolling, but now on the funny side, not the annoying one, read this: http://www.jroller.com/javelotinfo/entry/trolling_with_java_web_frameworks :D Funny and informative at the same time . . . -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: how to let actionlink to open another page like target=_blank?
Enjoy :) As you can see, this is accomplished with only a few lines of actual code. Of course, it is easy to extend with parameters to open up event type, window attributes and so on... So far, I don't need anything like that. PopupPageLink.java: @IncludeJavaScriptLibrary(PopupPageLink.js) public class PopupPageLink { @Inject private ComponentResources resources; @Environmental private RenderSupport renderSupport; @InjectContainer private ClientElement container; @Parameter(required = true, defaultPrefix = BindingConstants.LITERAL) private String page; @Parameter private Object[] context; void afterRender() { Link link = resources.createPageLink(page, true, context); renderSupport.addScript(new PopupPageLink('%s', '%s');, container.getClientId(), link); } } PopupPageLink.js: var PopupPageLink = Class.create(); PopupPageLink.prototype = { initialize: function(id, link) { this.element = $(id); this.link = link; Event.observe(this.element, 'click', this.onclick.bindAsEventListener(this)); }, onclick: function() { var width = 800; var height = 600; varname = 'dialogWindow'; var win = window.open(this.link,name,'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no,screenX=0,screenY=0,left=0,top=0' ); win.focus(); } } On Sun, Mar 8, 2009 at 6:49 PM, Tan cyb...@n quesoft.cyber...@gmail.comwrote: Yes Please. On Sun, Mar 8, 2009 at 11:23 PM, Andy Pahne andy.pa...@googlemail.com wrote: Yes please, would be nice to see... Andy Inge Solvoll schrieb: I created a mixin, PopupPageLink, that opens a new window containing a the link, with window.open() in javascript. It gives you more control over the opened window. Also, you can add the mixin to any element, not just a link, just make a hook to the onclick event. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry 5.1: Wait for Page
Beyond that, the behavior can be changed by monkey-patching the JavaScript and the CSS. The trouble with that is when you change Tapestry's JavaScript you also need to be mindful of these patches and maintain them between releases. Why not use a property on the link to switch it off?, IMHO it just makes more sense that the use of effects and such remains optional. So you could have something like: t:actionlink disableEffect=list,of,effects,to,remove / Regards, Peter - Original Message - From: Howard Lewis Ship hls...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, 6 March, 2009 20:37:56 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: Tapestry 5.1: Wait for Page It only affects Ajax links; they must explicitly add an onclick event handler attributes. Beyond that, the behavior can be changed by monkey-patching the JavaScript and the CSS. On Fri, Mar 6, 2009 at 3:55 AM, Chris Lewis chris_le...@bellsouth.net wrote: Will this be configurable? While it can be a useful feature, there are times where clicking a link (etc) before the page is ready won't break the app. Additionally, I get a little freaked out at any non-essential feature I can't control. So, will it be configurable? sincerely, chris Howard Lewis Ship wrote: I've uploaded a short clip showing how the wait-for-page functionality works in 5.1. http://blip.tv/file/1844614/ -- http://iamchrislewis.tumblr.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 Apache Tapestry and Apache HiveMind - 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
Tapestry-Hibernate Rollback
Hello, i've using tapestry-hibernate with the latest snapshot but i am having issues with transaction rollbacks. I am using Derby and Hibernate configured with autocommit=false, but if i throw a RuntimeException the transaction is never rolled back. In the stack trace i can see that the HibernateTransactionAdvisorImpl is throwing back exception, what means that the transaction is being aborted, but in my database i still can see the data. This is the stack trace i get: Caused by: java.lang.RuntimeException: rollback? at com.dodo.profiler.core.service.visit.impl.VisitManagerImpl.addVisits(VisitManagerImpl.java:107) at Invocation$VisitManager$addVisits$11fea375779.invokeDelegateMethod(Invocation$VisitManager$addVisits$11fea375779.java) at org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:117) at org.apache.tapestry5.internal.hibernate.HibernateTransactionAdvisorImpl$1.advise(HibernateTransactionAdvisorImpl.java:40) at org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:121) at $VisitManager_11fea373b0a.addVisits($VisitManager_11fea373b0a.java) at $VisitManager_11fea373ad9.addVisits($VisitManager_11fea373ad9.java) The VisitManager inteface looks like this: public interface VisitManager { @CommitAfter public void addVisits(NewVisitsParameters newVisitsParameters); } And the tapestry-hibernate configuration adds the advise: @Match(*Manager) public static void adviseTransactions(HibernateTransactionAdvisor advisor, MethodAdviceReceiver receiver) { advisor.addTransactionCommitAdvice(receiver); } Thanks a lot for your help - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry-Hibernate Rollback
Ok, the transaction is being rollback, but then there is something i don't get about @CommitAfter. What happens if a @CommitAfter method calls a different @CommitAfter method? Are the transactions nested? would the whole transaction will only be committed after the first method returns? or would there be a different transaction for each of the methods? Thanks On 3/9/09, Juan E. Maya maya.j...@gmail.com wrote: Hello, i've using tapestry-hibernate with the latest snapshot but i am having issues with transaction rollbacks. I am using Derby and Hibernate configured with autocommit=false, but if i throw a RuntimeException the transaction is never rolled back. In the stack trace i can see that the HibernateTransactionAdvisorImpl is throwing back exception, what means that the transaction is being aborted, but in my database i still can see the data. This is the stack trace i get: Caused by: java.lang.RuntimeException: rollback? at com.dodo.profiler.core.service.visit.impl.VisitManagerImpl.addVisits(VisitManagerImpl.java:107) at Invocation$VisitManager$addVisits$11fea375779.invokeDelegateMethod(Invocation$VisitManager$addVisits$11fea375779.java) at org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:117) at org.apache.tapestry5.internal.hibernate.HibernateTransactionAdvisorImpl$1.advise(HibernateTransactionAdvisorImpl.java:40) at org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:121) at $VisitManager_11fea373b0a.addVisits($VisitManager_11fea373b0a.java) at $VisitManager_11fea373ad9.addVisits($VisitManager_11fea373ad9.java) The VisitManager inteface looks like this: public interface VisitManager { @CommitAfter public void addVisits(NewVisitsParameters newVisitsParameters); } And the tapestry-hibernate configuration adds the advise: @Match(*Manager) public static void adviseTransactions(HibernateTransactionAdvisor advisor, MethodAdviceReceiver receiver) { advisor.addTransactionCommitAdvice(receiver); } Thanks a lot for your help - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: problem tapestry-spring-security plugin: UserDetailsService implementation not found
As the name says, the sample application does declare the UserDetailsService. Look at nu.localhost.tapestry5.springsecuritytest.services.TestsecurityModule there you'll find the build method public static UserDetailsService buildUserDetailsService( @Inject PasswordEncoder encoder, @Inject SaltSource salt ) { return new MyUserDetailsService( encoder, salt ); } This module is in fact using the SpringSecurityModule like you'll probably do. manuel aldana schrieb: Thiago H. de Paula Figueiredo schrieb: Em Sun, 08 Mar 2009 18:09:29 -0300, manuel aldana ald...@gmx.de escreveu: Exception constructing service 'RememberMeServices': Error invoking service builder method nu.localhost.tapestry5.springsecurity.services.SecurityModule.build(UserDetailsService, String) (at SecurityModule.java:303) (for service 'RememberMeServices'): No service implements the interface org.springframework.security.userdetails.UserDetailsService. It does not find the UserDetailsService implementation though I placed one inside rootPackage.services.internal. Does somebody know how tapestry spring-security plugin looks for the implementation? It looks it up via Tapestry-IoC. Actually, this error messages is given by T-IoC, not Tapestry-Spring Security yourself. Just make sure you declare your UserDetailsService implementation as a service in your AppModule class (or any other Tapestry-IoC module). Yes, you're right adding this interface-implementation mapping to AppModule made it work. But I wonder why it works in the sample application from the tapestry-spring-security module, which has no AppModule defined. I guess then some tapestry magic comes in place (maybe scanning for implementors of interfaces...). - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed
I have a filer to trim off the long jsession IDs from url You can do so, but IMHO that should never be necessary, the session id is encoded into the URL only once, and then removed by the container (that is if you have cookies enabled in the browser). It provides a backwards compatibility mechanism and support for devices that can't support cookies. The only other reason that it might be encoded request after request is if you are creating a new session with each request (a configuration problem that can happen for instance when you have a problem with your front end - Apache mod_rewrite), which is not mapping your cookie correctly to your back end (Tomcat / Jetty etc). Returning true is interpreted as a terminator for the request by your container, false allows the request to continue naturally, so if you call something like session.invalidate(), immediatly after call return true; to terminate, invalidate acts like a finalize on the request, so anything that trys to do something with it will cause an IllegalStateException. The problem I was having the other day related to lazy loading, after an invalidate, I could not initialize a new page because a new session could not be instantiated at that point, simply setting the property before the invalidate fixed that, the second issue was the use of the Response Tapestry service rather than HttpServletResponse, where the later cannot be tracked by Tapestry so there is a timing issue (like a race condition), hence using the first was the solution. Cheers, Peter - Original Message - From: Dave Dombrosky dom...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 05:46:16 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I'm also getting an exception after a session.invalidate() from an ActionLink and can confirm that it works in Jetty but fails in Tomcat. It would be nice to know if there is a workaround. Here's the exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Unknown Source) org.apache.catalina.connector.Request.getSession(Unknown Source) org.apache.catalina.connector.RequestFacade.getSession(Unknown Source) javax.servlet.http.HttpServletRequestWrapper.getSession(Unknown Source) org.apache.tapestry5.internal.services.RequestImpl.getSession(RequestImpl.java:99) $Request_11fda81101a.getSession($Request_11fda81101a.java) $Request_11fda810fec.getSession($Request_11fda810fec.java) org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.requestDidComplete(SessionApplicationStatePersistenceStrategy.java:126) org.apache.tapestry5.internal.services.EndOfRequestListenerHubImpl.fire(EndOfRequestListenerHubImpl.java:40) ... On Fri, Mar 6, 2009 at 6:47 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: I have same error, the reason is, I have a filer to trim off the long jsession IDs from url, solution was, I stopped using invalidate in the T5 side. however, according to Peter, this happens when you have a sendRedirect without a matching return true in a dispatcher, you can try that. Harald Geritzer-2 wrote: hi all, the following code causes IllegalStateExceptions on tomcat 6 while using jetty it works without errors. any idea? public URL onActionFromLinkLogoff() { User user = userDao.load(getVisit().getUserId()); auditDao.audit(AuditType.LOGOFF, user); String startPage = getVisit().getStartPage(); Session session = request.getSession(false); componentResources.discardPersistentFieldChanges(); if (null != session) session.invalidate(); try { return new URL(startPage); } catch (MalformedURLException e) { return null; } } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://www.nabble.com/-T5-5.0.18--java.lang.IllegalStateException%3A-Cannot-create-a-session-after-the-response-has-been-committed-tp22369307p22369465.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:
Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed
Also Tomcat throws an IllegalStateException when Jetty doesn't because there is an inconsistency between 2.3 compliant and 2.4 containers: Try: -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Peter Stavrinides p.stavrini...@albourne.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 11:30:05 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I have a filer to trim off the long jsession IDs from url You can do so, but IMHO that should never be necessary, the session id is encoded into the URL only once, and then removed by the container (that is if you have cookies enabled in the browser). It provides a backwards compatibility mechanism and support for devices that can't support cookies. The only other reason that it might be encoded request after request is if you are creating a new session with each request (a configuration problem that can happen for instance when you have a problem with your front end - Apache mod_rewrite), which is not mapping your cookie correctly to your back end (Tomcat / Jetty etc). Returning true is interpreted as a terminator for the request by your container, false allows the request to continue naturally, so if you call something like session.invalidate(), immediatly after call return true; to terminate, invalidate acts like a finalize on the request, so anything that trys to do something with it will cause an IllegalStateException. The problem I was having the other day related to lazy loading, after an invalidate, I could not initialize a new page because a new session could not be instantiated at that point, simply setting the property before the invalidate fixed that, the second issue was the use of the Response Tapestry service rather than HttpServletResponse, where the later cannot be tracked by Tapestry so there is a timing issue (like a race condition), hence using the first was the solution. Cheers, Peter - Original Message - From: Dave Dombrosky dom...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 05:46:16 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I'm also getting an exception after a session.invalidate() from an ActionLink and can confirm that it works in Jetty but fails in Tomcat. It would be nice to know if there is a workaround. Here's the exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Unknown Source) org.apache.catalina.connector.Request.getSession(Unknown Source) org.apache.catalina.connector.RequestFacade.getSession(Unknown Source) javax.servlet.http.HttpServletRequestWrapper.getSession(Unknown Source) org.apache.tapestry5.internal.services.RequestImpl.getSession(RequestImpl.java:99) $Request_11fda81101a.getSession($Request_11fda81101a.java) $Request_11fda810fec.getSession($Request_11fda810fec.java) org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.requestDidComplete(SessionApplicationStatePersistenceStrategy.java:126) org.apache.tapestry5.internal.services.EndOfRequestListenerHubImpl.fire(EndOfRequestListenerHubImpl.java:40) ... On Fri, Mar 6, 2009 at 6:47 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: I have same error, the reason is, I have a filer to trim off the long jsession IDs from url, solution was, I stopped using invalidate in the T5 side. however, according to Peter, this happens when you have a sendRedirect without a matching return true in a dispatcher, you can try that. Harald Geritzer-2 wrote: hi all, the following code causes IllegalStateExceptions on tomcat 6 while using jetty it works without errors. any idea? public URL onActionFromLinkLogoff() { User user = userDao.load(getVisit().getUserId()); auditDao.audit(AuditType.LOGOFF, user); String startPage = getVisit().getStartPage(); Session session = request.getSession(false); componentResources.discardPersistentFieldChanges(); if (null != session) session.invalidate(); try { return new URL(startPage); } catch (MalformedURLException e) { return null; } } - To
Re: generics and pages, components and edit blocks
Although you can't use generics directly, I presume you can define a subclass that inherits from a given generic superclass. For instance, class CrudPageT { // Stuff with T } class CustomerCrud extends CrudPageCustomer { } Would this work? I suppose if you used a generic service, then you would have to also instanciate it before using it: class CrudServiceT { /* stuff */ } abstract class CrudPageT { protected abstract CrudServiceT getCrudService(); } class CustomerCrudService extends CrudServiceCustomer { } class CustomerCrudPage extends CrudPageCustomer { @Inject private CustomerCrudService service; protected CustomerCrudService getCrudService() { return service; } } Jonathan On 09/03/2009 02:35, Luther Baker wrote: Yes. Maybe Tapestry 6 :) Given that the language keeps changing/moving forward, this seems like an odd thing to simply leave the user with ... I would guess that Templates, Components, Pages ... and the way we setup Services in AppModule would eventually want to consider techniques that wish to leverage Generics. Obviously, registering something like DataServiceMovie.class is illegal Java - so it may take a creative approach. Obviously from a page/component standpoing, there'd have to be a new convention for such beasts. Naively: note/EditBlock_Note idea/EditBlock_Idea And Services (interfaces and implementations) would be a completely different problem ... and with things like type erasure and backwards compatibility ... it all strikes me as an interesting issue. -Luther On Sun, Mar 8, 2009 at 6:55 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Sun, 08 Mar 2009 15:46:19 -0300, Luther Bakerlutherba...@gmail.com escreveu: Is there anyway to use generics as pages, components or edit blocks? No, because Tapestry uses the class name as URL. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5.1.0.0] Loop in Form problem introduced in T5.1.0.0
Hi, I have a loop in a form displaying non form information. An ajax call can update the source of the Loop. When the loop has less, or different items in it during submit then when the form was initiated, the following exception is thrown. Loop.RestoreStateFromStoredClientValue() seems to be causing this problem. My question; Why does the form care about restoring state of a Loop not containing any FormItems? Second, how can I fix this problem? I cannot pull my loop out of the form unfortunately. This seems to be a new problem introduced in 5.1.0.0 as in version 5.0.18 all works fine. Cheers, Joost -- debug and stack trace --- DEBUG 09 Mar 2009 17:29:14,186 [qtp0-3] org.apache.tapestry5.ioc.internal.services.MethodLogger.entry(MethodLogger.java:73) - [ENTER] onAction(org.apache.tapestry5.internal.emptyeventcont...@422f73) DEBUG 09 Mar 2009 17:29:14,187 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:458) - Processing actions: H4sIAM2TP2gUQRTGx0Bs0ohg6i1ikSJzieQ0nohZLptwctk7bs/IISizs2/3Ns7OrDOzJodgY6GFvZ0g2vmntTeFpLFR7AMiNoIoWin4chdRESRBCVftzLxv3/d7s98+ek9G1y6QjgFeaIhKhQFdWmCmGyqmo0rOEhCspwpLf1kKlSQQGctsYUKh+GVq1lLLuwYEcKs0ajVIa4RSudGEKp1QljPeBWpZDsbqXplypUGkIT6zXMltOa2jfqI81dh8PUmubY4Qsp4PF9tM583jT/HTl/f2hc3fE1sL61gKsDssapUF27uoKlKUrDBRwNSdZ69uEefbCDlQJ2P8Z8GSw/VVdpWVBJNJKbA6lcmp9dySm+hBV5Uy1vAuDgCShoVJJRjDoiyVNFMRCFpFEiZ788fieO7EScd3l72KczZwmkpbJpwFL6i2as12reFXHFkI4bQ7TVRUG8tN1+9capz3vZYTtN02HrrVdm3FS3E0fFdycCrOzPRwhWD2Yx5PLo0/PDOEAT0+fejD3MUHt08P2GIS/V82xrkq0K2/T5U0wDSWNSn/FTNkBqgb4iHjdjEFEU0EYIv86LmNsa0jz7/uRFJJq5XwWQZXyHUyuh3B8R3H4Idj0Hfcx8ncvU7W1IrjHxIUYZYag602nkSz8Ze7LwbfZIl4/0reZ0S0+d1mo89i/yR7u9X6fMO7/25w/9g2Q/lv939wYPYdYIg+ficGAAA= DEBUG 09 Mar 2009 17:29:14,190 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop Loop.PrepareForSubmission DEBUG 09 Mar 2009 17:29:14,191 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop Loop.ResetIndex DEBUG 09 Mar 2009 17:29:14,193 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop loop.restorestatefromstoredclientvalue[com.joostschouten.businessadmin.model.comp...@2ff879 NAME: JS Portal DESCRIPTION: null TYPE: COMPANY_OWNER STATE: ACTIVEimportance : 10] DEBUG 09 Mar 2009 17:29:14,200 [qtp0-3] org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:60) - Invoking constructor org.apache.tapestry5.ioc.internal.services.ExceptionTrackerImpl() (at ExceptionTrackerImpl.java:25) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:41). DEBUG 09 Mar 2009 17:29:14,201 [qtp0-3] org.apache.tapestry5.ioc.internal.services.MethodLogger.fail(MethodLogger.java:164) - [ FAIL] onAction -- org.apache.tapestry5.ioc.internal.util.TapestryException org.apache.tapestry5.ioc.internal.util.TapestryException: Could not find a coercion from type java.lang.String to type com.joostschouten.businessadmin.model.Account. at org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:492) at org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:375) at org.apache.tapestry5.corelib.components.Form$onAction$invocation_11fea8e560c.invokeAdvisedMethod(Form$onAction$invocation_11fea8e560c.java) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71) at org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:45) at org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80) at org.apache.tapestry5.corelib.components.Form.onAction(Form.java) at org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:910) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081) at org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75) at org.apache.tapestry5.internal.services.ImmediateActionRenderResponseFilter.handle(ImmediateActionRenderResponseFilter.java:42) at $ComponentEventRequestHandler_11fea8df99b.handle($ComponentEventRequestHandler_11fea8df99b.java) at
Re: jetty, tapestry and realms
It is easy to get this to work in Tomcat, Jetty should be similar... In Tomcat all you nee is two things: 1. A JDBC realm defined in server.xml Realm debug=1 className=org.apache.catalina.realm.JDBCRealm connectionURL=jdbc:postgresql://db.host.path/device connectionName=db_user connectionPassword=db_pass driverName=org.postgresql.Driver roleNameCol=role userCredCol=password userNameCol=username userRoleTable=authentication_table userTable=authentication_table/ 2. A role in web.xml /security-constraint login-config auth-methodBASIC/auth-method realm-nameMy App/realm-name /login-config security-role descriptionUsers/description role-nameuser/role-name /security-role I recall jetty is similar but used an external properties file, there is also a directive you can try if you use Maven: In your pom try: userRealms userRealm implementation=org.mortbay.jetty.security.JDBCUserRealm name Authentication JDBC Realm /name configsome_properties_file/config /userRealm /userRealms but I have not used this before. Peter - Original Message - From: Luther Baker lutherba...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 04:55:54 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: jetty, tapestry and realms Do Maven, Jetty, Realms and Tapestry play nice out of the box? App works just fine without any of the following - but after adding the below, I'm getting an error and I'm not sure what I'm missing. The error sure looks like it is *partly* working ... FORBIDDEN but the browser is NOT prompting me with a browser popup defined by auth-methodBASIC/auth-method. Thoughts? Thanks, -Luther HTTP ERROR 403 Problem accessing /notebook/Home. Reason: FORBIDDEN -- *Powered by Jetty:// * *web.xml* security-constraint web-resource-collection web-resource-namebasic-notebook-auth/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method http-methodPOST/http-method /web-resource-collection auth-constraint/ user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodBASIC/auth-method realm-name*notebook-realm*/realm-name /login-config *pom.xml* plugin groupIdorg.mortbay.jetty/groupId artifactIdmaven-jetty-plugin/artifactId configuration contextPathnotebook/contextPath connectors connector implementation=org.mortbay.jetty.nio.SelectChannelConnector port9090/port maxIdleTime6/maxIdleTime /connector /connectors userRealms userRealm implementation=org.mortbay.jetty.security.HashUserRealm name*notebook-realm*/name config src/main/config/jetty/notebook-hash-user-realm.properties/config /userRealm *src/main/config/jetty/notebook-hash-user-realm.properties* # # This file defines users passwords and roles for a HashUserRealm # # The format is # username: password[,rolename ...] # # Passwords may be clear text, obfuscated or checksummed. The class # org.mortbay.util.Password should be used to generate obfuscated # passwords or password checksums # testuser: secretpassword - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: apache configs to avoid subdirectory conflicts?
On Sat, Mar 7, 2009 at 8:30 AM, Howard Lewis Ship hls...@gmail.com wrote: My experience hasn't used mod_jk, just running a Tomcat instance and using Apache proxying: BTW mod_jk has been deprecated for a long time -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
Francois Armand wrote: Rico Landefeld wrote: Hello, I had the same annoying problem, but the patch works for me. But my question is: when will be a tapestry maintenance release which contains already this patch? btw, the same problem was solved in tapestry 4.1 long ago. I would like - much prefer in fact - a workaround that does not imply to have my own version of T5... Already does that some times ago for an UTF-8 problem in URLs, and it's a mess to maintain (pom with non standard T5 repos, etc.). So, if someone has a less disruptive workaround, I will be glad to hear it :) (nonetheless, I keep in mind this solution...) Nobody has a real solution ? (real being not patching the framework and maintaining by myself) What I need to do is to create a Window from the Window Prototype. And I'd like to choose the parameters for this object. The js Window object argument is a Javascript Array, with parameters : parameter : value. However some value are Javascript object, for instance showEffect : Element.show What Tapestry write when outputing the JSONObject is showEffect : Element.show. And Element.show is definitively not a JS object. So it fails. Any idea ? Regards, Nicolas - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: generics and pages, components and edit blocks
On Mon, Mar 9, 2009 at 7:04 AM, Jonathan O'Connor ninki...@eircom.net wrote: Although you can't use generics directly, I presume you can define a subclass that inherits from a given generic superclass. The approach you're describing works very well. Tapestry CRUD (http://www.arsmachina.com.br/project/tapestrycrud) uses that approach. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5: passing a form in the URL?
Hi, I have a page which has a form like this: t:form t:id=search input t:type=select t:id=category model=categorySelectModel t:value=category / input t:type=textfield t:id=name t:value=name / input t:type=submit name=Submit t:id=Submit / /t:form in the onSuccess event I'm doing: @InjectPage private ShowResults showResults; Object onSuccessFromSearch() { showResults.setlst(lst); return searchResults; } Instead of InjectPage, is there a way to push the form to ShowResults in the URL, something like what Google is doing: http://www.google.com/search?hl=enq=TapestrybtnG=Google+Searchmeta= Thanks, -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22412124.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
cross field validation with empty fields
Sorry to ask for this again, but I have seen no answer. I will get no answer again I will stop asking for this, of course. TIA Hello, we are using T4.1 We have to validate a form and we don't want to do it client side. Let say we have three text fields. The validation should implement the following rule: if (fielda=) (fieldb= || fieldc=) then throw new Exception(); The problem is that we cannot link the validation to neither field because they can be empty and the custom validator we are trying to implement is nevere called if the field is empty. We tried to follow the Identity validator but it is also not called when the field to which is associated is empty. Is there another way to accomplish cross field validation ? It seems to us that in T4.1 lacks a validator attribute for the form component. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: passing a form in the URL?
On Mon, Mar 9, 2009 at 9:22 AM, Angelo Chen angelochen...@yahoo.com.hk wrote: Instead of InjectPage, is there a way to push the form to ShowResults in the URL, something like what Google is doing: http://www.google.com/search?hl=enq=TapestrybtnG=Google+Searchmeta= Not automatically. Tapestry always uses POST to submit values, while Google search uses GET. On the other hand, you can use onPassivate() in SearchResults to return something similar: /searchresults/category/1/name/anything. If you want it for bookmarkability or SEO issues, it solves your problem. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0
Set volatile=true at the loop component to let the form not to restore the state. Thanks, DH - Original Message - From: Joost Schouten (mailing lists) joost...@jsportal.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 6:14 PM Subject: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0 Hi, I have a loop in a form displaying non form information. An ajax call can update the source of the Loop. When the loop has less, or different items in it during submit then when the form was initiated, the following exception is thrown. Loop.RestoreStateFromStoredClientValue() seems to be causing this problem. My question; Why does the form care about restoring state of a Loop not containing any FormItems? Second, how can I fix this problem? I cannot pull my loop out of the form unfortunately. This seems to be a new problem introduced in 5.1.0.0 as in version 5.0.18 all works fine. Cheers, Joost -- debug and stack trace --- DEBUG 09 Mar 2009 17:29:14,186 [qtp0-3] org.apache.tapestry5.ioc.internal.services.MethodLogger.entry(MethodLogger.java:73) - [ENTER] onAction(org.apache.tapestry5.internal.emptyeventcont...@422f73) DEBUG 09 Mar 2009 17:29:14,187 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:458) - Processing actions: H4sIAM2TP2gUQRTGx0Bs0ohg6i1ikSJzieQ0nohZLptwctk7bs/IISizs2/3Ns7OrDOzJodgY6GFvZ0g2vmntTeFpLFR7AMiNoIoWin4chdRESRBCVftzLxv3/d7s98+ek9G1y6QjgFeaIhKhQFdWmCmGyqmo0rOEhCspwpLf1kKlSQQGctsYUKh+GVq1lLLuwYEcKs0ajVIa4RSudGEKp1QljPeBWpZDsbqXplypUGkIT6zXMltOa2jfqI81dh8PUmubY4Qsp4PF9tM583jT/HTl/f2hc3fE1sL61gKsDssapUF27uoKlKUrDBRwNSdZ69uEefbCDlQJ2P8Z8GSw/VVdpWVBJNJKbA6lcmp9dySm+hBV5Uy1vAuDgCShoVJJRjDoiyVNFMRCFpFEiZ788fieO7EScd3l72KczZwmkpbJpwFL6i2as12reFXHFkI4bQ7TVRUG8tN1+9capz3vZYTtN02HrrVdm3FS3E0fFdycCrOzPRwhWD2Yx5PLo0/PDOEAT0+fejD3MUHt08P2GIS/V82xrkq0K2/T5U0wDSWNSn/FTNkBqgb4iHjdjEFEU0EYIv86LmNsa0jz7/uRFJJq5XwWQZXyHUyuh3B8R3H4Idj0Hfcx8ncvU7W1IrjHxIUYZYag602nkSz8Ze7LwbfZIl4/0reZ0S0+d1mo89i/yR7u9X6fMO7/25w/9g2Q/lv939wYPYdYIg+ficGAAA= DEBUG 09 Mar 2009 17:29:14,190 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop Loop.PrepareForSubmission DEBUG 09 Mar 2009 17:29:14,191 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop Loop.ResetIndex DEBUG 09 Mar 2009 17:29:14,193 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop loop.restorestatefromstoredclientvalue[com.joostschouten.businessadmin.model.comp...@2ff879 NAME: JS Portal DESCRIPTION: null TYPE: COMPANY_OWNER STATE: ACTIVEimportance : 10] DEBUG 09 Mar 2009 17:29:14,200 [qtp0-3] org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:60) - Invoking constructor org.apache.tapestry5.ioc.internal.services.ExceptionTrackerImpl() (at ExceptionTrackerImpl.java:25) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:41). DEBUG 09 Mar 2009 17:29:14,201 [qtp0-3] org.apache.tapestry5.ioc.internal.services.MethodLogger.fail(MethodLogger.java:164) - [ FAIL] onAction -- org.apache.tapestry5.ioc.internal.util.TapestryException org.apache.tapestry5.ioc.internal.util.TapestryException: Could not find a coercion from type java.lang.String to type com.joostschouten.businessadmin.model.Account. at org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:492) at org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:375) at org.apache.tapestry5.corelib.components.Form$onAction$invocation_11fea8e560c.invokeAdvisedMethod(Form$onAction$invocation_11fea8e560c.java) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:71) at org.apache.tapestry5.ioc.internal.services.LoggingAdvice.advise(LoggingAdvice.java:45) at org.apache.tapestry5.internal.transform.LogWorker$1.advise(LogWorker.java:54) at org.apache.tapestry5.internal.services.AbstractComponentMethodInvocation.proceed(AbstractComponentMethodInvocation.java:80) at org.apache.tapestry5.corelib.components.Form.onAction(Form.java) at org.apache.tapestry5.corelib.components.Form.dispatchComponentEvent(Form.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:910) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1081) at org.apache.tapestry5.internal.services.ComponentEventRequestHandlerImpl.handle(ComponentEventRequestHandlerImpl.java:75) at
Update a T5 zone componet from javascript.
Is there a way of triggering a zone update from Javascript? I need to run server side data validation if the data matches specify conditions. -- View this message in context: http://www.nabble.com/Update-a-T5-zone-componet-from-javascript.-tp22412979p22412979.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: external libraries an assets
On Mon, Mar 9, 2009 at 10:20 AM, Andrea Chiumenti kium...@gmail.com wrote: String dojoSource() default asset:../assets/dojot5/dojotoolkit/dojo-${dojo-release-version}/dojo/dojo.js; String djConfig() default parseOnLoad: true; } Try asset:classpath/net/sourceforge -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: external libraries an assets
no, or I haven't understood: asset:classpath/net/sourceforge/tapestryjfly/dojotapestry5/dojo-${dojo-release-version}/dojo/dojo.js gives Could not convert 'asset:classpath/net/sourceforge/tapestryjfly/dojotapestry5/dojo-1.2.3/dojo/dojo.js' into a component parameter binding: Unable to locate asset 'classpath:net/sourceforge/tapestryjfly/dojotapestry5demo/pages/classpath/net/sourceforge/tapestryjfly/dojotapestry5/dojo-1.2.3/dojo/dojo.js Shoud I really use (and only this) instead? classpath:net/sourceforge/tapestryjfly/dojotapestry5/dojo-1.2.3/dojo/dojo.js On Mon, Mar 9, 2009 at 2:24 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Mon, Mar 9, 2009 at 10:20 AM, Andrea Chiumenti kium...@gmail.com wrote: String dojoSource() default asset:../assets/dojot5/dojotoolkit/dojo-${dojo-release-version}/dojo/dojo.js; String djConfig() default parseOnLoad: true; } Try asset:classpath/net/sourceforge -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
toString method of JsonObject would double quote our value. One way is to create some data type extends jsonobject to encapsule your data and override the toString method. I haven't tried it yet. public String toString() { return Element.show; } Thanks, DH - Original Message - From: Nicolas Charles nchar...@linagora.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 7:35 PM Subject: Re: Tapestry JSONObject : no 'function' type, any workaround ? Francois Armand wrote: Rico Landefeld wrote: Hello, I had the same annoying problem, but the patch works for me. But my question is: when will be a tapestry maintenance release which contains already this patch? btw, the same problem was solved in tapestry 4.1 long ago. I would like - much prefer in fact - a workaround that does not imply to have my own version of T5... Already does that some times ago for an UTF-8 problem in URLs, and it's a mess to maintain (pom with non standard T5 repos, etc.). So, if someone has a less disruptive workaround, I will be glad to hear it :) (nonetheless, I keep in mind this solution...) Nobody has a real solution ? (real being not patching the framework and maintaining by myself) What I need to do is to create a Window from the Window Prototype. And I'd like to choose the parameters for this object. The js Window object argument is a Javascript Array, with parameters : parameter : value. However some value are Javascript object, for instance showEffect : Element.show What Tapestry write when outputing the JSONObject is showEffect : Element.show. And Element.show is definitively not a JS object. So it fails. Any idea ? Regards, Nicolas - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: passing a form in the URL?
Whether or not you can do this, I would be very very careful about where you do this. Passing form data on the url is one of the easier entry-points to a cross-site request forgery (CSRF) attack. While for something like a search (or any read-only operation) this isn't an issue, but if you are changing state, especially users' state, such as their contact e-mail address or password, this is how request pages get hijacked. Just a point to keep in mind. CSRF isn't impossible with a form post, but it's slightly harder to execute. Christian. On Mar 9, 2009, at 8:22 AM, wrote: Hi, I have a page which has a form like this: t:form t:id=search input t:type=select t:id=category model=categorySelectModel t:value=category / input t:type=textfield t:id=name t:value=name / input t:type=submit name=Submit t:id=Submit / /t:form in the onSuccess event I'm doing: @InjectPage private ShowResults showResults; Object onSuccessFromSearch() { showResults.setlst(lst); return searchResults; } Instead of InjectPage, is there a way to push the form to ShowResults in the URL, something like what Google is doing: http://www.google.com/search?hl=enq=TapestrybtnG=Google+Searchmeta= Thanks, -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22412124.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 Christian Edward Gruber christianedwardgru...@gmail.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: external libraries an assets
On Mon, Mar 9, 2009 at 10:32 AM, Andrea Chiumenti kium...@gmail.com wrote: no, or I haven't understood: I messed up. You shouldn't use asset: in an Asset annotation, obviously. Shoud I really use (and only this) instead? classpath:net/sourceforge/tapestryjfly/dojotapestry5/dojo-1.2.3/dojo/dojo.js I guess it should be classpath:/net (note the slash), so you don't have problems with relative paths. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: external libraries an assets
ok got this, but then how the following methos should be modified? public String getDojoSource(Page page) { if (this.dojoInitialization == null) { return null; } else { Binding b = bindingSource.newBinding(dojo binding source, page.getRootComponent().getComponentResources(), BindingConstants.ASSET, this.dojoInitialization.getDojoSource()); if (b.getBindingType().equals(Asset.class)) { return ((Asset) b.get()).toClientURL(); } else if (b.getBindingType().equals(String.class)) { //assume it's an external URI return b.get().toString(); } else { // ? throw new RuntimeException(Unable to parse dojoSource: \ + this.dojoInitialization.getDojoSource() + \); } } } On Mon, Mar 9, 2009 at 2:41 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Mon, Mar 9, 2009 at 10:32 AM, Andrea Chiumenti kium...@gmail.com wrote: no, or I haven't understood: I messed up. You shouldn't use asset: in an Asset annotation, obviously. Shoud I really use (and only this) instead? classpath:net/sourceforge/tapestryjfly/dojotapestry5/dojo-1.2.3/dojo/dojo.js I guess it should be classpath:/net (note the slash), so you don't have problems with relative paths. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
ningdh wrote: toString method of JsonObject would double quote our value. One way is to create some data type extends jsonobject to encapsule your data and override the toString method. I haven't tried it yet. But JSONObject and JSONArray are final, that's not possible - it was my first plan. How can I workaround that ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- http://fanf42.blogspot.com InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
Not aware of that, sorry. In my window component, I hack to replace double quote of all function to empty. JSONObject options= new JSONObject(); options.put(showEffect, TO_BE_REPLACE + this.showEffect+TO_BE_REPLACE); getPageRenderSupport().addScript(%s = new Window(%s);, getUniqueId(), filterJsFunction(options.toString())); private String filterJsFunction(String jsonString) { // function begin jsonString = jsonString.replaceAll(\TO_BE_REPLACE, ); // function end jsonString = jsonString.replaceAll(TO_BE_REPLACE\, ); return jsonString; } Well, a bit stupid, but works. DH - Original Message - From: Francois Armand farm...@linagora.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 9:51 PM Subject: Re: Tapestry JSONObject : no 'function' type, any workaround ? ningdh wrote: toString method of JsonObject would double quote our value. One way is to create some data type extends jsonobject to encapsule your data and override the toString method. I haven't tried it yet. But JSONObject and JSONArray are final, that's not possible - it was my first plan. How can I workaround that ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- http://fanf42.blogspot.com InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tabindex and accesskey in BeanEditForm?
Thanks Luther, But I'm still a bit new to this and can't quite figure out what to do based on the example provided in the link you gave. I've implemented DataTypeAnalyzer but I don't know what to do in the identifyDataType method. It seems like all this does is give back a type. How do I create my own type? Also how do I set the tabindex and accesskey values? Maybe if I saw a more concrete example I'd understand it better, how did you go about solving your problem? Any example code would be extremely helpful. Thanks for any help you can give! -Nate luther.baker wrote: Take a look at Thiago's response to my *similar* question earlier today: http://www.nabble.com/t%3ATextField-and-t%3ATextArea-to22375618.html -Luther -- View this message in context: http://www.nabble.com/Tabindex-and-accesskey-in-BeanEditForm--tp22380749p22413416.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 JSONObject : no 'function' type, any workaround ?
ningdh wrote: Not aware of that, sorry. No problem, I didn't want to be harsh :) In my window component, I hack to replace double quote of all function to empty. JSONObject options= new JSONObject(); options.put(showEffect, TO_BE_REPLACE + this.showEffect+TO_BE_REPLACE); [...] It's exactly what I'm doing for now, I wanted to know if there were others simpler/nicer solution. Thank you very much for your help, I will stand with that for now. -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- http://fanf42.blogspot.com InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Update a T5 zone componet from javascript.
Yes, there is a way. Search the list, it has been discussed just a few days ago. The thread was about T5 javascript. Andy Michael Williamson schrieb: Is there a way of triggering a zone update from Javascript? I need to run server side data validation if the data matches specify conditions. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tabindex and accesskey in BeanEditForm?
On Mon, Mar 9, 2009 at 11:19 AM, leechj lee...@gmail.com wrote: Thanks Luther, But I'm still a bit new to this and can't quite figure out what to do based on the example provided in the link you gave. I've implemented DataTypeAnalyzer but I don't know what to do in the identifyDataType method. It seems like all this does is give back a type. How do I create my own type? Also how do I set the tabindex and accesskey values? Maybe if I saw a more concrete example I'd understand it better, how did you go about solving your problem? Any example code would be extremely helpful. Thanks for any help you can give! -Nate luther.baker wrote: Take a look at Thiago's response to my *similar* question earlier today: http://www.nabble.com/t%3ATextField-and-t%3ATextArea-to22375618.html -Luther -- View this message in context: http://www.nabble.com/Tabindex-and-accesskey-in-BeanEditForm--tp22380749p22413416.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 -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: external libraries an assets
np, found solution using AssetSource service On Mon, Mar 9, 2009 at 2:44 PM, Andrea Chiumenti kium...@gmail.com wrote: ok got this, but then how the following methos should be modified? public String getDojoSource(Page page) { if (this.dojoInitialization == null) { return null; } else { Binding b = bindingSource.newBinding(dojo binding source, page.getRootComponent().getComponentResources(), BindingConstants.ASSET, this.dojoInitialization.getDojoSource()); if (b.getBindingType().equals(Asset.class)) { return ((Asset) b.get()).toClientURL(); } else if (b.getBindingType().equals(String.class)) { //assume it's an external URI return b.get().toString(); } else { // ? throw new RuntimeException(Unable to parse dojoSource: \ + this.dojoInitialization.getDojoSource() + \); } } } On Mon, Mar 9, 2009 at 2:41 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Mon, Mar 9, 2009 at 10:32 AM, Andrea Chiumenti kium...@gmail.com wrote: no, or I haven't understood: I messed up. You shouldn't use asset: in an Asset annotation, obviously. Shoud I really use (and only this) instead? classpath:net/sourceforge/tapestryjfly/dojotapestry5/dojo-1.2.3/dojo/dojo.js I guess it should be classpath:/net (note the slash), so you don't have problems with relative paths. -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
For json responses, i think it's good that the json is strict (i.e. no objects or callbacks allowed as values) For constructing js objects to be included in the html (to configure other js components) it's clear that JSONObject isn't the correct answer (json != js object) Probably the autocmplete mixin needs to use a 'new' JsObject class On Mon, Mar 9, 2009 at 4:10 PM, ningdh ningd...@gmail.com wrote: Not aware of that, sorry. In my window component, I hack to replace double quote of all function to empty. JSONObject options= new JSONObject(); options.put(showEffect, TO_BE_REPLACE + this.showEffect+TO_BE_REPLACE); getPageRenderSupport().addScript(%s = new Window(%s);, getUniqueId(), filterJsFunction(options.toString())); private String filterJsFunction(String jsonString) { // function begin jsonString = jsonString.replaceAll(\TO_BE_REPLACE, ); // function end jsonString = jsonString.replaceAll(TO_BE_REPLACE\, ); return jsonString; } Well, a bit stupid, but works. DH - Original Message - From: Francois Armand farm...@linagora.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 9:51 PM Subject: Re: Tapestry JSONObject : no 'function' type, any workaround ? ningdh wrote: toString method of JsonObject would double quote our value. One way is to create some data type extends jsonobject to encapsule your data and override the toString method. I haven't tried it yet. But JSONObject and JSONArray are final, that's not possible - it was my first plan. How can I workaround that ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- http://fanf42.blogspot.com InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
I have a solution :) I needed it to make my own autocomplete /** * */ package tapestryutil.mixins; /** Workarround to add raw content to JSON, like function references and such. * Number instances are not quoted and are trusted, so we use it.*/ final class JSONRaw extends Number { private final String rawText; JSONRaw(String rawText) { this.rawText = rawText; } @Override public double doubleValue() {return 0;} @Override public float floatValue() {return 0;} @Override public int intValue() {return 0;} @Override public long longValue() {return 0;} @Override public String toString() { return rawText; } } On Mon, Mar 9, 2009 at 3:33 PM, Andreas Andreou andy...@di.uoa.gr wrote: For json responses, i think it's good that the json is strict (i.e. no objects or callbacks allowed as values) For constructing js objects to be included in the html (to configure other js components) it's clear that JSONObject isn't the correct answer (json != js object) Probably the autocmplete mixin needs to use a 'new' JsObject class On Mon, Mar 9, 2009 at 4:10 PM, ningdh ningd...@gmail.com wrote: Not aware of that, sorry. In my window component, I hack to replace double quote of all function to empty. JSONObject options= new JSONObject(); options.put(showEffect, TO_BE_REPLACE + this.showEffect+TO_BE_REPLACE); getPageRenderSupport().addScript(%s = new Window(%s);, getUniqueId(), filterJsFunction(options.toString())); private String filterJsFunction(String jsonString) { // function begin jsonString = jsonString.replaceAll(\TO_BE_REPLACE, ); // function end jsonString = jsonString.replaceAll(TO_BE_REPLACE\, ); return jsonString; } Well, a bit stupid, but works. DH - Original Message - From: Francois Armand farm...@linagora.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 9:51 PM Subject: Re: Tapestry JSONObject : no 'function' type, any workaround ? ningdh wrote: toString method of JsonObject would double quote our value. One way is to create some data type extends jsonobject to encapsule your data and override the toString method. I haven't tried it yet. But JSONObject and JSONArray are final, that's not possible - it was my first plan. How can I workaround that ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- http://fanf42.blogspot.com InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: hi, about the remotelink minixs
thx Alex. I'm mading less round wheel. Nile Black - 每天一个小时debian. 2009/3/7 Alex Kotchnev akoch...@gmail.com Nile, do re-read the T5 docs (e.g. http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ActionLink.html , ), I think what you're trying to accomplish with your remotelink mixin is already being accomplished w/ zones: t:actionLink t:id=foo t:zone=barZoneAjaxy goodness/t:actionlink t:zone t:id=barZone !-- the stuff here will be updated with the content of the block -- /t:zone t:block t:id=updateBlock !-- this is the stuff that you want to show up when you click on the link in the barZone -- /t:block then, in your code: @Component private Block updateBlock public onActionFromFoo() { return updateBlock; } Cheers, Alex Kotchnev On Thu, Mar 5, 2009 at 4:51 AM, nile black nile.bl...@gmail.com wrote: miss attachments Nile Black - 每天一个小时debian. On Wed, Mar 4, 2009 at 10:37 PM, nile black nile.bl...@gmail.com wrote: hi i write a simple minixs call remotelink, it look like grails's remotelink. maybe minixs greate! you can simple use a href=# t:id=showme t:type=actionlink t:update=result t:mixins=remotelinkaction/a a href=# t:page=index t:type=pagelink t:update=result t:mixins=remotelinkpage/a div id=resultresult will show here./div but i confused by the return. My first question is : what should ajax action return? json? html fragment? xml? One of t5's benefit is you can use dreamweaver edit the tml”. In example code, pagelink work fine. because it return html. but actionlink is not perfect. My seconde question is : how to return html fragment in action. Nile Black - 每天一个小时debian. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: cross field validation with empty fields
Ivano, I'm pretty sure what you want to do is provide an onValidate method in your page class. That method gets called expressly for doing more complicated validation. If you have more than one form, you'll have to further specify it e.g. onValidateFromMyFormName (or use @OnEvent annotation). Here's some abbreviated code: @InjectComponent(fielda) private TextField fieldaComponent; @InjectComponent private Form formComponent; ... Object onValidate() { If (fielda == null) formComponent.recordError(fieldaComponent, Example error message for fielda); if (fielda==) (fieldb== || fieldc==) throw new RuntimeException(); return null; // this will keep you on the same page //return NewPage.class; // this will goto the NewPage page, etc. etc. } You may just want to provide a validation message. I've shown an example using fielda in the preceding code. Read the docs on the Form component, and see the examples in the user guide. Cheers -Original Message- From: Ivano Luberti [mailto:lube...@archicoop.it] Sent: Monday, March 09, 2009 8:30 AM To: Tapestry users Subject: cross field validation with empty fields Sorry to ask for this again, but I have seen no answer. I will get no answer again I will stop asking for this, of course. TIA Hello, we are using T4.1 We have to validate a form and we don't want to do it client side. Let say we have three text fields. The validation should implement the following rule: if (fielda=) (fieldb= || fieldc=) then throw new Exception(); The problem is that we cannot link the validation to neither field because they can be empty and the custom validator we are trying to implement is nevere called if the field is empty. We tried to follow the Identity validator but it is also not called when the field to which is associated is empty. Is there another way to accomplish cross field validation ? It seems to us that in T4.1 lacks a validator attribute for the form component. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org This message (including any attachments) is intended only for the use of the individual or entity to whom it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if an electronic communication. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry JSONObject : no 'function' type, any workaround ?
I love it ! Thank you, you made my day ! Davor Hrg wrote: I have a solution :) I needed it to make my own autocomplete /** * */ package tapestryutil.mixins; /** Workarround to add raw content to JSON, like function references and such. * Number instances are not quoted and are trusted, so we use it.*/ final class JSONRaw extends Number { private final String rawText; JSONRaw(String rawText) { this.rawText = rawText; } @Override public double doubleValue() {return 0;} @Override public float floatValue() {return 0;} @Override public int intValue() {return 0;} @Override public long longValue() {return 0;} @Override public String toString() { return rawText; } } On Mon, Mar 9, 2009 at 3:33 PM, Andreas Andreou andy...@di.uoa.gr wrote: For json responses, i think it's good that the json is strict (i.e. no objects or callbacks allowed as values) For constructing js objects to be included in the html (to configure other js components) it's clear that JSONObject isn't the correct answer (json != js object) Probably the autocmplete mixin needs to use a 'new' JsObject class On Mon, Mar 9, 2009 at 4:10 PM, ningdh ningd...@gmail.com wrote: Not aware of that, sorry. In my window component, I hack to replace double quote of all function to empty. JSONObject options= new JSONObject(); options.put(showEffect, TO_BE_REPLACE + this.showEffect+TO_BE_REPLACE); getPageRenderSupport().addScript(%s = new Window(%s);, getUniqueId(), filterJsFunction(options.toString())); private String filterJsFunction(String jsonString) { // function begin jsonString = jsonString.replaceAll(\TO_BE_REPLACE, ); // function end jsonString = jsonString.replaceAll(TO_BE_REPLACE\, ); return jsonString; } Well, a bit stupid, but works. DH - Original Message - From: Francois Armand farm...@linagora.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 9:51 PM Subject: Re: Tapestry JSONObject : no 'function' type, any workaround ? ningdh wrote: toString method of JsonObject would double quote our value. One way is to create some data type extends jsonobject to encapsule your data and override the toString method. I haven't tried it yet. But JSONObject and JSONArray are final, that's not possible - it was my first plan. How can I workaround that ? -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- http://fanf42.blogspot.com InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Inherit prefix in templates
Hi all, Prior to 5.1 in places I used the prefix inherit: in my templates which seemed to work quite well. Although it is not listed as a standard binding prefix, it is used as a special case... a mention of it is made here: http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html In 5.1 it seems that it no longer working as I expected, I get the feeling I should no longer be duplicating the property in parent and child, but I have looked through the release notes but could not find any clue as to what may have changed. I also noticed this: http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/Component.html#publishParameters(), so I am wandering what the correct approach is now. Here is an example for clarity. In my containing component is the following method, which is also duplicated in the child component: @Parameter(name = contextVariables) private List? contextVariables_; And then I have for example in my tml: t:header contextVariables=inherit:contextVariables/ So I could propagate these parameters... I also use a custom annotation to bind these parameters whenever I need them, for example I have a bread-crumb component that uses them as follows: @Target(TYPE) @Retention(RUNTIME) @Documented public @interface ContextVariables { ... } Any help on fixing this would be greatly appreciated! Thanks, Peter - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Inherit prefix in templates
Looks like this is related to: https://issues.apache.org/jira/browse/TAP5-487 See the bottom of this page: http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html for more details. However, if, in fact, inherit is no longer functional, that would still represent a regression, and you should submit a bug report, attaching, at a minimum, a sample project that illustrates the problem. Robert On Mar 9, 2009, at 3/910:29 AM , Peter Stavrinides wrote: Hi all, Prior to 5.1 in places I used the prefix inherit: in my templates which seemed to work quite well. Although it is not listed as a standard binding prefix, it is used as a special case... a mention of it is made here: http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html In 5.1 it seems that it no longer working as I expected, I get the feeling I should no longer be duplicating the property in parent and child, but I have looked through the release notes but could not find any clue as to what may have changed. I also noticed this: http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/Component.html#publishParameters() , so I am wandering what the correct approach is now. Here is an example for clarity. In my containing component is the following method, which is also duplicated in the child component: @Parameter(name = contextVariables) private List? contextVariables_; And then I have for example in my tml: t:header contextVariables=inherit:contextVariables/ So I could propagate these parameters... I also use a custom annotation to bind these parameters whenever I need them, for example I have a bread-crumb component that uses them as follows: @Target(TYPE) @Retention(RUNTIME) @Documented public @interface ContextVariables { ... } Any help on fixing this would be greatly appreciated! Thanks, Peter - 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
base64 + url encoded activation context parameter
Hi, I wanted to send users an email with a confirmation link which includes base64 encoded and additionally url encoded activation context Example: http://my.company.com/account/confirmed/amFuZXpuOu47TZYaxgNZ297XcGQFHLQ%3D As base64 includes characters + / and = I tried to encode it further with URLCodec (apache commons codec) so it looks like the above example. But the Tapestry complains with java.lang.IllegalArgumentException Input string 'amFuZXpuOu47TZYaxgNZ297XcGQFHLQ=' is not valid; the character '=' at position 32 is not valid. which I can understand as it decodes the link automatically Stack trace * org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143) * org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88) What is the cleanest solution? Is there a known url safe encoder/decoder which I can use or do I have to write one myself? Regards, Borut - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: cross field validation with empty fields
I'm not familiar worth T4.1 but it seems to me that you could put something in the submit or success handler that validates. Take a look here - http://tapestry.apache.org/tapestry5/guide/validation.html and find the following snippet: public class Login { *String onSuccess() { if (!authenticator.isValid(userName, password)) { form.recordError(passwordField, Invalid user name or password.); return null; }* return PostLogin; } Oddly enough, it is NOT the validation handler I want to bring to your attention to (here on this validation.html page :) and again, obviously, this is Tapestry 5 - but notice how authentication is done in the SUCCESS handler. I would try to do something similar (albeit validation) to look at the fields you are processing. It'd be manual ... but notice here - an error is returned and associated with T5 fields ... Again - you'll need to find T4s parallel. -Luther On Mon, Mar 9, 2009 at 10:04 AM, Elmer Smith esm...@venterraliving.comwrote: Ivano, I'm pretty sure what you want to do is provide an onValidate method in your page class. That method gets called expressly for doing more complicated validation. If you have more than one form, you'll have to further specify it e.g. onValidateFromMyFormName (or use @OnEvent annotation). Here's some abbreviated code: @InjectComponent(fielda) private TextField fieldaComponent; @InjectComponent private Form formComponent; ... Object onValidate() { If (fielda == null) formComponent.recordError(fieldaComponent, Example error message for fielda); if (fielda==) (fieldb== || fieldc==) throw new RuntimeException(); return null; // this will keep you on the same page //return NewPage.class; // this will goto the NewPage page, etc. etc. } You may just want to provide a validation message. I've shown an example using fielda in the preceding code. Read the docs on the Form component, and see the examples in the user guide. Cheers -Original Message- From: Ivano Luberti [mailto:lube...@archicoop.it] Sent: Monday, March 09, 2009 8:30 AM To: Tapestry users Subject: cross field validation with empty fields Sorry to ask for this again, but I have seen no answer. I will get no answer again I will stop asking for this, of course. TIA Hello, we are using T4.1 We have to validate a form and we don't want to do it client side. Let say we have three text fields. The validation should implement the following rule: if (fielda=) (fieldb= || fieldc=) then throw new Exception(); The problem is that we cannot link the validation to neither field because they can be empty and the custom validator we are trying to implement is nevere called if the field is empty. We tried to follow the Identity validator but it is also not called when the field to which is associated is empty. Is there another way to accomplish cross field validation ? It seems to us that in T4.1 lacks a validator attribute for the form component. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org This message (including any attachments) is intended only for the use of the individual or entity to whom it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if an electronic communication. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: cross field validation with empty fields
Em Mon, 09 Mar 2009 14:08:43 -0300, Luther Baker lutherba...@gmail.com escreveu: Oddly enough, it is NOT the validation handler I want to bring to your attention to (here on this validation.html page :) and again, obviously, this is Tapestry 5 - but notice how authentication is done in the SUCCESS handler. Authentication is not validation. They're different things. Authentication is made at onSuccess() because it is only made after the form validation (ie the values of login and password are valid for that field). And you should do validation at onValidate(). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: cross field validation with empty fields
Oh sorry, didn't mean to confuse things. I got the impression he was asking about field validation, not authentication. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: Monday, March 09, 2009 1:15 PM To: Tapestry users Subject: Re: cross field validation with empty fields Em Mon, 09 Mar 2009 14:08:43 -0300, Luther Baker lutherba...@gmail.com escreveu: Oddly enough, it is NOT the validation handler I want to bring to your attention to (here on this validation.html page :) and again, obviously, this is Tapestry 5 - but notice how authentication is done in the SUCCESS handler. Authentication is not validation. They're different things. Authentication is made at onSuccess() because it is only made after the form validation (ie the values of login and password are valid for that field). And you should do validation at onValidate(). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org This message (including any attachments) is intended only for the use of the individual or entity to whom it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if an electronic communication. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: cross field validation with empty fields
That's a fine point to clarify. My underlying suggestion wasn't meant to imply which was the correct, well-defined event to handle. This is the second post ... no luck/help so far? ... So my suggestion is that, if all else fails, you can do MANUAL validation in, if nothing else, the MAIN event handler. Again, I didn't mean to focus on the actual event as much as the ability to MANUALLY validate and still send back field specific error messages. To Thiago's point, if taken too literally, yes, the example could be misleading. But it is a minor point. The login example on the Tapestry website happens to do AUTHENTICATION in the SUCCESS handler (oddly, as part of a validation example) - and so it is a nice concrete example to send around - but lest I am misunderstood, it is the general concept I'm trying to shed some light on ... not whether it is authentication or validation or onValidate or onSuccess. FWIW: since no one posted any response to the poster's original question (per the poster) and this is the 2nd time he's asked - I assumed that what he is doing must be out of the ordinary. I do nto know T4 and the fact that (per the user) 'null' values in the form skipped validation - made me wonder if the onValidate event was being skipped (as a part of T4). @Elmer: so conceptually, you could start by implementing this validation MANUALLY in the MAIN method and work backwards from there. IE: start with something you KNOW fires and keep moving that logic backwards until you get it into a true, validation handler if at all possible. It is an iterative, workable approach eh? But to Thiago's point, if T4 has specific validation events/handlers and those fire in all cases - by all means, implement this logic there (dont' need to start in the main event handler). You can still follow the general logic/structure of the authentication example I linked to. Please excuse the rambling here ... hope the clarification was helpful. -Luther On Mon, Mar 9, 2009 at 12:15 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 09 Mar 2009 14:08:43 -0300, Luther Baker lutherba...@gmail.com escreveu: Oddly enough, it is NOT the validation handler I want to bring to your attention to (here on this validation.html page :) and again, obviously, this is Tapestry 5 - but notice how authentication is done in the SUCCESS handler. Authentication is not validation. They're different things. Authentication is made at onSuccess() because it is only made after the form validation (ie the values of login and password are valid for that field). And you should do validation at onValidate(). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: cross field validation with empty fields
My experience was with 4.0. You want to look at the ValidationDelegate. @Bean public abstract ValidationDelegate getDelegate(); // set up as listener for form public void onSubmit(IRequestCycle cycle){ ValidationDelegate = getDelegate(); (if (delegate.getHasErrors()) return; if (StringUtils.isBlank(fieldA) (StringUtils.isBlank(fieldB)||StringUtils.isBlank(fieldC))){ delegate.setFormComponent(null); delegate.record(Cross form vaildation failed); return; } else { cycle.activate(SomeOtherPage); } ) On Mon, Mar 9, 2009 at 7:29 AM, Ivano Luberti lube...@archicoop.it wrote: Sorry to ask for this again, but I have seen no answer. I will get no answer again I will stop asking for this, of course. TIA Hello, we are using T4.1 We have to validate a form and we don't want to do it client side. Let say we have three text fields. The validation should implement the following rule: if (fielda=) (fieldb= || fieldc=) then throw new Exception(); The problem is that we cannot link the validation to neither field because they can be empty and the custom validator we are trying to implement is nevere called if the field is empty. We tried to follow the Identity validator but it is also not called when the field to which is associated is empty. Is there another way to accomplish cross field validation ? It seems to us that in T4.1 lacks a validator attribute for the form component. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Jonathan Barker ITStrategic - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: cross field validation with empty fields
Oops sorry @Elmer, I mistyped your name in the previous post and meant @Ivano. Also, @Elmo, I think you're suggestion was perfect! but it looked like T5 code. Shows how little I know about T4 though. Sorry - I think your post was right on if all those annotations and events were in T4. -Luther I meant my latest suggestion to be @Ivano On Mon, Mar 9, 2009 at 12:44 PM, Luther Baker lutherba...@gmail.com wrote: That's a fine point to clarify. My underlying suggestion wasn't meant to imply which was the correct, well-defined event to handle. This is the second post ... no luck/help so far? ... So my suggestion is that, if all else fails, you can do MANUAL validation in, if nothing else, the MAIN event handler. Again, I didn't mean to focus on the actual event as much as the ability to MANUALLY validate and still send back field specific error messages. To Thiago's point, if taken too literally, yes, the example could be misleading. But it is a minor point. The login example on the Tapestry website happens to do AUTHENTICATION in the SUCCESS handler (oddly, as part of a validation example) - and so it is a nice concrete example to send around - but lest I am misunderstood, it is the general concept I'm trying to shed some light on ... not whether it is authentication or validation or onValidate or onSuccess. FWIW: since no one posted any response to the poster's original question (per the poster) and this is the 2nd time he's asked - I assumed that what he is doing must be out of the ordinary. I do nto know T4 and the fact that (per the user) 'null' values in the form skipped validation - made me wonder if the onValidate event was being skipped (as a part of T4). @Elmer: so conceptually, you could start by implementing this validation MANUALLY in the MAIN method and work backwards from there. IE: start with something you KNOW fires and keep moving that logic backwards until you get it into a true, validation handler if at all possible. It is an iterative, workable approach eh? But to Thiago's point, if T4 has specific validation events/handlers and those fire in all cases - by all means, implement this logic there (dont' need to start in the main event handler). You can still follow the general logic/structure of the authentication example I linked to. Please excuse the rambling here ... hope the clarification was helpful. -Luther On Mon, Mar 9, 2009 at 12:15 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 09 Mar 2009 14:08:43 -0300, Luther Baker lutherba...@gmail.com escreveu: Oddly enough, it is NOT the validation handler I want to bring to your attention to (here on this validation.html page :) and again, obviously, this is Tapestry 5 - but notice how authentication is done in the SUCCESS handler. Authentication is not validation. They're different things. Authentication is made at onSuccess() because it is only made after the form validation (ie the values of login and password are valid for that field). And you should do validation at onValidate(). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: base64 + url encoded activation context parameter
compare this thread... http://tapestry.markmail.org/search/?q=list%3Aorg.apache.tapestry.users+url+#query:list%3Aorg.apache.tapestry.users%20url%20+page:1+mid:kbv6yrkcjmkaaoys+state:results Borut Bolčina schrieb: Hi, I wanted to send users an email with a confirmation link which includes base64 encoded and additionally url encoded activation context Example: http://my.company.com/account/confirmed/amFuZXpuOu47TZYaxgNZ297XcGQFHLQ%3D As base64 includes characters + / and = I tried to encode it further with URLCodec (apache commons codec) so it looks like the above example. But the Tapestry complains with java.lang.IllegalArgumentException Input string 'amFuZXpuOu47TZYaxgNZ297XcGQFHLQ=' is not valid; the character '=' at position 32 is not valid. which I can understand as it decodes the link automatically Stack trace * org.apache.tapestry5.internal.services.URLEncoderImpl.decode(URLEncoderImpl.java:143) * org.apache.tapestry5.internal.services.ContextPathEncoderImpl.decodePath(ContextPathEncoderImpl.java:70) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:88) What is the cleanest solution? Is there a known url safe encoder/decoder which I can use or do I have to write one myself? Regards, Borut - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: cross field validation with empty fields
All very good comments Luther (np about the name :)) and everyone else. Here is 4.0 code that does the same thing: public void onFormSubmit(IRequestCycle requestCycle) { IValidationDelegate delegate = getDelegate(); // this checks if the automatic validations you have on your // fields (like required) have recorded any errors; // if they have you can skip your manual logic if (!getDelegate().getHasErrors()) { // whatever test you want to make on the field value if (fielda == null) { delegate.setFormComponent(getFieldaComponent()); delegate.record(Example error message for fielda); } // you can throw from here if you want if (fielda==) (fieldb== || fieldc==) throw new RuntimeException(); // // you can use the requestCycle to forward to other pages // or throw a RedirectException } } I just thought the poster might still be pondering what to do in T4. Cheers, Elmer -Original Message- From: Luther Baker [mailto:lutherba...@gmail.com] Sent: Monday, March 09, 2009 1:49 PM To: Tapestry users Subject: Re: cross field validation with empty fields Oops sorry @Elmer, I mistyped your name in the previous post and meant @Ivano. Also, @Elmo, I think you're suggestion was perfect! but it looked like T5 code. Shows how little I know about T4 though. Sorry - I think your post was right on if all those annotations and events were in T4. -Luther I meant my latest suggestion to be @Ivano On Mon, Mar 9, 2009 at 12:44 PM, Luther Baker lutherba...@gmail.com wrote: That's a fine point to clarify. My underlying suggestion wasn't meant to imply which was the correct, well-defined event to handle. This is the second post ... no luck/help so far? ... So my suggestion is that, if all else fails, you can do MANUAL validation in, if nothing else, the MAIN event handler. Again, I didn't mean to focus on the actual event as much as the ability to MANUALLY validate and still send back field specific error messages. To Thiago's point, if taken too literally, yes, the example could be misleading. But it is a minor point. The login example on the Tapestry website happens to do AUTHENTICATION in the SUCCESS handler (oddly, as part of a validation example) - and so it is a nice concrete example to send around - but lest I am misunderstood, it is the general concept I'm trying to shed some light on ... not whether it is authentication or validation or onValidate or onSuccess. FWIW: since no one posted any response to the poster's original question (per the poster) and this is the 2nd time he's asked - I assumed that what he is doing must be out of the ordinary. I do nto know T4 and the fact that (per the user) 'null' values in the form skipped validation - made me wonder if the onValidate event was being skipped (as a part of T4). @Elmer: so conceptually, you could start by implementing this validation MANUALLY in the MAIN method and work backwards from there. IE: start with something you KNOW fires and keep moving that logic backwards until you get it into a true, validation handler if at all possible. It is an iterative, workable approach eh? But to Thiago's point, if T4 has specific validation events/handlers and those fire in all cases - by all means, implement this logic there (dont' need to start in the main event handler). You can still follow the general logic/structure of the authentication example I linked to. Please excuse the rambling here ... hope the clarification was helpful. -Luther On Mon, Mar 9, 2009 at 12:15 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Mon, 09 Mar 2009 14:08:43 -0300, Luther Baker lutherba...@gmail.com escreveu: Oddly enough, it is NOT the validation handler I want to bring to your attention to (here on this validation.html page :) and again, obviously, this is Tapestry 5 - but notice how authentication is done in the SUCCESS handler. Authentication is not validation. They're different things. Authentication is made at onSuccess() because it is only made after the form validation (ie the values of login and password are valid for that field). And you should do validation at onValidate(). -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org This message (including any attachments) is intended only for the use of the individual or entity to whom it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute attorney work product. If you are not the intended recipient, you are hereby notified that any use,
Re: cross field validation with empty fields
Cool beans. Literally :) On Mon, Mar 9, 2009 at 12:49 PM, Jonathan Barker jonathan.theit...@gmail.com wrote: My experience was with 4.0. You want to look at the ValidationDelegate. @Bean public abstract ValidationDelegate getDelegate(); // set up as listener for form public void onSubmit(IRequestCycle cycle){ ValidationDelegate = getDelegate(); (if (delegate.getHasErrors()) return; if (StringUtils.isBlank(fieldA) (StringUtils.isBlank(fieldB)||StringUtils.isBlank(fieldC))){ delegate.setFormComponent(null); delegate.record(Cross form vaildation failed); return; } else { cycle.activate(SomeOtherPage); } ) On Mon, Mar 9, 2009 at 7:29 AM, Ivano Luberti lube...@archicoop.it wrote: Sorry to ask for this again, but I have seen no answer. I will get no answer again I will stop asking for this, of course. TIA Hello, we are using T4.1 We have to validate a form and we don't want to do it client side. Let say we have three text fields. The validation should implement the following rule: if (fielda=) (fieldb= || fieldc=) then throw new Exception(); The problem is that we cannot link the validation to neither field because they can be empty and the custom validator we are trying to implement is nevere called if the field is empty. We tried to follow the Identity validator but it is also not called when the field to which is associated is empty. Is there another way to accomplish cross field validation ? It seems to us that in T4.1 lacks a validator attribute for the form component. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Jonathan Barker ITStrategic - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: cross field validation with empty fields
Thanks Elmer. And ugh ... sorry for the previous typo @Elmo, (Cool Beans was @Jonathan for his Bean example - but got out of order in this thread). -Luther On Mon, Mar 9, 2009 at 1:02 PM, Luther Baker lutherba...@gmail.com wrote: Cool beans. Literally :) On Mon, Mar 9, 2009 at 12:49 PM, Jonathan Barker jonathan.theit...@gmail.com wrote: My experience was with 4.0. You want to look at the ValidationDelegate. @Bean public abstract ValidationDelegate getDelegate(); // set up as listener for form public void onSubmit(IRequestCycle cycle){ ValidationDelegate = getDelegate(); (if (delegate.getHasErrors()) return; if (StringUtils.isBlank(fieldA) (StringUtils.isBlank(fieldB)||StringUtils.isBlank(fieldC))){ delegate.setFormComponent(null); delegate.record(Cross form vaildation failed); return; } else { cycle.activate(SomeOtherPage); } ) On Mon, Mar 9, 2009 at 7:29 AM, Ivano Luberti lube...@archicoop.it wrote: Sorry to ask for this again, but I have seen no answer. I will get no answer again I will stop asking for this, of course. TIA Hello, we are using T4.1 We have to validate a form and we don't want to do it client side. Let say we have three text fields. The validation should implement the following rule: if (fielda=) (fieldb= || fieldc=) then throw new Exception(); The problem is that we cannot link the validation to neither field because they can be empty and the custom validator we are trying to implement is nevere called if the field is empty. We tried to follow the Identity validator but it is also not called when the field to which is associated is empty. Is there another way to accomplish cross field validation ? It seems to us that in T4.1 lacks a validator attribute for the form component. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Jonathan Barker ITStrategic - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Tapestry on GORM. It works!
Looks very cool; seems like a tapestry-gorm archetype would be a great thing as well. On Mon, Mar 9, 2009 at 11:15 AM, Otho taa...@googlemail.com wrote: Hi all! With Grails 1.1 (RC2) The use of Gorm outside of Grails got greatly simplified. I managed to get it working with T5 and Maven at least in a simple test-app but I don't see a reason why it shouldn't work for bigger applications, too. To use all of the nifty GORM features like dynamic finders etc. the using classes (normally the page classes) need to be written in Groovy but thanks to the excellent groundwork in Tapestry that is no problem at all. My writeup of the steps necessary is here: http://programmieren-in-java.de/en/content/tapestry-5-top-gorm-maven Hope it helps someone. Otho -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tabindex and accesskey in BeanEditForm?
The thing to remember is that Grid and BeanEditForm are intended as scaffolding to get you up and running quick. As your application gets refined, you may start to pull apart the scaffolding components to build something more precisely tuned to your specific requirements. It is not my intention that we should keep layering on more parameters and models and such to make BeanEditForm and Grid the be-all and end-all of editting and display components; they're really about keeping momentum going, especially during the early, frustrating parts of writing an application: those first few steps. On Fri, Mar 6, 2009 at 2:25 PM, leechj lee...@gmail.com wrote: Hello, I was wondering if there was an easy way to add properties to fields in a BeanEditForm. Our application needs tabindex and accesskey in all fields in order to comply with federal rules dealing with accessibility. Is there a way to add these 2 properties to the fields in the form or should I just create the form by hand instead of using BeanEditForm? Thanks for any help! -- View this message in context: http://www.nabble.com/Tabindex-and-accesskey-in-BeanEditForm--tp22380749p22380749.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 Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Inherit prefix in templates
Yes, inherit: is still supposed to work as before and is still useful in many cases, though the new publishParameters attribute is more widely used. On Mon, Mar 9, 2009 at 9:41 AM, Robert Zeigler robe...@scazdl.org wrote: Looks like this is related to: https://issues.apache.org/jira/browse/TAP5-487 See the bottom of this page: http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html for more details. However, if, in fact, inherit is no longer functional, that would still represent a regression, and you should submit a bug report, attaching, at a minimum, a sample project that illustrates the problem. Robert On Mar 9, 2009, at 3/910:29 AM , Peter Stavrinides wrote: Hi all, Prior to 5.1 in places I used the prefix inherit: in my templates which seemed to work quite well. Although it is not listed as a standard binding prefix, it is used as a special case... a mention of it is made here: http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html In 5.1 it seems that it no longer working as I expected, I get the feeling I should no longer be duplicating the property in parent and child, but I have looked through the release notes but could not find any clue as to what may have changed. I also noticed this: http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/Component.html#publishParameters(), so I am wandering what the correct approach is now. Here is an example for clarity. In my containing component is the following method, which is also duplicated in the child component: @Parameter(name = contextVariables) private List? contextVariables_; And then I have for example in my tml: t:header contextVariables=inherit:contextVariables/ So I could propagate these parameters... I also use a custom annotation to bind these parameters whenever I need them, for example I have a bread-crumb component that uses them as follows: @Target(TYPE) @Retention(RUNTIME) @Documented public @interface ContextVariables { ... } Any help on fixing this would be greatly appreciated! Thanks, Peter - 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 -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: about T5 javascript
URL = a url you would build on the serverside using something like: resources.createEventLink( ); Let me review the background below.. I hope I don't confuse you too much.. Normally: t:zone id=zoneId/ a t:type=actionlink t:id=actionId zone=zoneIdactivateZone/a Generates:Html: div id=zoneId /div a href=URLactivateZone/a Generates:Javascript: 1) setup a ZoneManager against the div#zoneId 2) setup a click listener on the actionlink.. to fetch actionlink URL from tapestry, (which calls the event listener which returns a Block, and then tapestry renders block.. ), once the URL returns, it squirts the contents of the results into the appropriate div#zoneId. step 2 is basically what Tapestry.activateZone would replace.. so you can do this without relying on an actionlink or form.. mwilliam...@kcp.com wrote: I would like to use this feature but I can't figure out what url this is. Fernando Padilla wrote: that said, any committers want to add a simple function for people to use?? something like this: Tapestry.activateZone = function( zoneId, url ) { var zoneManager = Tapestry.findZoneManagerFromId( zoneId ); zoneManager.updateFromURL( url ); } Inge Solvoll wrote: var zoneObject = Tapestry.findZoneManager(elementConnectedToZone); zoneObject.updateFromURL(link); On Fri, Mar 6, 2009 at 8:16 AM, Andrea Chiumenti kium...@gmail.com wrote: Hi to avoid me to read all Tapestry js code, could you tell me waht is/are the js Class and method(s) that replace a zone on a xhr call ? Thanks, kiuma - 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 Quoted from: http://www.nabble.com/about-T5-javascript-tp22367350p22400998.html - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Tapestry on GORM. It works!
Sorry, the direct link missed out the references on which I built, since they were only in the the teaser on the mainpage. I added them now to the top of the main article, too. Without this blogentry: http://www.rimple.com/tech/2009/02/25/building-standalone-gorm-applications-in-maven/ it would have been a real PITA. My main contributions are only the pointing out that you need to use tapestry-spring and the integration of the tapestry source package into the plugin config. Just setting the credits straight. Otho 2009/3/9 Howard Lewis Ship hls...@gmail.com Looks very cool; seems like a tapestry-gorm archetype would be a great thing as well. On Mon, Mar 9, 2009 at 11:15 AM, Otho taa...@googlemail.com wrote: Hi all! With Grails 1.1 (RC2) The use of Gorm outside of Grails got greatly simplified. I managed to get it working with T5 and Maven at least in a simple test-app but I don't see a reason why it shouldn't work for bigger applications, too. To use all of the nifty GORM features like dynamic finders etc. the using classes (normally the page classes) need to be written in Groovy but thanks to the excellent groundwork in Tapestry that is no problem at all. My writeup of the steps necessary is here: http://programmieren-in-java.de/en/content/tapestry-5-top-gorm-maven Hope it helps someone. Otho -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed
Peter, returning true works, but it does not redirect the user to a different page than they were on. Normally you want the user to be sent to a different page if they are in a secure area of the site when logging off. I was just able to fix my problem with a similar situation. I was trying to return my home page as a Class, but Tapestry did not like initializing the page after the session had been invalidated. To solve this, I injected the page using @InjectPage, and then used that value in the method return. The key here seems to be getting the page initialized before the session is invalidated. Now for Harald's case, this might be difficult to implement. It looks like he's got a dynamic start page that he wants a user to be returned to. Somehow he's going to have to get an instance of the page and return that, instead of returning a URL. I'm not quite sure how to do that here, but maybe someone else can chime in. -Dave On Mon, Mar 9, 2009 at 5:46 AM, Peter Stavrinides p.stavrini...@albourne.com wrote: Sorry here is the rest of it: public Object onActionFromLinkLogoff() { User user = userDao.load(getVisit().getUserId()); auditDao.audit(AuditType.LOGOFF, user); String startPage = getVisit().getStartPage(); componentResources.discardPersistentFieldChanges(); if (null != session) request.getSession(false).invalidate(); return true; try { return new URL(startPage); } catch (MalformedURLException e) { return null; } } -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Peter Stavrinides p.stavrini...@albourne.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 11:30:05 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I have a filer to trim off the long jsession IDs from url You can do so, but IMHO that should never be necessary, the session id is encoded into the URL only once, and then removed by the container (that is if you have cookies enabled in the browser). It provides a backwards compatibility mechanism and support for devices that can't support cookies. The only other reason that it might be encoded request after request is if you are creating a new session with each request (a configuration problem that can happen for instance when you have a problem with your front end - Apache mod_rewrite), which is not mapping your cookie correctly to your back end (Tomcat / Jetty etc). Returning true is interpreted as a terminator for the request by your container, false allows the request to continue naturally, so if you call something like session.invalidate(), immediatly after call return true; to terminate, invalidate acts like a finalize on the request, so anything that trys to do something with it will cause an IllegalStateException. The problem I was having the other day related to lazy loading, after an invalidate, I could not initialize a new page because a new session could not be instantiated at that point, simply setting the property before the invalidate fixed that, the second issue was the use of the Response Tapestry service rather than HttpServletResponse, where the later cannot be tracked by Tapestry so there is a timing issue (like a race condition), hence using the first was the solution. Cheers, Peter - Original Message - From: Dave Dombrosky dom...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 05:46:16 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I'm also getting an exception after a session.invalidate() from an ActionLink and can confirm that it works in Jetty but fails in Tomcat. It would be nice to know if there is a workaround. Here's the exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Unknown Source) org.apache.catalina.connector.Request.getSession(Unknown Source) org.apache.catalina.connector.RequestFacade.getSession(Unknown Source) javax.servlet.http.HttpServletRequestWrapper.getSession(Unknown Source) org.apache.tapestry5.internal.services.RequestImpl.getSession(RequestImpl.java:99) $Request_11fda81101a.getSession($Request_11fda81101a.java)
Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed
Sorry I may have jumped the gun. I thought I had this fixed, but I must have been testing on Jetty and not Tomcat. Still broken in Tomcat. -Dave On Mon, Mar 9, 2009 at 5:49 PM, Dave Dombrosky dom...@gmail.com wrote: Peter, returning true works, but it does not redirect the user to a different page than they were on. Normally you want the user to be sent to a different page if they are in a secure area of the site when logging off. I was just able to fix my problem with a similar situation. I was trying to return my home page as a Class, but Tapestry did not like initializing the page after the session had been invalidated. To solve this, I injected the page using @InjectPage, and then used that value in the method return. The key here seems to be getting the page initialized before the session is invalidated. Now for Harald's case, this might be difficult to implement. It looks like he's got a dynamic start page that he wants a user to be returned to. Somehow he's going to have to get an instance of the page and return that, instead of returning a URL. I'm not quite sure how to do that here, but maybe someone else can chime in. -Dave On Mon, Mar 9, 2009 at 5:46 AM, Peter Stavrinides p.stavrini...@albourne.com wrote: Sorry here is the rest of it: public Object onActionFromLinkLogoff() { User user = userDao.load(getVisit().getUserId()); auditDao.audit(AuditType.LOGOFF, user); String startPage = getVisit().getStartPage(); componentResources.discardPersistentFieldChanges(); if (null != session) request.getSession(false).invalidate(); return true; try { return new URL(startPage); } catch (MalformedURLException e) { return null; } } -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Peter Stavrinides p.stavrini...@albourne.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 11:30:05 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I have a filer to trim off the long jsession IDs from url You can do so, but IMHO that should never be necessary, the session id is encoded into the URL only once, and then removed by the container (that is if you have cookies enabled in the browser). It provides a backwards compatibility mechanism and support for devices that can't support cookies. The only other reason that it might be encoded request after request is if you are creating a new session with each request (a configuration problem that can happen for instance when you have a problem with your front end - Apache mod_rewrite), which is not mapping your cookie correctly to your back end (Tomcat / Jetty etc). Returning true is interpreted as a terminator for the request by your container, false allows the request to continue naturally, so if you call something like session.invalidate(), immediatly after call return true; to terminate, invalidate acts like a finalize on the request, so anything that trys to do something with it will cause an IllegalStateException. The problem I was having the other day related to lazy loading, after an invalidate, I could not initialize a new page because a new session could not be instantiated at that point, simply setting the property before the invalidate fixed that, the second issue was the use of the Response Tapestry service rather than HttpServletResponse, where the later cannot be tracked by Tapestry so there is a timing issue (like a race condition), hence using the first was the solution. Cheers, Peter - Original Message - From: Dave Dombrosky dom...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 05:46:16 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I'm also getting an exception after a session.invalidate() from an ActionLink and can confirm that it works in Jetty but fails in Tomcat. It would be nice to know if there is a workaround. Here's the exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed org.apache.catalina.connector.Request.doGetSession(Unknown Source) org.apache.catalina.connector.Request.getSession(Unknown Source) org.apache.catalina.connector.RequestFacade.getSession(Unknown Source)
[T5] Web Service
Hi There, I have a web application written using the Tapestry 5 framework. This allows users to view data stored in an SQL database. I want to write a client Java application that a user will be able to run on their local machine. I want this client side application to be able to communicate and retrieve data from my Tapestry application. (Something similar to an ASP.NET web service) I'm not sure what the best approach to this problem is. Socket programming? Essentially what I want is an interface so that I can access data from my client side Java application. This interface needs to start up with the Tapestry application. Some suggestions/advice/pointing in the right direction would be much appreciated (Connecting directly to the database is not an option). Many Thanks, Dan -- View this message in context: http://www.nabble.com/-T5--Web-Service-tp22424545p22424545.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 ConcurrentBarrier / Deadlock
Hi Alex! Thanks for your answer. We run the app on different JVM's (all 1.6, Linux-64Bit, WindowsXP 32Bit, Mac-OS X 64Bit). I do not think this problem is related to a particular JVM version or an thread local problem at all. Maybe deadlock is the wrong word. Because of the fact that the thread which triggers the T5 reload mechanism never returned the whole application got frozen. None of the other threads can pass the ConcurrentBarrier while one thread is initiating the reload. It's not directly related to concurrency like two thread claim the same resources in different order. It's only one resource (T5-releod) but this one is never released as the request never finishes... Jens I also recall the deadlock issues manifested themselves on particular JVM versions which were fixed in the latest updates. Which Java version are you running ? Cheers, Alex Kotchnev On Thu, Mar 5, 2009 at 12:40 PM, mailingl...@j-b-s.de wrote: Hi! We encountered a small problem in the way tapestry detects changes of tml's and classes which causes a server crash: in our special case the request which detected changes used the ConcurrentBarrier write-lock to block all other threads. This is ok as long you guarantee the request will return. Due to a bug in the 64Bit VM concerning regex execution the regex parser went into an indefinite loop. This causes a break down of the tomcat as all other request where blocked when trying to pass the ConcurrentBarrier which was never unlocked as the responsible thread never finished. Same applies for example if you need to communicate to external systems and eg a network/socket problem causes the thread to freeze which also locks the whole server. Is it possible to move the lock/and rereading of tmls/classes to a different thread if changes exist? Means regardless if the request responsible for firing the update ever returns the tomcat remains accessible after rereading? You can argue chances for this are not high, but since SEP-08 we had this trouble two times in production... Before I forget: affected version is T5.0.13. we are currently moving over to T5.0.18, so maybe there is a solution yet? Jens - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: passing a form in the URL?
if it were possible -cant speak with authority as i am not using tap 5 - it would take the form of support for changing the method attr to 'get' on the form component. On 3/9/09, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I have a page which has a form like this: t:form t:id=search input t:type=select t:id=category model=categorySelectModel t:value=category / input t:type=textfield t:id=name t:value=name / input t:type=submit name=Submit t:id=Submit / /t:form in the onSuccess event I'm doing: @InjectPage private ShowResults showResults; Object onSuccessFromSearch() { showResults.setlst(lst); return searchResults; } Instead of InjectPage, is there a way to push the form to ShowResults in the URL, something like what Google is doing: http://www.google.com/search?hl=enq=TapestrybtnG=Google+Searchmeta= Thanks, -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22412124.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 -- Joshua Long http://www.joshlong.com/ - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Two nested AjaxFormLoops
Hi, I need to put two nested AjaxFormLoops one in the antoher. You know its a 1-m-n database relationships. How can I pass the ID (for ex) of the higher Loop to the onAdd event of the Lower. Otherwise I can not find out which of the rows of the higher loop was edited. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: passing a form in the URL?
question is, can we tell t:form to use GET instead of POST? starbuxman wrote: if it were possible -cant speak with authority as i am not using tap 5 - it would take the form of support for changing the method attr to 'get' on the form component. On 3/9/09, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I have a page which has a form like this: t:form t:id=search input t:type=select t:id=category model=categorySelectModel t:value=category / input t:type=textfield t:id=name t:value=name / input t:type=submit name=Submit t:id=Submit / /t:form in the onSuccess event I'm doing: @InjectPage private ShowResults showResults; Object onSuccessFromSearch() { showResults.setlst(lst); return searchResults; } Instead of InjectPage, is there a way to push the form to ShowResults in the URL, something like what Google is doing: http://www.google.com/search?hl=enq=TapestrybtnG=Google+Searchmeta= Thanks, -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22412124.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 -- Joshua Long http://www.joshlong.com/ - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22425882.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: passing a form in the URL?
Technically, you should be able to use the normal encoding of the form tag. http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 What I don't know is whether T5 will consume it. Christian On Mar 9, 2009, at 8:45 PM, Angelo Chen wrote: question is, can we tell t:form to use GET instead of POST? starbuxman wrote: if it were possible -cant speak with authority as i am not using tap 5 - it would take the form of support for changing the method attr to 'get' on the form component. On 3/9/09, Angelo Chen angelochen...@yahoo.com.hk wrote: Hi, I have a page which has a form like this: t:form t:id=search input t:type=select t:id=category model=categorySelectModel t:value=category / input t:type=textfield t:id=name t:value=name / input t:type=submit name=Submit t:id=Submit / /t:form in the onSuccess event I'm doing: @InjectPage private ShowResults showResults; Object onSuccessFromSearch() { showResults.setlst(lst); return searchResults; } Instead of InjectPage, is there a way to push the form to ShowResults in the URL, something like what Google is doing: http://www.google.com/search?hl=enq=TapestrybtnG=Google+Searchmeta= Thanks, -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22412124.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 -- Joshua Long http://www.joshlong.com/ - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://www.nabble.com/T5%3A-passing-a-form-in-the-URL--tp22412124p22425882.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
Re: @Meta(tapestry.persistence-strategy=client)
in sessionCreated create and dump an exception and check the stacktrace to find who's responsible On Tue, Mar 10, 2009 at 2:07 AM, Borut Bolčina borut.bolc...@gmail.com wrote: Hi, I am trying to prevent session creation when using forms and in general. I searched the mailing list but can not explain why the session is still being created. I use 5.0.18. Index.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:form t:id=myform t:label for=cardNumber/: t:textfield t:id=cardNumber value=cardNumber size=20/ input type=submit value=Submit/ /t:form div${cardNumber}/div /body /html Index.java @Meta(tapestry.persistence-strategy=client) public class Index { �...@property �...@persist private String cardNumber; } Even when I remove the @Persist annotation from the cardNumber property, the session is still being created. Until I remove the Form from the template. I am monitoring session creation with a class in my same test project: package bb.test.session; import java.util.Date; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class MyHttpSessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent se) { HttpSession session = se.getSession(); System.out.print(getTime() + (session) Created:); System.out.println(ID= + session.getId() + MaxInactiveInterval= + session.getMaxInactiveInterval()); } public void sessionDestroyed(HttpSessionEvent se) { HttpSession session = se.getSession(); // session has been invalidated and all session data (except Id)is no longer available System.out.println(getTime() + (session) Destroyed:ID= + session.getId()); } private String getTime() { return new Date(System.currentTimeMillis()).toString(); } } and with listener listener-classbb.test.session.MyHttpSessionListener/listener-class /listener in my web.xml. Of course Firefox extension FireCookie is of help. So, is this a bug? Regards, Borut -- Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0
Dear DH, Thanks for you quick response. I added the param but now get a new Exception (see below). The exception still only happens when elements are removed from the Loop through AJAX, adding all works fine. This whole volatile concept is a bit fuzzy to me and scanning the source of the Loop component does not clear things up to me. Do you have any further pointers? Cheers, Joost --- the new Exception -- Caused by: java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:427) at org.apache.tapestry5.corelib.components.Loop.advanceVolatile(Loop.java:335) at org.apache.tapestry5.corelib.components.Loop.access$200(Loop.java:41) at org.apache.tapestry5.corelib.components.Loop$3.execute(Loop.java:92) at org.apache.tapestry5.corelib.components.Loop$3.execute(Loop.java:96) at org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:471) ... 81 more On Mon, Mar 9, 2009 at 9:03 PM, ningdh ningd...@gmail.com wrote: Set volatile=true at the loop component to let the form not to restore the state. Thanks, DH - Original Message - From: Joost Schouten (mailing lists) joost...@jsportal.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 09, 2009 6:14 PM Subject: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0 Hi, I have a loop in a form displaying non form information. An ajax call can update the source of the Loop. When the loop has less, or different items in it during submit then when the form was initiated, the following exception is thrown. Loop.RestoreStateFromStoredClientValue() seems to be causing this problem. My question; Why does the form care about restoring state of a Loop not containing any FormItems? Second, how can I fix this problem? I cannot pull my loop out of the form unfortunately. This seems to be a new problem introduced in 5.1.0.0 as in version 5.0.18 all works fine. Cheers, Joost -- debug and stack trace --- DEBUG 09 Mar 2009 17:29:14,186 [qtp0-3] org.apache.tapestry5.ioc.internal.services.MethodLogger.entry(MethodLogger.java:73) - [ENTER] onAction(org.apache.tapestry5.internal.emptyeventcont...@422f73) DEBUG 09 Mar 2009 17:29:14,187 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:458) - Processing actions: H4sIAM2TP2gUQRTGx0Bs0ohg6i1ikSJzieQ0nohZLptwctk7bs/IISizs2/3Ns7OrDOzJodgY6GFvZ0g2vmntTeFpLFR7AMiNoIoWin4chdRESRBCVftzLxv3/d7s98+ek9G1y6QjgFeaIhKhQFdWmCmGyqmo0rOEhCspwpLf1kKlSQQGctsYUKh+GVq1lLLuwYEcKs0ajVIa4RSudGEKp1QljPeBWpZDsbqXplypUGkIT6zXMltOa2jfqI81dh8PUmubY4Qsp4PF9tM583jT/HTl/f2hc3fE1sL61gKsDssapUF27uoKlKUrDBRwNSdZ69uEefbCDlQJ2P8Z8GSw/VVdpWVBJNJKbA6lcmp9dySm+hBV5Uy1vAuDgCShoVJJRjDoiyVNFMRCFpFEiZ788fieO7EScd3l72KczZwmkpbJpwFL6i2as12reFXHFkI4bQ7TVRUG8tN1+9capz3vZYTtN02HrrVdm3FS3E0fFdycCrOzPRwhWD2Yx5PLo0/PDOEAT0+fejD3MUHt08P2GIS/V82xrkq0K2/T5U0wDSWNSn/FTNkBqgb4iHjdjEFEU0EYIv86LmNsa0jz7/uRFJJq5XwWQZXyHUyuh3B8R3H4Idj0Hfcx8ncvU7W1IrjHxIUYZYag602nkSz8Ze7LwbfZIl4/0reZ0S0+d1mo89i/yR7u9X6fMO7/25w/9g2Q/lv939wYPYdYIg+ficGAAA= DEBUG 09 Mar 2009 17:29:14,190 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop Loop.PrepareForSubmission DEBUG 09 Mar 2009 17:29:14,191 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop Loop.ResetIndex DEBUG 09 Mar 2009 17:29:14,193 [qtp0-3] org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:475) - Processing: secured/user/Dashboard:pagelayout.pagelayout.loggedstatusblock.switchselector.parentsloop loop.restorestatefromstoredclientvalue[com.joostschouten.businessadmin.model.comp...@2ff879 NAME: JS Portal DESCRIPTION: null TYPE: COMPANY_OWNER STATE: ACTIVEimportance : 10] DEBUG 09 Mar 2009 17:29:14,200 [qtp0-3] org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:60) - Invoking constructor org.apache.tapestry5.ioc.internal.services.ExceptionTrackerImpl() (at ExceptionTrackerImpl.java:25) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:41). DEBUG 09 Mar 2009 17:29:14,201 [qtp0-3] org.apache.tapestry5.ioc.internal.services.MethodLogger.fail(MethodLogger.java:164) - [ FAIL] onAction -- org.apache.tapestry5.ioc.internal.util.TapestryException org.apache.tapestry5.ioc.internal.util.TapestryException: Could not find a coercion from type java.lang.String to type com.joostschouten.businessadmin.model.Account. at org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:492) at org.apache.tapestry5.corelib.components.Form._$advised$onAction(Form.java:375) at
Re: @Meta(tapestry.persistence-strategy=client)
Try providing a custom validation tracker to form. Form creates one that is stored in the session by default. I suspect this is where your session creation is coming from. Note that for validation to work properly, you'll have to persist the tracker in some form. Robert On Mar 9, 2009, at 3/97:07 PM , Borut Bolčina wrote: Hi, I am trying to prevent session creation when using forms and in general. I searched the mailing list but can not explain why the session is still being created. I use 5.0.18. Index.tml html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; body t:form t:id=myform t:label for=cardNumber/: t:textfield t:id=cardNumber value=cardNumber size=20/ input type=submit value=Submit/ /t:form div${cardNumber}/div /body /html Index.java @Meta(tapestry.persistence-strategy=client) public class Index { @Property @Persist private String cardNumber; } Even when I remove the @Persist annotation from the cardNumber property, the session is still being created. Until I remove the Form from the template. I am monitoring session creation with a class in my same test project: package bb.test.session; import java.util.Date; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class MyHttpSessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent se) { HttpSession session = se.getSession(); System.out.print(getTime() + (session) Created:); System.out.println(ID= + session.getId() + MaxInactiveInterval= + session.getMaxInactiveInterval()); } public void sessionDestroyed(HttpSessionEvent se) { HttpSession session = se.getSession(); // session has been invalidated and all session data (except Id)is no longer available System.out.println(getTime() + (session) Destroyed:ID= + session.getId()); } private String getTime() { return new Date(System.currentTimeMillis()).toString(); } } and with listener listener-classbb.test.session.MyHttpSessionListener/listener-class /listener in my web.xml. Of course Firefox extension FireCookie is of help. So, is this a bug? Regards, Borut - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed
Looks like this is a bug in 5.0.18 that has been fixed in 5.1.0.0. See http://issues.apache.org/jira/browse/TAP5-413 for details. -Dave On Mon, Mar 9, 2009 at 6:11 PM, Dave Dombrosky dom...@gmail.com wrote: Sorry I may have jumped the gun. I thought I had this fixed, but I must have been testing on Jetty and not Tomcat. Still broken in Tomcat. -Dave On Mon, Mar 9, 2009 at 5:49 PM, Dave Dombrosky dom...@gmail.com wrote: Peter, returning true works, but it does not redirect the user to a different page than they were on. Normally you want the user to be sent to a different page if they are in a secure area of the site when logging off. I was just able to fix my problem with a similar situation. I was trying to return my home page as a Class, but Tapestry did not like initializing the page after the session had been invalidated. To solve this, I injected the page using @InjectPage, and then used that value in the method return. The key here seems to be getting the page initialized before the session is invalidated. Now for Harald's case, this might be difficult to implement. It looks like he's got a dynamic start page that he wants a user to be returned to. Somehow he's going to have to get an instance of the page and return that, instead of returning a URL. I'm not quite sure how to do that here, but maybe someone else can chime in. -Dave On Mon, Mar 9, 2009 at 5:46 AM, Peter Stavrinides p.stavrini...@albourne.com wrote: Sorry here is the rest of it: public Object onActionFromLinkLogoff() { User user = userDao.load(getVisit().getUserId()); auditDao.audit(AuditType.LOGOFF, user); String startPage = getVisit().getStartPage(); componentResources.discardPersistentFieldChanges(); if (null != session) request.getSession(false).invalidate(); return true; try { return new URL(startPage); } catch (MalformedURLException e) { return null; } } -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Peter Stavrinides p.stavrini...@albourne.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 11:30:05 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I have a filer to trim off the long jsession IDs from url You can do so, but IMHO that should never be necessary, the session id is encoded into the URL only once, and then removed by the container (that is if you have cookies enabled in the browser). It provides a backwards compatibility mechanism and support for devices that can't support cookies. The only other reason that it might be encoded request after request is if you are creating a new session with each request (a configuration problem that can happen for instance when you have a problem with your front end - Apache mod_rewrite), which is not mapping your cookie correctly to your back end (Tomcat / Jetty etc). Returning true is interpreted as a terminator for the request by your container, false allows the request to continue naturally, so if you call something like session.invalidate(), immediatly after call return true; to terminate, invalidate acts like a finalize on the request, so anything that trys to do something with it will cause an IllegalStateException. The problem I was having the other day related to lazy loading, after an invalidate, I could not initialize a new page because a new session could not be instantiated at that point, simply setting the property before the invalidate fixed that, the second issue was the use of the Response Tapestry service rather than HttpServletResponse, where the later cannot be tracked by Tapestry so there is a timing issue (like a race condition), hence using the first was the solution. Cheers, Peter - Original Message - From: Dave Dombrosky dom...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, 9 March, 2009 05:46:16 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: [T5 5.0.18] java.lang.IllegalStateException: Cannot create a session after the response has been committed I'm also getting an exception after a session.invalidate() from an ActionLink and can confirm that it works in Jetty but fails in Tomcat. It would be nice to know if there is a workaround. Here's the exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed
Re: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0
Hi, In your case, why not have a try on AjaxFormLoop component, but I haven't tried this component yet and don't have much experience. Loop component in form is a bit tricky. Set volatile='true' means you need have your source object unchanged. But you have deleted one row during process, so exception happens. Thanks DH - Original Message - From: Joost Schouten (mailing lists) joost...@jsportal.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, March 10, 2009 11:13 AM Subject: Re: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0 Dear DH, Thanks for you quick response. I added the param but now get a new Exception (see below). The exception still only happens when elements are removed from the Loop through AJAX, adding all works fine. This whole volatile concept is a bit fuzzy to me and scanning the source of the Loop component does not clear things up to me. Do you have any further pointers? Cheers, Joost --- the new Exception -- Caused by: java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:427) at org.apache.tapestry5.corelib.components.Loop.advanceVolatile(Loop.java:335) at org.apache.tapestry5.corelib.components.Loop.access$200(Loop.java:41) at org.apache.tapestry5.corelib.components.Loop$3.execute(Loop.java:92) at org.apache.tapestry5.corelib.components.Loop$3.execute(Loop.java:96) at org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:471) ... 81 more