Re: Testify and Injecting Services from IOC Registry
Paul, Hm it appears to give me a copy of the registry, but not the same instance that was used for testing the pages. For example, my tests open a file based database and use it for the web app. At the end of the test I want to close it. Using the code you sent, it appears that the other copy of the registry attempts to open this database before calling the close command. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Testify and Injecting Services from IOC Registry
The code you sent does indeed appear to work. Thank you very much for your help. Mark - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5Eclipse patch
Everything on that page seems to just link back to itself. There there information about the plugin somewhere else? Mark On Aug 28, 2009, at 4:32 AM, Juan Miguel Salamanca wrote: I think the project home is here: http://tapestry.formos.com/wiki/display/t5eclipse/Home
Re: T5.1: Nested/indrect message: values
If anyone cares, this is how I'm currently doing it. .java: @Inject private Messages messages; public String getEnumName(Enum e) { return messages.get(e + ".name"); } .tml: ${getEnumName(contentArea)} mrg On Fri, Aug 28, 2009 at 8:49 AM, Michael Gentry wrote: > Yeah, this is what I'm currently doing, but I thought there might be a > way to do it in the template. > > Thanks, > > mrg > > > On Fri, Aug 28, 2009 at 6:45 AM, Sebastian > Hennebrueder wrote: >> You may provide a @Property for your current loop value >> and a >> public String getMyMessage() method which builds the key and returns the >> message from the bundle using this key. >> > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1: Nested/indrect message: values
Yeah, this is what I'm currently doing, but I thought there might be a way to do it in the template. Thanks, mrg On Fri, Aug 28, 2009 at 6:45 AM, Sebastian Hennebrueder wrote: > You may provide a @Property for your current loop value > and a > public String getMyMessage() method which builds the key and returns the > message from the bundle using this key. > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
That actually did the trick. Just create the simple spring bean listed below, and inject it instead of ApplicationGlobals into your SymbolSource. import javax.servlet.ServletContext; import org.springframework.web.context.ServletContextAware; public class ServletContextProvider implements ServletContextAware { private ServletContext servletContext; public ServletContext getServletContext() { return servletContext; } public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } } On Fri, Aug 28, 2009 at 1:45 PM, Inge Solvoll wrote: > This last post didn't help in my attempt at trying to use > ApplicationGlobals.getServletContext() in my SymbolSource implementation. > But could this help? I will try it out > > http://forum.springsource.org/showthread.php?t=39927 > > > On Tue, Oct 7, 2008 at 4:54 PM, Francois Armand wrote: > >> Ville Virtanen wrote: >> >>> I have no new info on this, and I think we should add ticket to get this >>> sorted. (If it is something we do wrong -> correct the documentation or >>> then >>> it is a bug that needs a fix anyway.) >>> >>> >> I search forward and find a solution that works for me, I hope it may help >> you too : >> >> http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.usersproblem >> injecting+page:1+mid:lnvawscuxr44aasv+state:results >> >> So, basically, the problem is that the Tapestry Request and Response >> object are saved in RequestGlobal object only in the Terminator of the >> RequestHandler pipeline. But the ApplicationStateManager, and perhaps other >> services, tries to access to the (T5) Request thanks to >> RequestGlobal#getRequest(), which is null : we did not reach the terminator >> yet. >> >> So, I just created a RequestHandler that does the same thing that the >> terminator (requestGlobals.storeRequestResponse(request, response)) and >> contribute it before all other RequestHandler. >> >> I believe that we may have the same problem with HttpRequestHandler, as >> the RequestGlobal#storeServletRequestResponse is called in theterminator of >> HttpRequestHandler pipeline. >> >> Hope it will help you. >> >> >> The code (copy&paste from the other email (save you a click) : >> >> public static RequestFilter buildSetRequestResponse(final RequestGlobals >> requestGlobals) { >> return new RequestFilter(){ >> public boolean service(Request request, Response response, >> RequestHandler handler) throws IOException { >> requestGlobals.storeRequestResponse(request, response); >> return handler.service(request, response); >> } >> }; >> } >> >> public static void >> contributeRequestHandler(OrderedConfiguration configuration, >> @InjectService("setRequestResponse") RequestFilter >> setRequestResponse, >> (other handlers)) { >> configuration.add("setRequestResponse", setRequestResponse, >> "before:*"); >> ... >> >> } >> >> >> >> >> -- >> Francois Armand >> Etudes & Développements J2EE >> Groupe Linagora - http://www.linagora.com >> Tél.: +33 (0)1 58 18 68 28 >> --- >> 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: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
This last post didn't help in my attempt at trying to use ApplicationGlobals.getServletContext() in my SymbolSource implementation. But could this help? I will try it out http://forum.springsource.org/showthread.php?t=39927 On Tue, Oct 7, 2008 at 4:54 PM, Francois Armand wrote: > Ville Virtanen wrote: > >> I have no new info on this, and I think we should add ticket to get this >> sorted. (If it is something we do wrong -> correct the documentation or >> then >> it is a bug that needs a fix anyway.) >> >> > I search forward and find a solution that works for me, I hope it may help > you too : > > http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.usersproblem > injecting+page:1+mid:lnvawscuxr44aasv+state:results > > So, basically, the problem is that the Tapestry Request and Response object > are saved in RequestGlobal object only in the Terminator of the > RequestHandler pipeline. But the ApplicationStateManager, and perhaps other > services, tries to access to the (T5) Request thanks to > RequestGlobal#getRequest(), which is null : we did not reach the terminator > yet. > > So, I just created a RequestHandler that does the same thing that the > terminator (requestGlobals.storeRequestResponse(request, response)) and > contribute it before all other RequestHandler. > > I believe that we may have the same problem with HttpRequestHandler, as the > RequestGlobal#storeServletRequestResponse is called in theterminator of > HttpRequestHandler pipeline. > > Hope it will help you. > > > The code (copy&paste from the other email (save you a click) : > > public static RequestFilter buildSetRequestResponse(final RequestGlobals > requestGlobals) { > return new RequestFilter(){ > public boolean service(Request request, Response response, > RequestHandler handler) throws IOException { > requestGlobals.storeRequestResponse(request, response); > return handler.service(request, response); > } > }; > } > > public static void > contributeRequestHandler(OrderedConfiguration configuration, > @InjectService("setRequestResponse") RequestFilter > setRequestResponse, > (other handlers)) { > configuration.add("setRequestResponse", setRequestResponse, > "before:*"); > ... > > } > > > > > -- > Francois Armand > Etudes & Développements J2EE > Groupe Linagora - http://www.linagora.com > Tél.: +33 (0)1 58 18 68 28 > --- > 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: T5.1: Nested/indrect message: values
You may provide a @Property for your current loop value and a public String getMyMessage() method which builds the key and returns the message from the bundle using this key. Michael Gentry schrieb: Hi everyone, I'm trying to use the message catalog to look up values in a loop. I have a List of enums and bind the loop's source to contentAreas and the value to contentArea. I'm then trying to extract a value from the message catalog with: ${message:${contentArea}-name} I was hoping ${contentArea} would get replaced by the value of my enum (let's say FOO) and get substituted so that it then did a ${message:FOO-name}, but instead I get this error: [[missing key: ${contentArea.name]]-name} I also tried: ${message:${contentArea}} My .properties file looked something like this: FOO = Some Value FOO-name = Some Value Can this be done? Thanks, mrg - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5Eclipse patch
Thanks Inge, I will start working on this shortly. I will send an email to the list when I am finished. On Fri, Aug 28, 2009 at 8:33 AM, Inge Solvoll wrote: > As I mentioned on another topic, this nice project desperately needs some > simple documentation on the home page. If someone provides that, I'm sure > it > will get the attention it deserves from both users and contributors. > > Regards > Inge > > On Thu, Aug 27, 2009 at 7:10 PM, akira wrote: > > > I think the project home is here: > > > > http://tapestry.formos.com/wiki/display/t5eclipse/Home > > > > On Aug 27, 2009, at 11:32 PM, users-digest-h...@tapestry.apache.orgwrote: > > > > From: Erik Putrycz > >> Date: August 27, 2009 4:38:52 AM JST > >> To: users@tapestry.apache.org > >> Subject: T5Eclipse patch > >> > >> > >> > >> Is someone still in charge of T5Eclipse? I fixed a small annoying bug > that > >> causes bunch of NPEs but I have no clue what is the good place to submit > >> patches. > >> > >> Erik. > >> > > > > >
XML breaks inline JavaScript - a detailed analysis
Hello, if I enforce text/xml content header using @Meta("tapestry.response-content-type=text/xml") the chenille kit autocomplete component stops to work. The reason is simple. The javascript is added inline without a CDATA section. I found discussions here but it looks like as this is not finally solved. I researched this in some more detail and post my findings here. Pages rendered as text/xml or application/xml interprete all code as markup. If code contains just characters (CDATA) then it needs to be escaped using a CDATA section. This is required for CSS styles and JavaScript which are used inline in a page. 1) solution use CSS and JavaScript only in external files and include them. There is only a problem with inline CSS and JavaScript 2) correct use of CSS and JavaScript inlined The correct use of CSS and JavaScript is the following This is described for example here http://javascript.about.com/library/blxhtml.htm The article mentions already old browsers and in additon there is an issue with IE6, IE7 and IE8 For the IEs: If you deliver the content with the response header application/xml then the content is not interpreted. There is a workaround to let IE fall back to text/html which is described here http://www.w3.org/MarkUp/2004/xhtml-faq#ie If IE falls back to text/html then we need to escape the CDATA section with a comment. Otherwise it would be interpreted by the browser and of course the browser would fail because */ But Tapestry makes uses the text/xml which is at least partly interpreted by IE browsers. See the compatible list here http://www.w3.org/TR/2009/NOTE-xhtml-media-types-20090116/ As a consequence, we could live with a non uncommted CDATA if we don't need to support the browsers which to not interprete text/xml. See the list here. It contains things like Microsoft Internet Explorer 5.2.3/Mac, Netscape Browser 8.0.1 (using IE), w3m 0.5.1, iCab 2.9.8 Summary, I would vote for a normal CDATA section if the page is rendered as text/xml. The non compatible browsers are extremly old and rarely used. By the way, If I use text/html it seems that the output if not correct as is written as and is written as and has a short closing tag and not a separate tag