Re: JSESSIONID cookie, secure is set, how to not set
I don't know how to do it within Tapestry, but generally you can use a filter to make sure that jsessionid is never set as a secure cookie. I dug up some old code that does that, I think it works: public class TomcatUnifiedSessionFilter implements Filter { public void destroy() { // nothing to do here } public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { /* * Tomcat tracks the session using the JSESSIONID. When the session is * created as a consequence of a request of a secure page, however, the * secure attribute of the cookie is set to true. That prevents the * session to be consecutively tracked on non-secure pages. We would * like a unified approach, though. */ final HttpServletRequest httpRequest = (HttpServletRequest) request; final HttpServletResponse httpResponse = (HttpServletResponse) response; // TODO: some more explanation final HttpSession session = httpRequest.getSession(false); if (session != null) { final Cookie sessionCookie = new Cookie(JSESSIONID, session.getId()); sessionCookie.setMaxAge(-1); sessionCookie.setSecure(false); sessionCookie.setPath(httpRequest.getContextPath()); httpResponse.addCookie(sessionCookie); } chain.doFilter(request, response); } public void init(final FilterConfig config) throws ServletException { // nothing to do here } On Wed, Dec 17, 2008 at 8:51 PM, Keith Bottner kbott...@gmail.com wrote: Martijn, I get the rationale which is why I have other cookies that are marked as secure; however, the JSESSIONID cookie has a special use by the JSP server and is used for associating a user with a session so it should always be passed unsecured just to keep the user associated with the proper clustered server and with the proper backend mapping. The more secure cookies can be used for other uses. Keith - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 I am struggling with persisting form elements using onchange
Jayson, customer. I attempted this using the onEvent mixin and a javascript function, but Tapestry kept telling me my javascript function was undefined. that's probably just some mismatch between your function name and what you said the callback function was. Maybe you should post that code here. I decided to simplify and eliminate the OnEvent mixin and use onchange instead. The problem is onchange doesn't seem to allow Tapestry to persist any of the form fields. Hm... what did you do onchange? That's all a bit confusing... if you use onEvent with event=change, of course you also use the onchange event. The change event will cause an ajax call that will cause some code on the server to be executed, and may return a result, which may be passed to a callback JavaScript function. Now I am using a combination of both OnEvent and onchange. Using this approach the customerSelect component persists I think because of the [..] t:mixins=commons/OnEvent event=change onchange=document.forms[0].submit() What you are saying is, you have the onchange event trigger two actions. That might get messy, how can you define which one is triggered first? Plus, when you submit the form anyway, why the ajax call? I am hoping someone can point me in the right direction if there is a more conventional way of updating a form based on a user's actions. Otherwise I think you should go back to using the OnEvent mixin, without additional onchange calls such as a form submit. Have your event handler update your data on the server side, have it return some value that allows you to update your other select, and write a JavaScript function that does the update. The only other thing is if I initialize the customerSelect in onActivate the select is always one selection behind (ie. I choose a customer and when the page refreshes the select component is not updated, I then choose a different customer and the select is updated with my first selection... ) That sounds odd. Maybe the onActivate you expect to be called is not called at the time you expect it. You should trace/debug the invocations. I would love for this to work with AJAX using the OnEvent mixin and an onCompleteCallback javascript event, Should not be a problem. Hth, Lutz -- http://www.altocon.de/ Software Development, Consulting Hamburg, Germany - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: encoding issues
Hm... I think there are many possible points of failure for the encoding... - maybe your browser thinks the page is not utf-8. Is the encoding set correctly either in a http response header or html meta tag? - what do you use for building your project? If you use maven, check the encoding argument for the compiler plugin configuration. If it is not set, maven will assume the source files are in the platform default encoding, no matter what eclipse says. Also, as a quick workaround, you could use the html entity deg; and use t:outputRaw instead of the $ notation. hth, Lutz On Tue, Dec 23, 2008 at 10:24 PM, Christoph Jäger christoph.jae...@polleninfo.org wrote: Hi José, the java files seem to be UTF-8. At least Eclipse tells me so, and if I write some of the special characters to stdout (from a test case, not running in Tomcat), everything is fine. Thanks, Christoph -- altocon GmbH http://www.altocon.de/ Software Development, Consulting Hamburg, Germany
Re: T5/Jetty: disabling jsessionid?
Andy, you can strip the session id with filter, but you should also check if the pages you want index really need to be stateful. When your servlet container adds a session id, it means it found it necessary to create a session. If you just strip the session id, a new session will be created for every request from a search engine crawler, which is usually not want one wants, especially if you have a lot of pages. Tapestry makes it easy to make your pages stateless, since ASOs are not created before they are used, and you can check for existence before using (and thereby creating) them. That will also solve the session id issue, since for the stateless pages, a session won't even be created. Have you thought about that? hth, Lutz On Tue, Dec 30, 2008 at 5:13 PM, Andy Huhn amh...@hslt-online.com wrote: Hello, I'm having issues with the way my app is being crawled by search engines. A jsessionid parameter is being added to the URL of each request, making the link obtained by the search engine useless. I'm running Jetty 6. I know from perusing the web that this jsessionid is being added by Jetty, but I don't know how to disable that, other than writing a ServletFilter ( http://mail-archives.apache.org/mod_mbox/tapestry-users/200606.mbox/% 3c85ce4e3fd2ec2c4e8aae39916ac1a3830f9bc...@ms07.mse2.exchange.ms%3e ). This is something I'd rather not get into. Any suggestions? Or does anyone have any working T5 code I could plug in that would take care of this for me? Thanks, Andy -- altocon GmbH http://www.altocon.de/ Software Development, Consulting Hamburg, Germany - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: spring context troubles
Actually, I'm liking the idea that compatibility on this comes from continuing to use the old version of tapestry-spring. I haven't found a way to do both: allow injection of Tapestry services into Spring beans and expose Spring beans as Tapestry services. The lifecycles of the two containers do not mesh easily. On Thu, Jan 1, 2009 at 3:23 PM, Fernando Padilla f...@alum.mit.edu wrote: nice work around. but I want to make sure, this will be a temporary work around until you get the latest spring module working as you desire, with two-way integration?? Howard Lewis Ship wrote: I think the best option for you is to use Tapestry 5.1, but revert tapestry-spring to 5.0.18. This allows you to benefit from the improvements to tapestry-core without having any compatibility problems with the changes to tapestry-spring. I'm adding documentation to the web site to explain this. On Mon, Dec 29, 2008 at 4:20 PM, Fernando Padilla f...@alum.mit.edu wrote: I'm sorry that I'm hammering on this code, while it's still probably a work in progress.. (always available through im) but I commented out the spring ContextLoaderListener, moved the filter up to be first, and this seems to initialize properly at least for Jetty (within eclipse). The next issue, it looks like it did not register the spring beans in the TapestryIoC.. so now I'm getting exceptions saying that it can't find particular beans: Caused by: java.lang.RuntimeException: Service id 'common-conf-properties' is not defined by any module. Defined services: ActionRenderResponseGenerator, AjaxComponentEventRequestHandler, AjaxComponentEventResultProcessor, AjaxPartialResponseRenderer, Alias, AliasOverrides, AppSubscriptionHandler, ApplicationContext, ApplicationDefaults, ApplicationGlobals, ApplicationInitializer, ApplicationStateManager, ApplicationStatePersistenceStrategySource, AspectDecorator, AssetBindingFactory, AssetObjectProvider, AssetSource, BaseURLSource, BeanBlockOverrideSource, BeanBlockSource, BeanModelSource, BindingSource, ChainBuilder, ClassNameLocator, ClasspathAssetAliasManager, ClasspathAssetFactory, ClasspathURLConverter, ClientPersistentFieldStorage, ClientPersistentFieldStrategy, ComponentClassCache, ComponentClassFactory, ComponentClassResolver, ComponentClassTransformWorker, ComponentClassTransformer, ComponentClassesInvalidationEventHub, ComponentDefaultProvider, ComponentEventRequestHandler, ComponentEventResultProcessor, ComponentInstanceResultProcessor, ComponentInstantiatorSource, ComponentInvocationMap, ComponentMessagesInvalidationEventHub, ComponentMessagesSource, ComponentPageElementResourcesSource, ComponentSource, ComponentTemplateSource, ComponentTemplatesInvalidationEventHub, Context, ContextAssetFactory, ContextPathEncoder, ContextValueEncoder, CookieSink, CookieSource, Cookies, CtClassSource, DataTypeAnalyzer, DefaultDataTypeAnalyzer, DefaultFileItemFactory, DefaultImplementationBuilder, EndOfRequestListenerHub, Environment, EnvironmentalShadowBuilder, ExceptionAnalyzer, ExceptionTracker, FacebookAuthFilterImpl, FactoryDefaults, FbForceModeFilter, FieldTranslatorSource, FieldValidationSupport, FieldValidatorDefaultSource, FieldValidatorSource, FormSupport, HiddenFieldLocationRules, HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter, InjectionProvider, InternalRequestGlobals, LinkCreationHub, LinkFactory, LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer, MarkupWriterFactory, MasterDispatcher, MasterObjectProvider, MessageBindingFactory, MetaDataLocator, MultipartDecoder, NullFieldStrategyBindingFactory, NullFieldStrategySource, ObjectRenderer, OsForceTypeFilter, PageActivationContextCollector, PageContentTypeAnalyzer, PageDocumentGenerator, PageElementFactory, PageLoader, PageMarkupRenderer, PagePool, PageRenderQueue, PageRenderRequestHandler, PageResponseRenderer, PageTemplateLocator, PartialMarkupRenderer, PersistentFieldManager, PersistentLocale, PipelineBuilder, PropBindingFactory, PropertyAccess, PropertyConduitSource, PropertyShadowBuilder, RegistryStartup, RenderSupport, Request, RequestExceptionHandler, RequestGlobals, RequestHandler, RequestLogFilter, RequestPageCache, RequestPathOptimizer, RequestSecurityManager, ResourceCache, ResourceDigestGenerator, ResourceStreamer, Response, ResponseRenderer, ServiceLifecycleSource, ServletApplicationInitializer, SessionApplicationStatePersistenceStrategy, StrategyBuilder, SymbolSource, TemplateParser, ThreadLocale, TranslateBindingFactory, TranslatorSource, TypeCoercer, URLEncoder, UpdateListenerHub, ValidateBindingFactory, ValidationConstraintGenerator, ValidationMessagesSource, ValueEncoderSource. at org.apache.tapestry5.ioc.internal.RegistryImpl.locateModuleForService(RegistryImpl.java:321) at org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:288) at
[T5] Request Management
I am running into a problem trying to determine when a conversation starts and more specifically ends with Tapestry. I understand that Tapestry issues some redirects or creates a new request(s) for the render cycle. Is there a way to determine when a conversation is completed and the page has been rendered? Right now, I have a Servlet Filter that puts an attribute into the HttpSession. I want to clean that attribute up when the conversation is over and tapestry is done with all of its requests/redirects/rendering. I have looked at contributing a requestHandler but it seems to be called on both the action and render requests. I looked at contributing a Master Dispatcher, but I don't think that is what I want to do, so I didn't pursue it too far. Any ideas? -- View this message in context: http://www.nabble.com/-T5--Request-Management-tp21253367p21253367.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
[T5] Exposing part of T5 service using RMI
Hi! Is it possible to expose selected methods from a service using RMI? If so, are there any tutorials or something I can refer? (RMI tutorials are easy to find, but how to use it with T5 IoC?) Also I'm open to any ideas how to expose parts of services to another jvm on the same machine with the option to use different hosts for the systems in the future. My needs are synchronous, so no async allowed. - Ville -- View this message in context: http://www.nabble.com/-T5--Exposing-part-of-T5-service-using-RMI-tp21254013p21254013.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] Request Management
Okay, so I tried contributing a MasterDispatcher. I contributed it with an order of after:PageRender, however it doesn't seem to be getting called. It seems that PageRenderDispatcher is interrupting the pipeline, so contributing a dispatcher after:PageRender isn't possible. Anyone know of a work around for this since? The PageRenderDispatcher is internal to T5 and I would like to keep my hands out of it. :) -- View this message in context: http://www.nabble.com/-T5--Request-Management-tp21253367p21254525.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
T5: How to inject a Link
Hi, it must be too much Christmas cheer, but I am not sure how to jump to a non-Tapestry URL in the same web app. A little background: We have an old application written in Struts 1.1. I have written my own Login page, called the old code to the user validation and updating of the session. This all works ala Kent Tong's eBook on Tap4. Now I want to jump to main struts page of my app. My onSuccess() method needs to return a Link or a URL, but according to the docs, the URL should be used for completely external addresses (e.g. google.com). Can I inject a Link (LinkImpl is in the internal package, and so unusable)? Or should I generate a relative URL? Thanks and Happy New Year to one and all, Jonathan O'Connor - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: spring context troubles
That's alright to keep them separate, but I'm just worried that the 5.0.18 will stop working at some point.. That is why I proposed that you should really have two different pacakges.. one for each direction of integration, and people can explicitly choose which one to use. It just seems kind of brittle saying never to upgrade your spring package, that strategy will fail at some point, and could just confuse people in the interim... Howard Lewis Ship wrote: Actually, I'm liking the idea that compatibility on this comes from continuing to use the old version of tapestry-spring. I haven't found a way to do both: allow injection of Tapestry services into Spring beans and expose Spring beans as Tapestry services. The lifecycles of the two containers do not mesh easily. On Thu, Jan 1, 2009 at 3:23 PM, Fernando Padilla f...@alum.mit.edu wrote: nice work around. but I want to make sure, this will be a temporary work around until you get the latest spring module working as you desire, with two-way integration?? Howard Lewis Ship wrote: I think the best option for you is to use Tapestry 5.1, but revert tapestry-spring to 5.0.18. This allows you to benefit from the improvements to tapestry-core without having any compatibility problems with the changes to tapestry-spring. I'm adding documentation to the web site to explain this. On Mon, Dec 29, 2008 at 4:20 PM, Fernando Padilla f...@alum.mit.edu wrote: I'm sorry that I'm hammering on this code, while it's still probably a work in progress.. (always available through im) but I commented out the spring ContextLoaderListener, moved the filter up to be first, and this seems to initialize properly at least for Jetty (within eclipse). The next issue, it looks like it did not register the spring beans in the TapestryIoC.. so now I'm getting exceptions saying that it can't find particular beans: Caused by: java.lang.RuntimeException: Service id 'common-conf-properties' is not defined by any module. Defined services: ActionRenderResponseGenerator, AjaxComponentEventRequestHandler, AjaxComponentEventResultProcessor, AjaxPartialResponseRenderer, Alias, AliasOverrides, AppSubscriptionHandler, ApplicationContext, ApplicationDefaults, ApplicationGlobals, ApplicationInitializer, ApplicationStateManager, ApplicationStatePersistenceStrategySource, AspectDecorator, AssetBindingFactory, AssetObjectProvider, AssetSource, BaseURLSource, BeanBlockOverrideSource, BeanBlockSource, BeanModelSource, BindingSource, ChainBuilder, ClassNameLocator, ClasspathAssetAliasManager, ClasspathAssetFactory, ClasspathURLConverter, ClientPersistentFieldStorage, ClientPersistentFieldStrategy, ComponentClassCache, ComponentClassFactory, ComponentClassResolver, ComponentClassTransformWorker, ComponentClassTransformer, ComponentClassesInvalidationEventHub, ComponentDefaultProvider, ComponentEventRequestHandler, ComponentEventResultProcessor, ComponentInstanceResultProcessor, ComponentInstantiatorSource, ComponentInvocationMap, ComponentMessagesInvalidationEventHub, ComponentMessagesSource, ComponentPageElementResourcesSource, ComponentSource, ComponentTemplateSource, ComponentTemplatesInvalidationEventHub, Context, ContextAssetFactory, ContextPathEncoder, ContextValueEncoder, CookieSink, CookieSource, Cookies, CtClassSource, DataTypeAnalyzer, DefaultDataTypeAnalyzer, DefaultFileItemFactory, DefaultImplementationBuilder, EndOfRequestListenerHub, Environment, EnvironmentalShadowBuilder, ExceptionAnalyzer, ExceptionTracker, FacebookAuthFilterImpl, FactoryDefaults, FbForceModeFilter, FieldTranslatorSource, FieldValidationSupport, FieldValidatorDefaultSource, FieldValidatorSource, FormSupport, HiddenFieldLocationRules, HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter, InjectionProvider, InternalRequestGlobals, LinkCreationHub, LinkFactory, LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer, MarkupWriterFactory, MasterDispatcher, MasterObjectProvider, MessageBindingFactory, MetaDataLocator, MultipartDecoder, NullFieldStrategyBindingFactory, NullFieldStrategySource, ObjectRenderer, OsForceTypeFilter, PageActivationContextCollector, PageContentTypeAnalyzer, PageDocumentGenerator, PageElementFactory, PageLoader, PageMarkupRenderer, PagePool, PageRenderQueue, PageRenderRequestHandler, PageResponseRenderer, PageTemplateLocator, PartialMarkupRenderer, PersistentFieldManager, PersistentLocale, PipelineBuilder, PropBindingFactory, PropertyAccess, PropertyConduitSource, PropertyShadowBuilder, RegistryStartup, RenderSupport, Request, RequestExceptionHandler, RequestGlobals, RequestHandler, RequestLogFilter, RequestPageCache, RequestPathOptimizer, RequestSecurityManager, ResourceCache, ResourceDigestGenerator, ResourceStreamer, Response, ResponseRenderer, ServiceLifecycleSource, ServletApplicationInitializer, SessionApplicationStatePersistenceStrategy, StrategyBuilder, SymbolSource, TemplateParser, ThreadLocale, TranslateBindingFactory, TranslatorSource,
T5 newbie books/tutorials and a couple of questions?
Tapestry Fans, I've been tinkering with Tapestry a little bit off and on but am still pretty much a complete newbie. In the past I've tried a few other Java frameworks, but a framework that requires more lines of XML configuration than lines of source code never made any sense to me. I've also tinkered a bit with various script based frameworks like Ruby on Rails and Django. At the moment I have two websites I act as webmaster for. My personal web site is currently a mixture of PHP and PSP(Pascal Server Pages). Actually I think PSP is now known as PWU - Pascal Web Units. The second is a local canine agility group's web site which is currently Django based. I'm considering converting both to Tapestry. In the past I purchased the PDF version of Enjoying Web Development with Tapestry and went through part of it with Tapestry 4. That was quite a while back and don't really remember any of it, which is probably a good thing considering how different Tapestry 5 is. I've gone through the Tapestry 5 tutorial a few times and was thrilled to recently discover it now has some database examples. The last page of the tutorial says: ... but Tapestry and this tutorial are a work in progress, so stay patient, and check out the other Tapestry tutorials and resources available on the Tapestry 5 home page. I checked the Tapestry 5 home page but couldn't find any other tutorials. I'm anxiously awaiting other tutorials and/or additional sections of the current tutorial. I purchased Tapestry 5: Building Web Applications: A step-by-step guide to Java Web development with the developer-friendly Apache Tapestry framework when I first heard about it but was underwhelmed, especially with it's lack of database examples. Now that the tutorial has got me going with some database examples, I'm taking another look at that book. Will all the examples in the book work with the current version of Tapestry 5 or are there any changes I should be aware of? Are there any other Tapestry 5 books available now or in the near future? Where can I find some relational database examples? I think I came across a couple of entity examples with annotations along the line of @ManyToMany, @OneToMany, etc., in the documentation section of the Tapestry web site but I'm now having trouble finding them again. Can the grid component handle hierarchical data? For example, the brags page on WAG's website currently looks something like: http://www.WacoAgilityGroup.org/WAG/Brags/ which is pulling data from three different tables. The Members page currently looks like: http://www.WacoAgilityGroup.org/WAG/Members/ It's currently a static page but I'm planning to move everything into the database, which will also involve a few tables. If the grid component can handle hierarchical data, can someone point me towards some examples? Kevin http://www.RawFedDogs.net http://www.WacoAgilityGroup.org Bruceville, TX Si hoc legere scis nimium eruditionis habes. Longum iter est per praecepta, breve et efficax per exempla!!! - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5] Any component nullpointer
Hello, I have a mixin that takes two Any components as parameters. As long as the Any components are *before* the mixin in the template everything is ok, but if I move the Any component after the mixin (after the component that contains the mixin) it throws nullpointer while trying to access the client id. Small part from Any.java: public String getClientId() { if (uniqueId == null) { uniqueId = renderSupport.allocateClientId(clientId); anyElement.forceAttributes(id, uniqueId); } return uniqueId; } The anyElement is always null if the mixin is before the anyElement in the template. Should the any component do some initialization there if anyElement is null? - Ville The mixin: @Parameter(allowNull=true,defaultPrefix=component) private Any sumField; @Parameter(allowNull=true,defaultPrefix=component) private Any priceField; /** * The field component to which this mixin is attached. */ @InjectContainer private ClientElement clientElement; @Environmental private RenderSupport renderSupport; @Inject private ComponentResources componentResources; void afterRender(MarkupWriter writer) throws Exception { String df = JSUtil.commaSeparatedListToJSStringArray(disableFields); String ccf = JSUtil.commaSeparatedListToJSStringArray(classChangeFields); String sumFieldString = ; if(componentResources.isBound(sumField)){ sumFieldString = sumField.getClientId(); } String priceFieldString = ; if(componentResources.isBound(priceField)){ priceFieldString = priceField.getClientId(); } renderSupport.addScript(disableAndChangeElements('%s', '%s', '%s', %s, %s, '%s', '%s');, clientElement.getClientId(), enabledCssClass, disabledCssClass, ccf, df, sumFieldString, priceFieldString); } And the stacktrace: * org.apache.tapestry5.corelib.components.Any.getClientId(Any.java:75) * com.orient.web.customer.mixins.DisableAndChangeClass.afterRender(DisableAndChangeClass.java:63) * com.orient.web.customer.mixins.DisableAndChangeClass.afterRender(DisableAndChangeClass.java) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$6$1.run(ComponentPageElementImpl.java:203) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:925) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$6.render(ComponentPageElementImpl.java:207) * org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) * org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) * org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) * org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) * org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) * org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) * org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) * org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) * org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) * org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) * org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) * org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) * com.orient.framework.tapestry.filter.ProtectedPageFilterImpl.handle(ProtectedPageFilterImpl.java:51) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) * org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) * org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029) * org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) * org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) * org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:621) * org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:611) * org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) * com.orient.web.customer.services.CustomerclientModule$1.service(CustomerclientModule.java:334) *
Re: [T5] Any component nullpointer
Forgot to mention that I'm using 5.0.18. - Ville Ville Virtanen wrote: Hello, I have a mixin that takes two Any components as parameters. As long as the Any components are *before* the mixin in the template everything is ok, but if I move the Any component after the mixin (after the component that contains the mixin) it throws nullpointer while trying to access the client id. Small part from Any.java: public String getClientId() { if (uniqueId == null) { uniqueId = renderSupport.allocateClientId(clientId); anyElement.forceAttributes(id, uniqueId); } return uniqueId; } The anyElement is always null if the mixin is before the anyElement in the template. Should the any component do some initialization there if anyElement is null? - Ville The mixin: @Parameter(allowNull=true,defaultPrefix=component) private Any sumField; @Parameter(allowNull=true,defaultPrefix=component) private Any priceField; /** * The field component to which this mixin is attached. */ @InjectContainer private ClientElement clientElement; @Environmental private RenderSupport renderSupport; @Inject private ComponentResources componentResources; void afterRender(MarkupWriter writer) throws Exception { String df = JSUtil.commaSeparatedListToJSStringArray(disableFields); String ccf = JSUtil.commaSeparatedListToJSStringArray(classChangeFields); String sumFieldString = ; if(componentResources.isBound(sumField)){ sumFieldString = sumField.getClientId(); } String priceFieldString = ; if(componentResources.isBound(priceField)){ priceFieldString = priceField.getClientId(); } renderSupport.addScript(disableAndChangeElements('%s', '%s', '%s', %s, %s, '%s', '%s');, clientElement.getClientId(), enabledCssClass, disabledCssClass, ccf, df, sumFieldString, priceFieldString); } And the stacktrace: * org.apache.tapestry5.corelib.components.Any.getClientId(Any.java:75) * com.orient.web.customer.mixins.DisableAndChangeClass.afterRender(DisableAndChangeClass.java:63) * com.orient.web.customer.mixins.DisableAndChangeClass.afterRender(DisableAndChangeClass.java) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$6$1.run(ComponentPageElementImpl.java:203) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:925) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl.access$200(ComponentPageElementImpl.java:50) * org.apache.tapestry5.internal.structure.ComponentPageElementImpl$6.render(ComponentPageElementImpl.java:207) * org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) * org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121) * org.apache.tapestry5.services.TapestryModule$19.renderMarkup(TapestryModule.java:1200) * org.apache.tapestry5.services.TapestryModule$29.renderMarkup(TapestryModule.java:1580) * org.apache.tapestry5.services.TapestryModule$28.renderMarkup(TapestryModule.java:1561) * org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1543) * org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1525) * org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1495) * org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64) * org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:57) * org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:59) * org.apache.tapestry5.services.TapestryModule$35.handle(TapestryModule.java:1779) * com.orient.framework.tapestry.filter.ProtectedPageFilterImpl.handle(ProtectedPageFilterImpl.java:51) * org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:92) * org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:71) * org.apache.tapestry5.services.TapestryModule$17.service(TapestryModule.java:1029) * org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42) * org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) * org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:621) * org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:611) *
Re: spring context troubles
Seems like I'm faced with two evils: breaking compatibility on the one hand, maintaining two different sets of Spring integration on the other. On Fri, Jan 2, 2009 at 10:50 AM, Fernando Padilla f...@alum.mit.edu wrote: That's alright to keep them separate, but I'm just worried that the 5.0.18 will stop working at some point.. That is why I proposed that you should really have two different pacakges.. one for each direction of integration, and people can explicitly choose which one to use. It just seems kind of brittle saying never to upgrade your spring package, that strategy will fail at some point, and could just confuse people in the interim... Howard Lewis Ship wrote: Actually, I'm liking the idea that compatibility on this comes from continuing to use the old version of tapestry-spring. I haven't found a way to do both: allow injection of Tapestry services into Spring beans and expose Spring beans as Tapestry services. The lifecycles of the two containers do not mesh easily. On Thu, Jan 1, 2009 at 3:23 PM, Fernando Padilla f...@alum.mit.edu wrote: nice work around. but I want to make sure, this will be a temporary work around until you get the latest spring module working as you desire, with two-way integration?? Howard Lewis Ship wrote: I think the best option for you is to use Tapestry 5.1, but revert tapestry-spring to 5.0.18. This allows you to benefit from the improvements to tapestry-core without having any compatibility problems with the changes to tapestry-spring. I'm adding documentation to the web site to explain this. On Mon, Dec 29, 2008 at 4:20 PM, Fernando Padilla f...@alum.mit.edu wrote: I'm sorry that I'm hammering on this code, while it's still probably a work in progress.. (always available through im) but I commented out the spring ContextLoaderListener, moved the filter up to be first, and this seems to initialize properly at least for Jetty (within eclipse). The next issue, it looks like it did not register the spring beans in the TapestryIoC.. so now I'm getting exceptions saying that it can't find particular beans: Caused by: java.lang.RuntimeException: Service id 'common-conf-properties' is not defined by any module. Defined services: ActionRenderResponseGenerator, AjaxComponentEventRequestHandler, AjaxComponentEventResultProcessor, AjaxPartialResponseRenderer, Alias, AliasOverrides, AppSubscriptionHandler, ApplicationContext, ApplicationDefaults, ApplicationGlobals, ApplicationInitializer, ApplicationStateManager, ApplicationStatePersistenceStrategySource, AspectDecorator, AssetBindingFactory, AssetObjectProvider, AssetSource, BaseURLSource, BeanBlockOverrideSource, BeanBlockSource, BeanModelSource, BindingSource, ChainBuilder, ClassNameLocator, ClasspathAssetAliasManager, ClasspathAssetFactory, ClasspathURLConverter, ClientPersistentFieldStorage, ClientPersistentFieldStrategy, ComponentClassCache, ComponentClassFactory, ComponentClassResolver, ComponentClassTransformWorker, ComponentClassTransformer, ComponentClassesInvalidationEventHub, ComponentDefaultProvider, ComponentEventRequestHandler, ComponentEventResultProcessor, ComponentInstanceResultProcessor, ComponentInstantiatorSource, ComponentInvocationMap, ComponentMessagesInvalidationEventHub, ComponentMessagesSource, ComponentPageElementResourcesSource, ComponentSource, ComponentTemplateSource, ComponentTemplatesInvalidationEventHub, Context, ContextAssetFactory, ContextPathEncoder, ContextValueEncoder, CookieSink, CookieSource, Cookies, CtClassSource, DataTypeAnalyzer, DefaultDataTypeAnalyzer, DefaultFileItemFactory, DefaultImplementationBuilder, EndOfRequestListenerHub, Environment, EnvironmentalShadowBuilder, ExceptionAnalyzer, ExceptionTracker, FacebookAuthFilterImpl, FactoryDefaults, FbForceModeFilter, FieldTranslatorSource, FieldValidationSupport, FieldValidatorDefaultSource, FieldValidatorSource, FormSupport, HiddenFieldLocationRules, HttpServletRequest, HttpServletRequestHandler, IgnoredPathsFilter, InjectionProvider, InternalRequestGlobals, LinkCreationHub, LinkFactory, LocalizationSetter, LocationRenderer, LoggingDecorator, MarkupRenderer, MarkupWriterFactory, MasterDispatcher, MasterObjectProvider, MessageBindingFactory, MetaDataLocator, MultipartDecoder, NullFieldStrategyBindingFactory, NullFieldStrategySource, ObjectRenderer, OsForceTypeFilter, PageActivationContextCollector, PageContentTypeAnalyzer, PageDocumentGenerator, PageElementFactory, PageLoader, PageMarkupRenderer, PagePool, PageRenderQueue, PageRenderRequestHandler, PageResponseRenderer, PageTemplateLocator, PartialMarkupRenderer, PersistentFieldManager, PersistentLocale, PipelineBuilder, PropBindingFactory, PropertyAccess, PropertyConduitSource, PropertyShadowBuilder, RegistryStartup, RenderSupport, Request, RequestExceptionHandler, RequestGlobals, RequestHandler, RequestLogFilter, RequestPageCache, RequestPathOptimizer,
Re: T5 newbie books/tutorials and a couple of questions?
There are some on the tapestry wiki, under the Tapestry 5 How-Tos. Christian. On 2-Jan-09, at 13:51 , Kevin Monceaux wrote: Tapestry Fans, I've been tinkering with Tapestry a little bit off and on but am still pretty much a complete newbie. In the past I've tried a few other Java frameworks, but a framework that requires more lines of XML configuration than lines of source code never made any sense to me. I've also tinkered a bit with various script based frameworks like Ruby on Rails and Django. At the moment I have two websites I act as webmaster for. My personal web site is currently a mixture of PHP and PSP(Pascal Server Pages). Actually I think PSP is now known as PWU - Pascal Web Units. The second is a local canine agility group's web site which is currently Django based. I'm considering converting both to Tapestry. In the past I purchased the PDF version of Enjoying Web Development with Tapestry and went through part of it with Tapestry 4. That was quite a while back and don't really remember any of it, which is probably a good thing considering how different Tapestry 5 is. I've gone through the Tapestry 5 tutorial a few times and was thrilled to recently discover it now has some database examples. The last page of the tutorial says: ... but Tapestry and this tutorial are a work in progress, so stay patient, and check out the other Tapestry tutorials and resources available on the Tapestry 5 home page. I checked the Tapestry 5 home page but couldn't find any other tutorials. I'm anxiously awaiting other tutorials and/or additional sections of the current tutorial. I purchased Tapestry 5: Building Web Applications: A step-by-step guide to Java Web development with the developer-friendly Apache Tapestry framework when I first heard about it but was underwhelmed, especially with it's lack of database examples. Now that the tutorial has got me going with some database examples, I'm taking another look at that book. Will all the examples in the book work with the current version of Tapestry 5 or are there any changes I should be aware of? Are there any other Tapestry 5 books available now or in the near future? Where can I find some relational database examples? I think I came across a couple of entity examples with annotations along the line of @ManyToMany, @OneToMany, etc., in the documentation section of the Tapestry web site but I'm now having trouble finding them again. Can the grid component handle hierarchical data? For example, the brags page on WAG's website currently looks something like: http://www.WacoAgilityGroup.org/WAG/Brags/ which is pulling data from three different tables. The Members page currently looks like: http://www.WacoAgilityGroup.org/WAG/Members/ It's currently a static page but I'm planning to move everything into the database, which will also involve a few tables. If the grid component can handle hierarchical data, can someone point me towards some examples? Kevin http://www.RawFedDogs.net http://www.WacoAgilityGroup.org Bruceville, TX Si hoc legere scis nimium eruditionis habes. Longum iter est per praecepta, breve et efficax per exempla!!! - 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 newbie books/tutorials and a couple of questions?
Search the list for the Jumpstart application. It has been kept right up to date with the latest release of T5. I think you will find it has many good examples. (Also, search the Wiki for titles with Tapestry5. It's not all up to date, but there's some great stuff.) I'm not sure you really want a grid for what you have displayed, but rather Loops generating the tables on your own. Because you have both column and row groupings (COLSPAN,ROWSPAN) on the pages you listed, I'm not sure how you would do things like apply sorting. You could override the cell contents to come up with some really custom stuff, and you can even put grids within cells of other grids. The annotations you mention (like @OneToMany) are part of Hibernate Annotations, and there is a tapestry-hibernate module for easy integration of Hibernate. I do my Hibernate integration with Spring (and tapestry-spring), but it will make life simpler if you can do it with tapestry-hibernate. In the end, it doesn't really matter to Tapestry how you construct your object graph. Hibernate has a learning curve all its own, so if you're not familiar with it, take some time to learn it on its own. At least be prepared for some hair-pulling if you try to learn both Tapestry and Hibernate at the same time. Jonathan -Original Message- From: dok...@phideaux.rawfeddogs.net [mailto:dok...@phideaux.rawfeddogs.net] On Behalf Of Kevin Monceaux Sent: Friday, January 02, 2009 13:51 To: Tapestry Users Subject: T5 newbie books/tutorials and a couple of questions? Tapestry Fans, I've been tinkering with Tapestry a little bit off and on but am still pretty much a complete newbie. In the past I've tried a few other Java frameworks, but a framework that requires more lines of XML configuration than lines of source code never made any sense to me. I've also tinkered a bit with various script based frameworks like Ruby on Rails and Django. At the moment I have two websites I act as webmaster for. My personal web site is currently a mixture of PHP and PSP(Pascal Server Pages). Actually I think PSP is now known as PWU - Pascal Web Units. The second is a local canine agility group's web site which is currently Django based. I'm considering converting both to Tapestry. In the past I purchased the PDF version of Enjoying Web Development with Tapestry and went through part of it with Tapestry 4. That was quite a while back and don't really remember any of it, which is probably a good thing considering how different Tapestry 5 is. I've gone through the Tapestry 5 tutorial a few times and was thrilled to recently discover it now has some database examples. The last page of the tutorial says: ... but Tapestry and this tutorial are a work in progress, so stay patient, and check out the other Tapestry tutorials and resources available on the Tapestry 5 home page. I checked the Tapestry 5 home page but couldn't find any other tutorials. I'm anxiously awaiting other tutorials and/or additional sections of the current tutorial. I purchased Tapestry 5: Building Web Applications: A step-by-step guide to Java Web development with the developer-friendly Apache Tapestry framework when I first heard about it but was underwhelmed, especially with it's lack of database examples. Now that the tutorial has got me going with some database examples, I'm taking another look at that book. Will all the examples in the book work with the current version of Tapestry 5 or are there any changes I should be aware of? Are there any other Tapestry 5 books available now or in the near future? Where can I find some relational database examples? I think I came across a couple of entity examples with annotations along the line of @ManyToMany, @OneToMany, etc., in the documentation section of the Tapestry web site but I'm now having trouble finding them again. Can the grid component handle hierarchical data? For example, the brags page on WAG's website currently looks something like: http://www.WacoAgilityGroup.org/WAG/Brags/ which is pulling data from three different tables. The Members page currently looks like: http://www.WacoAgilityGroup.org/WAG/Members/ It's currently a static page but I'm planning to move everything into the database, which will also involve a few tables. If the grid component can handle hierarchical data, can someone point me towards some examples? Kevin http://www.RawFedDogs.net http://www.WacoAgilityGroup.org Bruceville, TX Si hoc legere scis nimium eruditionis habes. Longum iter est per praecepta, breve et efficax per exempla!!! - 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