Re: t5 How to use renderInformals together with t:body

2009-03-13 Thread ningdh
Hi,

I don't think ComponentResources.renderInformals would affect . In my 
project I can use them together: In beginRender to renderInformals and put 
 in template.

Thanks,
DH
- Original Message - 
From: "luna_guo" 
To: 
Sent: Saturday, March 14, 2009 9:31 AM
Subject: t5 How to use renderInformals together with t:body


> 
> In the template i need .It doesn't work when i use
> ComponentResources.renderInformals.Is there any way to render body in
> component class ?
> 
> 
> 
> thanks in advance
> luna
> -- 
> View this message in context: 
> http://www.nabble.com/t5--How-to-use-renderInformals-together-with-t%3Abody-tp22508231p22508231.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.1] generator meta screws up xml response

2009-03-13 Thread Joost Schouten (mailing lists)
I see your point. Maybe you should check if the root element is 
or not. If not, don't add the  and . If you agree, I could
build a patch for this.

Cheers, Joost

On Fri, Mar 13, 2009 at 9:44 AM, Howard Lewis Ship  wrote:
> How would you distinguish between an XML response and an XHTML response?
>
> On Thu, Mar 12, 2009 at 8:49 PM, Joost Schouten (mailing lists)
>  wrote:
>> Hi,
>>
>> I have Tapestry generate an XML igoogle gadget file and have set the
>> @Meta("tapestry.response-content-type=text/xml") Recently however my
>> xml results in:
>>
>> 
>>    
>>        
>>    
>>    
>>    
>>        Hello, world!
>>    
>> 
>>
>> It might be a good idea to have Tapestry recognize the content type
>> and only add the genrator Meta info on text/html content types. Or am
>> I missing something. Setting SymbolConstants.OMIT_GENERATOR_META=true
>> application wide fixes the problem, but that seems to rigorous for
>> just one or 2 xml resonses.
>>
>> Cheers,
>> Joost
>>
>> -
>> 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



t5 How to use renderInformals together with t:body

2009-03-13 Thread luna_guo

In the template i need .It doesn't work when i use
ComponentResources.renderInformals.Is there any way to render body in
component class ?



thanks in advance
luna
-- 
View this message in context: 
http://www.nabble.com/t5--How-to-use-renderInformals-together-with-t%3Abody-tp22508231p22508231.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

2009-03-13 Thread Alex Kotchnev
Jens,
  once again, I'm not the right person to respond to the question of whether
it's possible to move the reloading to a different thread if changes exist -
probably a queston for one of the core devs. Although, if you say that the
root of the issue is a bug in the 64 bit JVM (that may be fixed some day),
I'm not sure how much water the argument would hold.

   On your issues around T5 versions : although I don't recall the details,
I definitely know that some deadlock issues (with the startup of the app)
were dealt with in the versions between 5.0.13 and 5.0.18; thus, trying out
5.0.18 would be strongly recommended before the option above.

Cheers,

Alex Kotchnev

On Mon, Mar 9, 2009 at 7:08 PM,  wrote:

> 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,  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: Template in Overlay WAR

2009-03-13 Thread Geoffrey Wiseman
On Fri, Mar 13, 2009 at 5:43 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Em Fri, 13 Mar 2009 18:13:03 -0300, Geoffrey Wiseman <
> geoffrey.wise...@gmail.com> escreveu:
>
>  I've got a template (.tml) in a WAR overlay coming from another project
>>
>
> Are you templates in the classpath or under the webapp root? Putting them
> in the classpath saves a lot of trouble and makes you have a single place to
> put your templates, regardless of them being part of pages or components.
>

Webapp Root currently -- I can try classpath to see if it changes anything
in this case.

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/


Re: Template in Overlay WAR

2009-03-13 Thread Thiago H. de Paula Figueiredo
Em Fri, 13 Mar 2009 18:13:03 -0300, Geoffrey Wiseman  
 escreveu:



I've got a template (.tml) in a WAR overlay coming from another project


Are you templates in the classpath or under the webapp root? Putting them  
in the classpath saves a lot of trouble and makes you have a single place  
to put your templates, regardless of them being part of pages or  
components.


--
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: jetty and intellij

2009-03-13 Thread Luther Baker
Hey Howard,

> I know I must be missing a setting in IntelliJ - thoughts?

Who's complaining? My original post asked for thoughts ...

The majority of my second post was was in  brackets. Don't take that
too too seriously - your response to my original question - with another
question was essentially asking "well, why would you want to do a thing like
that?" ... so, I elaborated :) Again - it was in brackets so you'd know I
was preaching, big ideals, big picture stuff ...

No insult taken - I didn't know Maven bothered you so. We've not had to
tweak, refactor or worry about plugins with Maven. I just type mvn jetty:run
and everything downloads and has worked well. Luntbuild, Cruise Conrol,
Netbeans, Eclipse and IntelliJ all run from the same project build and been
doing so without custom tweaks for the past year.

In this specific case, I was just looking for the magic flag inside of
IntelliJ to push changes out ... not complaining about it.

-Luther



On Fri, Mar 13, 2009 at 4:08 PM, Howard Lewis Ship  wrote:

> Ok, then, why are you then complaining on the Tapestry mailing list
> about your Maven stuff not working correctly?  I don't mean to be
> insulting ... I'm just saying that the myth of Maven seems to far
> outdistance the reality.  It's always just one more little tweak, one
> more refactoring, one more update to a plugin ... and it never ends!
>
> I think the core idea: versioned dependencies with transitive
> relationships, is very, very good. I just want to get away from using
> the build portion.
>
> On Fri, Mar 13, 2009 at 11:48 AM, Luther Baker 
> wrote:
> > Thanks Richard. That helps and I'll take a look ...
> >
> > 
> > One build process. Cross platform. IDE agnostic. That is our motto.
> >
> > Our continuous integration / build process is IDE agnostic. Maven builds,
> > runs and tests the app on Unix servers, windows boxes and Macs.
> > Additionally, NetBeans has native support for Maven projects. Most of our
> > team uses Eclipse and the Maven plugin works without any Eclipse specific
> > config. I fired up IntelliJ and the app built and deployed right out of
> the
> > box ... I'm just wondering where the flag is to automatically update apps
> > running via that plugin.
> >
> > I can/will look at the IDE specific plugin - but it is not my first
> choice -
> > and it's alot more than just *simplicity*.
> >
> > By leveraging Maven, configuration and classpaths are always built the
> same
> > way - dev, test and prod builds (cruise control, luntbuild, etc) and can
> be
> > built and deployed without IDE dependencies. It forms the baseline and
> > everything else works around that foundation. As soon as I have to custom
> > configure Eclipse WTP, MyEclipse or IntelliJ specific Jetty plugins, I
> have
> > to setup the IDE with IDE specific classpaths, etc that don't always work
> > out of the box in the other builds. Maven takes care of all of that for
> us.
> >
> > I've developed with Emacs and Maven on the command line. NetBeans opens
> > Maven projects natively. Maven and Eclipse work almost seamlessly
> (updating
> > classes as source changes). Out of the box, IntelliJ works for the most
> part
> > if I restart the app manually - but I thought I'd check to see if there
> were
> > a flag to auto-restart on changes to source.
> >
> > If one of these IDE editors need special handling, sobeit - but it isn't
> the
> > first thing I'd try or want to do since the general process around Maven
> > works so well. It might be considered forward (or backward) thinking 
> > but alot of it works now - and it is quite simple to setup. Just download
> > and unzip Maven :)
> > 
> >
> > Honestly, once you embrace and use it regularly, Maven becomes very
> > powerful. IDEs become arbitrary since all of them import or open Maven
> > projects. Continuous Integration, Testing and Standard Build processes
> can
> > now define project structure and lifecycle - and IDEs simply adhere to it
> -
> > not the other way around.
> >
> > -Luther
> >
> >
> >
> >
> > On Fri, Mar 13, 2009 at 12:55 PM, Richard Clark 
> wrote:
> >
> >> P.S. http://wiki.apache.org/tapestry/Tapestry5_Run_Jetty_From_IDEA
> >>
> >> (5 minutes and 2 page loads later)
> >>
> >> -
> >> 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
>
>


Template in Overlay WAR

2009-03-13 Thread Geoffrey Wiseman
I've got a template (.tml) in a WAR overlay coming from another project --
(generated HTML from a Flex project).  In the final WAR, it'll be mixed in
to the same folder as everything else, but in development mode, the template
is being loaded by Jetty from a dependency WAR.  This seems to piss off
Tapestry, which says:
An unexpected application exception has occurred.

   - java.lang.RuntimeExceptionPage Crystal did not generate any markup when
   rendered. This could be because its template file could not be located, or
   because a render phase method in the page prevented rendering.
   Stack trace
  -
  
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:67)
  -
  
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)
  -
  
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)
  -
  
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
  -
  
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
  -
  
org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83)
  -
  
org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
  -
  
org.apache.tapestry5.services.TapestryModule$16.service(TapestryModule.java:1007)
  -
  
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
  -
  org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:179)
  -
  
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)
  -

Is there an easy workaround for this, or do I have to find another way
around it (not generating the HTML; not using jetty to handle the overlay;
finding another way to 'include' the content into a Tapestry template that
isn't in the WAR, etc)?  I'm guessing it's having trouble finding the
template from the WAR, although that's not explicit in any message that's
coming out, so perhaps I'm misinterpreting the response.

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/


Re: jetty and intellij

2009-03-13 Thread Howard Lewis Ship
Ok, then, why are you then complaining on the Tapestry mailing list
about your Maven stuff not working correctly?  I don't mean to be
insulting ... I'm just saying that the myth of Maven seems to far
outdistance the reality.  It's always just one more little tweak, one
more refactoring, one more update to a plugin ... and it never ends!

I think the core idea: versioned dependencies with transitive
relationships, is very, very good. I just want to get away from using
the build portion.

On Fri, Mar 13, 2009 at 11:48 AM, Luther Baker  wrote:
> Thanks Richard. That helps and I'll take a look ...
>
> 
> One build process. Cross platform. IDE agnostic. That is our motto.
>
> Our continuous integration / build process is IDE agnostic. Maven builds,
> runs and tests the app on Unix servers, windows boxes and Macs.
> Additionally, NetBeans has native support for Maven projects. Most of our
> team uses Eclipse and the Maven plugin works without any Eclipse specific
> config. I fired up IntelliJ and the app built and deployed right out of the
> box ... I'm just wondering where the flag is to automatically update apps
> running via that plugin.
>
> I can/will look at the IDE specific plugin - but it is not my first choice -
> and it's alot more than just *simplicity*.
>
> By leveraging Maven, configuration and classpaths are always built the same
> way - dev, test and prod builds (cruise control, luntbuild, etc) and can be
> built and deployed without IDE dependencies. It forms the baseline and
> everything else works around that foundation. As soon as I have to custom
> configure Eclipse WTP, MyEclipse or IntelliJ specific Jetty plugins, I have
> to setup the IDE with IDE specific classpaths, etc that don't always work
> out of the box in the other builds. Maven takes care of all of that for us.
>
> I've developed with Emacs and Maven on the command line. NetBeans opens
> Maven projects natively. Maven and Eclipse work almost seamlessly (updating
> classes as source changes). Out of the box, IntelliJ works for the most part
> if I restart the app manually - but I thought I'd check to see if there were
> a flag to auto-restart on changes to source.
>
> If one of these IDE editors need special handling, sobeit - but it isn't the
> first thing I'd try or want to do since the general process around Maven
> works so well. It might be considered forward (or backward) thinking 
> but alot of it works now - and it is quite simple to setup. Just download
> and unzip Maven :)
> 
>
> Honestly, once you embrace and use it regularly, Maven becomes very
> powerful. IDEs become arbitrary since all of them import or open Maven
> projects. Continuous Integration, Testing and Standard Build processes can
> now define project structure and lifecycle - and IDEs simply adhere to it -
> not the other way around.
>
> -Luther
>
>
>
>
> On Fri, Mar 13, 2009 at 12:55 PM, Richard Clark  wrote:
>
>> P.S. http://wiki.apache.org/tapestry/Tapestry5_Run_Jetty_From_IDEA
>>
>> (5 minutes and 2 page loads later)
>>
>> -
>> 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: T5: How to set generated component id

2009-03-13 Thread Thiago H. de Paula Figueiredo
Em Fri, 13 Mar 2009 16:59:36 -0300, Peter Kanze   
escreveu:



Hello,


Hi!


I want to add some blocks with a generated id. like this:


Why exactly do you want blocks? Your example doesn't give any hints.  
Couldn't you just use s instead?



How can I give my block an id based on the current thumbIndex?


AFAIK, you just can't.
Blocks (generated at first: it is always used with the Delegate component or to  
replace a Zone content with AJAX. Given that, it doesn't make much sense  
to put them in a loop.


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



T5: How to set generated component id

2009-03-13 Thread Peter Kanze
Hello,

I want to add some blocks with a generated id. like this:


  
  
  


But I get the following error message:
Block id 'image${thumbIndex}' is not valid; block ids must be valid Java
identifiers: start with a letter, and consist of letters, numbers and
underscores.

How can I give my block an id based on the current thumbIndex?

Any examples?

Thanks!
Peter


Re: jetty and intellij

2009-03-13 Thread Luther Baker
Thanks Richard. That helps and I'll take a look ...


One build process. Cross platform. IDE agnostic. That is our motto.

Our continuous integration / build process is IDE agnostic. Maven builds,
runs and tests the app on Unix servers, windows boxes and Macs.
Additionally, NetBeans has native support for Maven projects. Most of our
team uses Eclipse and the Maven plugin works without any Eclipse specific
config. I fired up IntelliJ and the app built and deployed right out of the
box ... I'm just wondering where the flag is to automatically update apps
running via that plugin.

I can/will look at the IDE specific plugin - but it is not my first choice -
and it's alot more than just *simplicity*.

By leveraging Maven, configuration and classpaths are always built the same
way - dev, test and prod builds (cruise control, luntbuild, etc) and can be
built and deployed without IDE dependencies. It forms the baseline and
everything else works around that foundation. As soon as I have to custom
configure Eclipse WTP, MyEclipse or IntelliJ specific Jetty plugins, I have
to setup the IDE with IDE specific classpaths, etc that don't always work
out of the box in the other builds. Maven takes care of all of that for us.

I've developed with Emacs and Maven on the command line. NetBeans opens
Maven projects natively. Maven and Eclipse work almost seamlessly (updating
classes as source changes). Out of the box, IntelliJ works for the most part
if I restart the app manually - but I thought I'd check to see if there were
a flag to auto-restart on changes to source.

If one of these IDE editors need special handling, sobeit - but it isn't the
first thing I'd try or want to do since the general process around Maven
works so well. It might be considered forward (or backward) thinking 
but alot of it works now - and it is quite simple to setup. Just download
and unzip Maven :)


Honestly, once you embrace and use it regularly, Maven becomes very
powerful. IDEs become arbitrary since all of them import or open Maven
projects. Continuous Integration, Testing and Standard Build processes can
now define project structure and lifecycle - and IDEs simply adhere to it -
not the other way around.

-Luther




On Fri, Mar 13, 2009 at 12:55 PM, Richard Clark  wrote:

> P.S. http://wiki.apache.org/tapestry/Tapestry5_Run_Jetty_From_IDEA
>
> (5 minutes and 2 page loads later)
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: T5: How to load image Asset from filesystem?

2009-03-13 Thread Daniel Jones

Thanks for pointing that out Luther.  I copied it from a project using an
older version of tapestry.


luther.baker wrote:
> 
> Great example - similar to an example on the Wiki ...
> 
> Note that 'createActionLink' was deprecated ...
> 
> http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry5/ComponentResources.html#createActionLink(java.lang.String,%20boolean,%20java.lang.Object..
> .)
> 
> *Deprecated.* *Use createEventLink(String,
> Object[])instead
> *
> -Luther
> 
> 
> 
> On Thu, Mar 12, 2009 at 9:42 PM, Daniel Jones  wrote:
> 
>>
>> Hi Peter,
>>
>> I'm using nabble to post and it seems to have stripped out the img tag.
>>
>> you need an img tag in your template and set the src attribute to
>> ${imagePath}
>>
>> img src="${imagePath}"
>>
>> Hope this helps,
>> Daniel
>>
>>
>> Peter Kanze wrote:
>> >
>> > Hi Daniel,
>> >
>> > Thanks for your example. I tried this one, but the Object onImage is
>> never
>> > called when the page loads.
>> > I am using Tapestry 5.1. The code is equal to your example.
>> >
>> > What could I do wrong?
>> >
>> > regards,
>> > Peter
>> >
>> > On Thu, Mar 12, 2009 at 10:54 AM, Daniel Jones 
>> wrote:
>> >
>> >>
>> >> PAGE CLASS
>> >>
>> >> inject component resources so that you can create an action link
>> >>@Inject
>> >>private ComponentResources mComponentResources;
>> >>
>> >> when the path is requested by the template, create and return an
>> action
>> >> link
>> >>public Link getImagePath() {
>> >>return mComponentResources.createActionLink("image",
>> >> false,
>> >> mItem.getID());
>> >>}
>> >>
>> >> handle this action link
>> >>public Object onImage(long pID) {
>> >> "StreamResponseBuilder" is a class that I have implemented, it
>> basically
>> >> figures out what image to served based on
>> >> the id passed in the context and then gets an "InputStream" for the
>> image
>> >> file on disk and creates and returns a "StreamResponse", so
>> essentially
>> >> you
>> >> want this action handler to return a "StreamResponse" of the image you
>> >> want
>> >> to display.
>> >>return StreamResponseBuilder.getItemImage(pID);
>> >>}
>> >>
>> >> PAGE TEMPLATE
>> >>
>> >> ${imagePath}
>> >>
>> >> Hope this helps
>> >> Regards,
>> >> Daniel
>> >>
>> >>
>> >>
>> >> Peter Kanze wrote:
>> >> >
>> >> > Hello
>> >> >
>> >> > I want to load images from the filesystem, like for example
>> >> > D:/category/1/products/55/thumb.jpg
>> >> >
>> >> > So the file path is dynamic and is based on the categoryId and the
>> >> > productId.
>> >> >
>> >> > How can I load such an image into my webpage using a Tapestry Asset?
>> >> > This looks like a common usecase to me, but I couldn't find any info
>> >> about
>> >> > it.
>> >> >
>> >> > Has somebody already done this? And could he/she show me some code
>> >> > examples?
>> >> > Any help is welcome!
>> >> >
>> >> > Thanks,
>> >> > Peter
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/T5%3A-How-to-load-image-Asset-from-filesystem--tp22433419p22471474.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
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-How-to-load-image-Asset-from-filesystem--tp22433419p22489180.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
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-How-to-load-image-Asset-from-filesystem--tp22433419p22501228.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: jetty and intellij

2009-03-13 Thread Richard Clark
P.S. http://wiki.apache.org/tapestry/Tapestry5_Run_Jetty_From_IDEA

(5 minutes and 2 page loads later)

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



Re: jetty and intellij

2009-03-13 Thread Richard Clark
On Fri, Mar 13, 2009 at 10:43 AM, Howard Lewis Ship  wrote:
> Why do people use jetty:run in IDEA when there's a very good IntelliJ
> plugin that runs Jetty perfectly for Tapestry applications?

Simplicity, I suspect. (There are setup instructions for the Jetty
plugin on the wiki, however.)

BTW, does tapestry.apache.org respond excruciatingly slowly for
anybody else? We're talking 2 1/2 minutes to load any page in the
subsite.

...Richard

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



Re: [T5.1] generator meta screws up xml response

2009-03-13 Thread Howard Lewis Ship
How would you distinguish between an XML response and an XHTML response?

On Thu, Mar 12, 2009 at 8:49 PM, Joost Schouten (mailing lists)
 wrote:
> Hi,
>
> I have Tapestry generate an XML igoogle gadget file and have set the
> @Meta("tapestry.response-content-type=text/xml") Recently however my
> xml results in:
>
> 
>    
>        
>    
>    
>    
>        Hello, world!
>    
> 
>
> It might be a good idea to have Tapestry recognize the content type
> and only add the genrator Meta info on text/html content types. Or am
> I missing something. Setting SymbolConstants.OMIT_GENERATOR_META=true
> application wide fixes the problem, but that seems to rigorous for
> just one or 2 xml resonses.
>
> Cheers,
> Joost
>
> -
> 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: jetty and intellij

2009-03-13 Thread Howard Lewis Ship
Why do people use jetty:run in IDEA when there's a very good IntelliJ
plugin that runs Jetty perfectly for Tapestry applications?

On Fri, Mar 13, 2009 at 8:45 AM, Luther Baker  wrote:
> I just fired up a new download of IntelliJ 8.1. Haven't used it much - so
> pulled an existing Maven/Tapestry project and created a "configuration" for
> jetty:run.
>
> That works great. Through the settings, I also associated *.tml files with
> an html filetype.
>
> Now, if I start the app all is well - but if I make a change to a *.tml file
> - the change is not showing up in the app unless I stop and restart. The
> same goes for Java. I tested by changing a return class from a submit
> handler - but the return page stayed the same.
>
> I know I must be missing a setting in IntelliJ - thoughts?
>
> -Luther
>



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



jetty and intellij

2009-03-13 Thread Luther Baker
I just fired up a new download of IntelliJ 8.1. Haven't used it much - so
pulled an existing Maven/Tapestry project and created a "configuration" for
jetty:run.

That works great. Through the settings, I also associated *.tml files with
an html filetype.

Now, if I start the app all is well - but if I make a change to a *.tml file
- the change is not showing up in the app unless I stop and restart. The
same goes for Java. I tested by changing a return class from a submit
handler - but the return page stayed the same.

I know I must be missing a setting in IntelliJ - thoughts?

-Luther


Re: [t5.0.18] Is it possible to use a filter name other than "app"?

2009-03-13 Thread Howard Lewis Ship
On Thu, Mar 12, 2009 at 7:51 PM, Thiago H. de Paula Figueiredo
 wrote:
> Em Thu, 12 Mar 2009 23:46:13 -0300, Jiang Hua 
> escreveu:
>
>> It seems that the module builder classes are ignored (non method of these
>> methods are executed), when the web app is started, if a filter name
>> different from "app" is used in web.xml. Is it mandatory to use "app"?
>
> No.
>
>> Or is it a bug?
>
> No too. If your filter name is tapestryfilter, your module class will be
> TapestryFilterModule and your properties files will be
> tapestryfiltermodule.properties.


Almost correct.  The filter name is used for the global application
properties file, so a filter name of "tapestryfilter" would look for
WEB-INF/tapestryfilter.properties.

The capitalized name is used for the module, thus
somepackage.service.TapestryfilterModule.  Tapestry doesn't know how
to captialize two word names ... it just capitalizes the first letter.

>
> --
> 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: [t5.0.18] Is it possible to use a filter name other than "app"?

2009-03-13 Thread Thiago H. de Paula Figueiredo
On Fri, Mar 13, 2009 at 1:41 AM, Jiang Hua  wrote:

> Thank you, Thiago. And what if there are spaces in the filter name?

Why would you have spaces in the filter name? Maybe it's not even
correct according to the servlet spec.s

> Where can
> I find a full document about all the tapestry naming conventions?

There isn't one, but each feature that has naming conventions have
them documented in their docs.

-- 
Thiago

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



Re: t5: multiple implementation of a service

2009-03-13 Thread Thiago H. de Paula Figueiredo
Read http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html
from the "Service Ids" section to the end.

-- 
Thiago

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



t5: multiple implementation of a service

2009-03-13 Thread Angelo Chen

Hi,

I have a Service with ServiceImp, it works, now I have a ServiceImp2 that
implents Service as well, as I understand, I can't register ServiceImp2 in
the AppModule, but I'd like to use ServiceImp2 in a specific page, is this
possible? 

Thanks
-- 
View this message in context: 
http://www.nabble.com/t5%3A-multiple-implementation-of-a-service-tp22494983p22494983.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.0.18] Is it possible to nested normal jsp/html content into one layout component region?

2009-03-13 Thread Jonathan O'Connor

Zenberg,
I added Tap5 pages to an existing struts 1 application. The trick is to 
reimplement a login page (I presume you have a login page) as a T5 page, 
and then you can initialize the JSP session variables you need for 
working together. You will also have to be careful generating links from 
JSP to T5 and vice versa. If you do make changes to your layout, then 
you will need to reimplement them in a JSP as well.


Search this list for integrating struts with T5 (also look for Kent 
Tong, who came up with the original solution for T4).

Ciao,
Jonathan

On 13/03/2009 04:48, Zenberg Ding wrote:


But that's only put them together without runtime error. each of them 
is working standalone, so it's not really working together...




As far as I know, you can have Tapestry pages and JSP pages and 
Struts actions in the same application working together, but you 
cannot have JSP and Tapestry templates in the same page. They're 
completely different.




-
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.1 + JSONArray

2009-03-13 Thread Peter Kanze
Thank you Patrick,

I use Firefox 3 on Windows and had the same problem as described in the jira
issue TAP5-469.
The workaround described there (Adding the code below to my appmodule)
solved the problem

public static void
contributeResponseCompressionAnalyzer(Configuration configuration) {
configuration.add("application/json");
}

Thanks!
Peter

On Fri, Mar 13, 2009 at 10:00 AM, Patrick Moriarty <
pmoria...@annadaletech.com> wrote:

> I've also seen this behaviour and ended up turning off GZip compression for
> "application/json" mime type.
>
> See https://issues.apache.org/jira/browse/TAP5-469.
>
> Patrick
>
> 2009/3/12 Howard Lewis Ship 
>
> > It's possible that XmlHttpRequest may not handle GZIPed responses
> > correctly; I'm looking into it.
> >
> > On Thu, Mar 12, 2009 at 4:28 AM, Peter Kanze 
> wrote:
> > > Hi Joost,
> > >
> > > The error is in my javascript, because the response in my javascript is
> > > empty, but a full JSONArray is returned in my java code.
> > > It looks like somewhere between these steps the response gets empty.
> > > Anyone an explanation?
> > >
> > > Here is some code:
> > >
> > > /*
> > > *Java script
> > > */
> > > function fillSubCategories(response) {
> > >   selectElement = $('subCategorySelect');
> > >   clearSelectOption(selectElement);
> > >   var responseJSON = response.evalJSON();
> > >   for (index = 0; index < responseJSON.length; index++) {
> > >   selectElement.options[index] = new
> > > Option(responseJSON[index].label, responseJSON [index].value);
> > >   }
> > >   Tapestry.ElementEffect.highlight($('subCategorySelect'));
> > > }
> > >
> > > /*
> > > *Java page
> > > */
> > > @OnEvent(component = "rootCategorySelect", value = "change")
> > >JSONArray onCategorySelectChanged(String categoryId) {
> > >JSONArray jsonArray = new JSONArray();
> > >if (StringUtils.hasLength(categoryId)) {
> > >try {
> > >List subCategories =
> > > categoryService.getSubCategoriesForCategory(Long.valueOf(categoryId));
> > >for (Category subCategory : subCategories) {
> > >JSONObject jsonObject = new JSONObject();
> > >jsonObject.put("value",
> > subCategory.getId().toString());
> > >jsonObject.put("label", subCategory.getName());
> > >// put the jsonobjects into an array, to maintain
> the
> > > sorted
> > >// order.
> > >jsonArray.put(jsonObject);
> > >}
> > >}
> > >catch (Exception ex) {
> > >logger.error(ex);
> > >}
> > >}
> > >
> > >return jsonArray;
> > >}
> > >
> > > On Thu, Mar 12, 2009 at 12:19 PM, Joost Schouten (mailing lists) <
> > > joost...@jsportal.com> wrote:
> > >
> > >> Do you get an error on your server or in javascript? Because I too
> > >> have been having problems with the JSONResponse.
> > >> transport.responseJSON in my javascript is sometimes null. For some
> > >> weird reason the problem resolved itself when using shorter variable
> > >> names (scarry). Haven't had the time to look into it but maybe it is
> > >> related.
> > >>
> > >> Just thought I'd share,
> > >> Joost
> > >>
> > >> On Thu, Mar 12, 2009 at 7:05 PM, Peter Kanze 
> > wrote:
> > >> > Hello
> > >> >
> > >> > I had implement a depended select box. This works fine in T 5.0.18.
> > But
> > >> > after I upgrade to 5.1 the dependent select doesn't work anymore.
> > >> > Only sometimes. It seems that the response is sometimes filled
> > correctly,
> > >> > but most of the time it is empty. I then mostly get the error
>  "Badly
> > >> formed
> > >> > JSON String"
> > >> >
> > >> > Can someone explain to me why this isn't working in T5.1 and how I
> can
> > >> fix
> > >> > this again?
> > >> >
> > >> > Thanks!
> > >> > Peter
> > >> >
> > >>
> > >> -
> > >> 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: T5.1 + JSONArray

2009-03-13 Thread Patrick Moriarty
I've also seen this behaviour and ended up turning off GZip compression for
"application/json" mime type.

See https://issues.apache.org/jira/browse/TAP5-469.

Patrick

2009/3/12 Howard Lewis Ship 

> It's possible that XmlHttpRequest may not handle GZIPed responses
> correctly; I'm looking into it.
>
> On Thu, Mar 12, 2009 at 4:28 AM, Peter Kanze  wrote:
> > Hi Joost,
> >
> > The error is in my javascript, because the response in my javascript is
> > empty, but a full JSONArray is returned in my java code.
> > It looks like somewhere between these steps the response gets empty.
> > Anyone an explanation?
> >
> > Here is some code:
> >
> > /*
> > *Java script
> > */
> > function fillSubCategories(response) {
> >   selectElement = $('subCategorySelect');
> >   clearSelectOption(selectElement);
> >   var responseJSON = response.evalJSON();
> >   for (index = 0; index < responseJSON.length; index++) {
> >   selectElement.options[index] = new
> > Option(responseJSON[index].label, responseJSON [index].value);
> >   }
> >   Tapestry.ElementEffect.highlight($('subCategorySelect'));
> > }
> >
> > /*
> > *Java page
> > */
> > @OnEvent(component = "rootCategorySelect", value = "change")
> >JSONArray onCategorySelectChanged(String categoryId) {
> >JSONArray jsonArray = new JSONArray();
> >if (StringUtils.hasLength(categoryId)) {
> >try {
> >List subCategories =
> > categoryService.getSubCategoriesForCategory(Long.valueOf(categoryId));
> >for (Category subCategory : subCategories) {
> >JSONObject jsonObject = new JSONObject();
> >jsonObject.put("value",
> subCategory.getId().toString());
> >jsonObject.put("label", subCategory.getName());
> >// put the jsonobjects into an array, to maintain the
> > sorted
> >// order.
> >jsonArray.put(jsonObject);
> >}
> >}
> >catch (Exception ex) {
> >logger.error(ex);
> >}
> >}
> >
> >return jsonArray;
> >}
> >
> > On Thu, Mar 12, 2009 at 12:19 PM, Joost Schouten (mailing lists) <
> > joost...@jsportal.com> wrote:
> >
> >> Do you get an error on your server or in javascript? Because I too
> >> have been having problems with the JSONResponse.
> >> transport.responseJSON in my javascript is sometimes null. For some
> >> weird reason the problem resolved itself when using shorter variable
> >> names (scarry). Haven't had the time to look into it but maybe it is
> >> related.
> >>
> >> Just thought I'd share,
> >> Joost
> >>
> >> On Thu, Mar 12, 2009 at 7:05 PM, Peter Kanze 
> wrote:
> >> > Hello
> >> >
> >> > I had implement a depended select box. This works fine in T 5.0.18.
> But
> >> > after I upgrade to 5.1 the dependent select doesn't work anymore.
> >> > Only sometimes. It seems that the response is sometimes filled
> correctly,
> >> > but most of the time it is empty. I then mostly get the error  "Badly
> >> formed
> >> > JSON String"
> >> >
> >> > Can someone explain to me why this isn't working in T5.1 and how I can
> >> fix
> >> > this again?
> >> >
> >> > Thanks!
> >> > Peter
> >> >
> >>
> >> -
> >> 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
>
>