Re: detecting execution mode

2013-01-15 Thread Lutz Hühnken
Hi John,

you should be able to inject its value into your class with
@Symbol("tapestry.production-mode")

See org.apache.tapestry5.ioc.annotations.Symbol for documentation and
org.apache.tapestry5.SymbolConstants for names.

Hth,
Lutz


On Tue, Jan 15, 2013 at 11:07 AM, John  wrote:
> Hi,
>
> What is a neat way to detect the execution mode? I want to know if my service 
> class is running with development mode so I can switch a feature off.
>
> John

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



Re: Want locale to be part of every uri

2012-01-25 Thread Lutz Hühnken
Hi Nillehammer,

I was facing the same task and took the liberty of using your code -
works like a charm! Thanks for that!

One thing though... it will redirect with a "302 - Found" code, while
I need it to return a "301 - moved permanently".

Maybe it's because it is late, but I can't seem to figure out how to
change that. Do I need to add a custom ComponentEventResultProcessor?
For a custom result type, as "Link" is already being handled?

Or am I overlooking something?

I appreciate your help,

Lutz



On Fri, Jul 1, 2011 at 2:54 AM, Nillehammer
 wrote:
> Hi Thiago,
>
>> I've never tried a ComponentRequestFilter for doing things that involved
>> redirection, as they are invoked way later in the Tapestry processing
>> pipeline. Please post if it works. ;)
>
> It turned out that ComponentRequestFilter has several advandatages over
> RequestFilter:
> 1.) If a locale is present in the uri, the PersistentLocale is set. No
> workaround using ComponentEventLinkEncoder's decodeXXX methods needed.
> 2.) The ThreadLocale already contains a supported locale that can be safely
> used to set the PersistentLocale. In RequestFilter the ThreadLocale is still
> the raw one taken from the request. Which might not be in supported-locales.
> 3.) The methods handlePageRender(...) and handleComponentEvent(...) are a
> directer way of distiguishing between the two types. In
> RequestFilter.service(...) you would have to distinguish them on your own by
> decoding the request with ComponentEventLinkEncoder.
> 4.) In handleComponentEvent you only have to set the persistent locale.
> Tapestry generates redirects for component events anyway. So you don't need
> to bother.
>
> The only (slightly) hard part is building a redirect mechanism in
> handlePageRender(...). I surfed through Tapestry's source code and found out
> that PageRenderRequestHandlerImpl uses a ComponentEventResultProcessor for
> that purpose. I have done that too.
>
> Thanks to you and Howard for helping. And speeking of locales. Its almost
> 03:00 am local time now. I really need to go to bed. My boss is gonna kill
> me, if I oversleep (again).
> Cheers, nillehammer
>
> P.S. The code:
> PersistentLocaleFilter.java:
> /**
>  * Checks, if persistent locale is set. If not will do so and send redirect,
> if
>  * necessary.
>  */
> final class PersistentLocaleFilter implements ComponentRequestFilter {
>
>    /**
>     * Used to set the persistent locale (that's what this filter is all
> about).
>     */
>    private final PersistentLocale persistentLocale;
>
>    /**
>     * Used to determine current locale, if persistent locale is not set.
>     */
>    private final ThreadLocale threadLocale;
>
>    /**
>     * Used to generate a page render link in
>     * {@link #handlePageRender(PageRenderRequestParameters,
> ComponentRequestHandler)}
>     * .
>     */
>    private final ComponentEventLinkEncoder componentEventLinkEncoder;
>
>    /**
>     * Used to add request parameters to the page render link.
>     */
>    private final Request request;
>
>    /**
>     * Used to process the page render link as a redirect.
>     */
>    private final ComponentEventResultProcessor
> componentEventResultProcessor;
>
>    /**
>     * Constructor injecting all dependencies.
>     *
>     * @param persistentLocale
>     * @param threadLocale
>     * @param componentEventLinkEncoder
>     * @param request
>     * @param componentEventResultProcessor
>     */
>    PersistentLocaleFilter(final PersistentLocale persistentLocale,
>            final ThreadLocale threadLocale,
>            final ComponentEventLinkEncoder componentEventLinkEncoder,
>            final Request request,
>            final ComponentEventResultProcessor
> componentEventResultProcessor) {
>
>        this.persistentLocale = persistentLocale;
>
>        this.threadLocale = threadLocale;
>
>        this.componentEventLinkEncoder = componentEventLinkEncoder;
>
>        this.request = request;
>
>        this.componentEventResultProcessor = componentEventResultProcessor;
>    }
>
>    /**
>     * Sets persistent locale if necessary and hands over to the rest of the
>     * chain. Tapestry is generating redirects for component events anyway,
> so we
>     * do not need to do that.
>     */
>    @Override
>    public final void handleComponentEvent(
>            final ComponentEventRequestParameters parameters,
>            final ComponentRequestHandler handler ) throws IOException {
>
>        setPersistentLocaleIfNecessary();
>
>        handler.handleComponentEvent(parameters);
>    }
>
>    /**
>     * Sets persistent locale if necessary and creates a page render link to
>     * redirect to.
>     */
>    @Override
>    public final void handlePageRender(
>            final PageRenderRequestParameters parameters,
>            final ComponentRequestHandler handler ) throws IOException {
>
>        if (setPersistentLocaleIfNecessary()) {
>
>            final Link pageRedirectLink = this.componentEventLinkEncoder
>  

Re: jsp & jstl in tapestry

2012-01-25 Thread Lutz Hühnken
Short answer: no.

Long answer: well, you know, "impossible is nothing". I you really
must, you could probably "mix" Tapestry templates and JSP pages in the
same application, but I cannot think of a good reason why one should
attempt this. What are you trying to achieve? Why not use just
Tapestry, no JSP/JSTL?



On Wed, Jan 25, 2012 at 5:53 PM, csckid  wrote:
> Is it possible to write jstl or use jsp tag in tapestry?
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/jsp-jstl-in-tapestry-tp5430730p5430730.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
>



-- 
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: Is there any way to render the "get" method of form?

2010-09-28 Thread Lutz Hühnken
Dear Thiago,

thanks for your patient reply and the advice. Of course I realize that
I can still implement a search with Tapestry, with redirect-after-post
or else, and I have actually done so in the past.

But please take a minute and think about these two things:

1. You say,
> GET was always meant to be used in request that don't change the state of
> the application (including database)

and this is exactly what I would like to use it for - as I said, a
search. You could re-phrase your argument:
"POST was meant for requests that do change the state."
So why do I have to use it for requests that do not?

2. Of course, a lot of things are doable, change the DOM and what not.
But wasn't the idea of Tapestry "make the simple things easy, the
difficult things possible"?
A form with method=get is totally valid HTML, and I think it should be
easy, not complicated.

These two reasons are why I said the lack of get-forms is "puzzling"
me, it just seems somewhat inconsistent with the rest of Tapestry
(which I use and will continue to use with great pleasure).

I did as you told me and created a JIRA ticket (a "wish") for it:
"https://issues.apache.org/jira/browse/TAP5-1285";

Keep up the good work,

Lutz


-- 
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: Is there any way to render the "get" method of form?

2010-09-28 Thread Lutz Hühnken
Dear Thiago,

now this - the lack of  - is something that has been
puzzling me in Tapestry 5 for a long time. Why would you say using
"GET" is a bad idea?

The use case I think of is a search field. You enter a search term,
submit the form, get the result. I think using a form with method=get
is the absolutely correct thing to do to achieve this.

Of course I am willing to learn. What would be the "Tapestry way" of
implementing this?

Thanks for your help,

Lutz


>
> Using the GET method in forms is a bad idea. You can use DOM rewriting or
> JavaScript to do that.
>


-- 
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: Is there any way to render the "get" method of form?

2010-09-18 Thread Lutz Hühnken
I don't understand how this answers the question. I followed all of
the links and could not find instructions how to use the get method in
forms in tapestry. Must have overlooked it.. could you be more
specific maybe?


On Sun, Aug 22, 2010 at 3:03 PM, based2  wrote:
>
> http://www.cgisecurity.com/owasp/html/ch11s04.html
>
> http://tapestry.apache.org/tapestry5.0/tapestry-core/guide/beaneditform.html
>
> http://www.seomoz.org/blog/11-best-practices-for-urls
>
> == http://wiki.apache.org/tapestry/Tapestry5HowTos
> == http://wiki.apache.org/tapestry/Tapestry5OpensourceApps
> == http://wiki.apache.org/tapestry/Tapestry5ModuleRegistry
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Is-there-any-way-to-render-the-get-method-of-form-tp2643651p2643760.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
>
>



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



Job offer for Tapestry Programmer in Hamburg, Germany

2010-06-01 Thread Lutz Hühnken
Sorry for the German, but this is a job offer in a German company, and
knowledge of German is a requirement for the job...



Hallo,

wir suchen eine/n Programmierer/in in Festanstellung in Hamburg.

Tapestry-Kenntnisse wären von Vorteil, da dies unser bevorzugtes
Web-Framework ist.

Infos auch unter http://www.altocon.de/DE/Jobs, Bewerbungen bitte an
j...@altocon.de.

Noch ein paar Infos, was wir suchen:
- gute Java-Kenntnisse, Spaß an der Java-Programmierung
- jemanden, der/die schon einmal in einem Web-Projekt bis zum Ende
(also: Launch) mitgearbeitet hat
- die grundsätzliche Bereitschaft, auch mal eine Zeit lang beim Kunden
vor Ort zu arbeiten, zumindest innerhalb von Hamburg (steht zwar im
Moment nicht an, aber wir möchten uns die Möglichkeit offen halten)

Fachlich gut wäre:
- Tapestry ;)
- Spring
- Hibernate und/oder JPA
- GWT
- MySQL

Bei uns gibt es interessante Projekte, und nicht nur die Kollegen sind
nett, sondern auch unsere Kunden. Wir sind eine kleine, junge Firma.
Man kann sie noch mitprägen und mitgestalten. Wir versuchen jedes
Projekt auch technisch interessant umzusetzen und sind immer offen für
neues.

Freue mich auf Ihre Bewerbung!


Lutz Hühnken

-- 
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: 301 vs 302 redirects due to SEO

2010-01-15 Thread Lutz Hühnken
Stephan,

you can extend the possible return types of the onActivate method by
adding a ComponentEventResultProcessor to you configuration. You can
define an HttpStatusCode class that returns the code you wish.

I don't know if you consider this "clean", but it takes HTTP
internals, codes etc. out of you page class and puts it into the
HttpStatusCode class or the result processor.

See 
http://old.nabble.com/T5-How-to-tell-T5-to-send-301-%28moved-permanently%29-ts18870223.html

Hope this helps,

Lutz


On Thu, Jan 14, 2010 at 7:28 PM, Stephan Schwab  wrote:
>
> Event handlers in Tapestry, such as onActivate() may return a page object or
> page name. That gets translated into a HTTP 302 redirect.
>
> Now there are situations, e.g. in shopping applications, where one needs to
> use 301 (moved permanently) redirects instead.
>
> One can @Inject the Response object, set the status to 301 and the location
> in the HTTP header. That works but it makes you mix framework code with
> application code in a page class which feels a bit wrong.
>
> Is there a cleaner way?
>
> Stephan
>




-- 
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: blackbird (5.1)

2010-01-08 Thread Lutz Hühnken
Alfonso,

thanks for the reply. I do sometimes get confused with all the
contribute/decorate/override and now advise stuff in my ..Module
classes (btw, am I the only one who thinks that should be simpler?).

Hence, if you could just post a snippet, that would be grand.

Thanks,
Lutz


On Thu, Jan 7, 2010 at 11:09 PM, Alfonso Quiroga  wrote:
> Hi, you can create you own ClientInfrastructure. By default, T5 uses
> ClientInfrastructureImpl, where is defined all js like blackbird and
> prototype. In my case , I created a new ClientInfrastructure where I
> use a different tapestry.js
>
> If you have some problem I can paste the code to contribute and get
> your implementation working.Bye
>
> 2010/1/7 Lutz Hühnken :
>> Hi,
>>
>> I do not want to use the blackbird console, especially not on the
>> production server, plus it breaks my application on IE (because of the
>> cookie it sets, it somehow breaks the cookie handling because IE does
>> not separate them properly).
>>
>> I see other peoples have problems with it too:
>> https://issues.apache.org/jira/browse/TAP5-678
>> https://issues.apache.org/jira/browse/TAP5-908
>>
>> but I have not seen a way to disable it in 5.1. Could someone point me
>> in the right direction?
>>
>> Thanks,
>> Lutz


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



blackbird (5.1)

2010-01-07 Thread Lutz Hühnken
Hi,

I do not want to use the blackbird console, especially not on the
production server, plus it breaks my application on IE (because of the
cookie it sets, it somehow breaks the cookie handling because IE does
not separate them properly).

I see other peoples have problems with it too:
https://issues.apache.org/jira/browse/TAP5-678
https://issues.apache.org/jira/browse/TAP5-908

but I have not seen a way to disable it in 5.1. Could someone point me
in the right direction?

Thanks,
Lutz


-- 
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: Persisting state without HTTP Session

2010-01-06 Thread Lutz Hühnken
Jim,

You still have some different options to pursue in a cluster..

- "sticky" sessions, so that requests of the same user will go to the
same server in the cluster. Good for load balancing, but if a server
fails, the users of that server will loose their session.

- session replication in the cluster - this seems to be the approach
you are thinking of. Here I would indeed imagine that the amount of
data you store in the session heavily influences performance.

- persist the session. Could be in clustered rdbms, could be one of
these distributed key-value stores that are all the rage these days,
like Cassandra or HBase.

Maybe you could let us know what you ended up doing, once you've
finished your project.

Good luck,

Lutz


On Wed, Jan 6, 2010 at 4:37 PM, Jim O'Callaghan  wrote:
> Lutz,
>
> You raise some very interesting points.  I've replied to some of the other 
> posters regarding the reasons I was trying to minimise session use, though 
> taking their replies on board and your own email I think the best course of 
> action is to proceed with using the session state and just minimising the 
> amount of data held.  Thanks for your contributions.
>
> Regards,
> Jim.



-- 
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: Persisting state without HTTP Session

2010-01-06 Thread Lutz Hühnken
I see. There wouldn't be much handling, though, one could probably
implement a "cookie" persistence strategy, so that you could use the
@Persist annotation. Doesn't that even exist already?

The thing you are in favor of, using post.. there'll be some
disadvantages. I assume you won't be using redirect-after-post much,
if you don't want to keep state on the server side. You would have to
disable that, as it is the default in Tapestry.

I could imagine having a central dispatcher... every post goes to that
central dispatcher, the page to be rendered would be one of the
parameters. The other parameters would constitute the context for that
page. That would be kept track of with hidden form fields. Might be
possible, but not a nice solution. No bookmarks, possibly no
navigation with browser back - forward buttons..

You could write your context into a database after request processing,
and read it on the next request. Of course that would be exactly the
same as using a session (in fact, you can configure most servers to
store the session in a database). Only slower (than in-memory
sessions).

Well, now we know why people came up with the session concept. It is
actually quite a good approach. What was the reason again you don't
want to use it?


On Wed, Jan 6, 2010 at 3:04 PM, Jim O'Callaghan  wrote:
> Lutz,
>
> Thanks for the response - Cookies would be a last resort - I don't want to be 
> managing cookies and also feel it makes the app more breakable (fundamental 
> state could be broken with browser security settings).  What I'm after is 
> something akin to PageActivationContext but that passes the relevant 
> object(s) using Request parameters rather than the querystring / url - thanks.
>
> Regards,
> Jim.
>
> -Original Message-
> From: Lutz Hühnken [mailto:lh.tapestry.l...@googlemail.com]
> Sent: 06 January 2010 13:50
> To: Tapestry users
> Subject: Re: Persisting state without HTTP Session
>
>
> Cookies come to mind, would that be an option?
>
>
> On Wed, Jan 6, 2010 at 2:16 PM, Jim O'Callaghan  wrote:
>> Hi,
>>
>> Can anyone advise on the preferred way of persisting state between pages
>> without using HTTP Session?  PageActivationContext using Object[] looks
>> promising but I don't want long urls (from serialized objects) and there is
>> more data to share than a defined number of keys - I'm looking for something
>> that uses POST params ...?  Thanks.
>>
>> Regards,
>> Jim.
>>



-- 
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: Persisting state without HTTP Session

2010-01-06 Thread Lutz Hühnken
Cookies come to mind, would that be an option?


On Wed, Jan 6, 2010 at 2:16 PM, Jim O'Callaghan  wrote:
> Hi,
>
> Can anyone advise on the preferred way of persisting state between pages
> without using HTTP Session?  PageActivationContext using Object[] looks
> promising but I don't want long urls (from serialized objects) and there is
> more data to share than a defined number of keys - I'm looking for something
> that uses POST params ...?  Thanks.
>
> Regards,
> Jim.
>



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

2009-12-23 Thread Lutz Hühnken
Hi everybody,

I think the discussion on TheServerSide actually is somewhat
interesting, but not because of the unfortunate Tapestry vs. Wicket
flame war. Let's have a look at the topic leading to that...

- One part of Java EE 6 is "CDI" (JSR 299)  -
http://jcp.org/en/jsr/detail?id=299 - originally called "Web beans". I
think it was inspired by Gavin Kings Seam Framework.

- The reference implementation for that seems to be something called
"Weld" - http://docs.jboss.org/weld/reference/1.0.0/en-US/html/

- Weld has Wicket support build in, and the examples are given in
Wicket (although the Java EE "standard" would be JSF 2) because Wicket
is easier to learn than JSF (at least Gavin King says so in
http://in.relation.to/Bloggers/HowToStartLearningJavaEE6, but I think
many would agree with that).

So the interesting (to me, at least) questions are:

- How does CDI relate to Tapesty and Tapestry IOC?

- Should / could Tapestry incorporate / conform to CDI somehow?

- Should we try to add Tapestry support to Weld?

- Or is Java EE 6 / CDI just not relevant to Tapestry?

I haven't really looked at Web Beans resp. CDI yet, but from first
site, it defines some context scopes (request, session, application,
conversation) and some annotation based dependency injection.
Both areas are already covered by Tapestry (although afaik there is no
conversation scope (yet) in Tapestry).

So are CDI and Tapestry mutually exclusive? Or should Tapestry be
refactored to use standard CDI annotations, so it can claim to be a
CDI / JSR 299 implementation?

I would love to hear your opinions about that.

Regards,
Lutz




-- 
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: t5: T5 friendly e commerce software?

2009-07-03 Thread Lutz Hühnken
Hi Angelo,

what kind of e-commerce software are you thinking of?

If it is a straight-forward online shop - we built www.toplicht.de
about two and a half years ago with Tapestry and ever since we did, we
wanted to open source the code as a an open source e-commerce project
(the name would be "Cokios", see www.cokios.org).
We never really got round to it... and of course there would be some
work left to do, remove customer specific code, create a sample shop,
update to Tapestry 5.1... but still, I think it might be a good
starting point,  better than starting from scratch.

If you would be interested in using and maybe even in contributing to
an open source tapestry e-commerce software, I might actually start
putting some code in the sourceforge repository.

Tell me what you think,

Lutz


On Mon, Jun 29, 2009 at 12:30 AM, Angelo Chen wrote:
>
> Hi,
> looking for an eCommerce software in Java, is there a 'Tapestry 5 friendly'
> one? to make it clear, I'm quite comfortable in Tapestry5 and like it very
> much, however, making an eCommerce software from scratch will be a big task,
> abandoning T5 for this coming project is something I don't like to happen,
> any suggestions to have T5 and an existing e Commerce software working
> together? Thanks,
>
> A.C.
> --
> View this message in context: 
> http://www.nabble.com/t5%3A-T5-friendly-e-commerce-software--tp24246216p24246216.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
>
>



-- 
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: [REQUEST] Live T5 web sites, quotes, marketting

2009-04-26 Thread Lutz Hühnken
http://www.toplicht.de

(Tapestry 4)

http://www.go7seas-kreuzfahrten.de

(Tapestry 5)

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



Re: Running quickstart in tomcat from eclipse

2009-04-14 Thread Lutz Hühnken
Hi Sean,

although I currently use jetty (via the jetty maven plugin) for
Tapestry development, I have used tomcat in the past, and if I
remember correctly, there are two approaches.

You can use the "web tools platform" in Eclipse, which will give you a
server view and allow you to start your web project with "run on
server". Googling for "m2eclipse wtp" comes up with
http://docs.codehaus.org/display/M2ECLIPSE/WTP+mini+howto, which
should help.

Alternatively, you could use the Sysdeo Tomcat plugin:
http://www.eclipsetotale.com/tomcatPlugin.html

Let us know what worked for you.

Hth,

Lutz




On Fri, Apr 10, 2009 at 3:41 PM, Sean Davis  wrote:
> I am new to tapestry and, to a certain extent, to maven.  I have created the
> quickstart maven archetype from within eclipse using the m2eclipse plugin.
> I packaged the result and placed the war file in a local tomcat webapp
> folder with fine results.  However, I would like to be able to use eclipse
> to run the app on an eclipse-controlled tomcat (ie., not have to move the
> generated war file to tomcat every time I change something) just as if I had
> created a "dynamic web project" from within eclipse.  Can anyone share with
> me a link or some advice on doing this?  I am using Ganymede eclipse.
>
> Thanks,
> Sean
>



-- 
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: T5: getting new Hibernate session in a lengthy thread

2009-03-15 Thread Lutz Hühnken
Hi Angelo,

I think the point of sticking the session to the request is to keep it
open until the request is processed, to avoid
LazyInitializationExceptions during view rendering. So you might have
to do your session management without the HibernateSessionManager.

Then again, I wonder if it really makes much of a difference - if the
database stuff is done in the request processing thread, what do you
achieve by closing the session a tiny bit earlier than it would be by
the HibernateSessionManager anyway?

If the database update is really so lengthy, you might want to do it
in a separate thread altogether.

Hth,

Lutz


On Wed, Mar 11, 2009 at 4:16 AM, Angelo Chen  wrote:
>
> Hi,
>
> I need to run a lengthy thread where some database update happens, is there
> a way to minimize the time when a Hibernate Session is used? something
> similar to:
>
> do while not done
>
>        // do some processing here
>        obtain a session
>        use the session
>        release the session
>
> enddo
>
> If I use HibernateSessionManager, it seems there is no way to release and
> obtain a new session, any idea?
> --
> View this message in context: 
> http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448134.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
>
>



-- 
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: [T5] Web Service

2009-03-15 Thread Lutz Hühnken
Hi Dan,

I think the usual approach would be to expose a remote interface to
your application not through tapestry (or any other web framework),
but by use of some remoting framework. Depending on your requirements
(binary or text, one client platform or many, client architecture,
security and transactional integrity requirements..), options may
include a SOAP web service, REST web service, RMI, Hessian and others.

You might want to have a look at these:
http://ws.apache.org/
https://metro.dev.java.net/
http://static.springframework.org/spring/docs/2.5.x/reference/remoting.html

Hth,
Lutz


-- 
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: base64 + url encoded activation context parameter

2009-03-15 Thread Lutz Hühnken
Hi Borut,

right, Base 64 encoding is no good for URLs. See
"http://en.wikipedia.org/wiki/Base64#URL_applications";.

> What is the cleanest solution? Is there a known url safe
> encoder/decoder which I can use or do I have to write one myself?

I know there is one implementation included in the bouncycastle
cryptography tools, see
"http://www.bouncycastle.org/docs/docs1.6/org/bouncycastle/util/encoders/UrlBase64.html";.
You'll probably find others if you google around.

Hth,

Lutz



-- 
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: T5: accessing assets/files using apache httpd instead of tomcat

2009-03-05 Thread Lutz Hühnken
Hi Britske,

assuming you are using mod_jk to connect Apache httpd to Tomcat, you
can use JkMount/JkUnmount to unmount the paths containing static
resources and have httpd handle them directly.

Let's look at an example..

If your images are in "_img", the context is the root context and your
webapp lies in /whatever/webapps/ROOT, you could do something like
this in your vhost config:

 JkMount /* your_worker

  # static resources
  JkUnmount /_img/* your_worker
  Alias /_img /whatever/webapps/ROOT/_img


Hth,

Lutz


On Thu, Feb 26, 2009 at 6:19 PM, Britske  wrote:
>
> for speed reasons, etc. I would like apache httpd to handle css,js and images
> instead of tomcat
> Of course apache httpd doesn't know of the resources bundled in the tapestry
> webapp.
>
> For those of you who are using tapestry with tomcat and a apache httpd
> frontend:
> I'm interested in knowing what kind of (automatic) deployment setup you are
> using to get the assets in a folder apache httpd can read.
>
> Of course this eliminates tapestry being able to manage the assets. WOuld
> there be anything I'm missing out what tapestry can do, what can't be done
> by apache httpd? Is there any other reasons why I should forget this setup
> as soon as possible?
>
> Thanks,
> Britske
> --
> View this message in context: 
> http://www.nabble.com/T5%3A-accessing-assets-files-using-apache-httpd-instead-of-tomcat-tp9014p9014.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
>
>



-- 
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: http error on exception

2009-03-05 Thread Lutz Hühnken
The way I like to do it: decorate the exception handler in your AppModule.java



/**
 * Decorate the exception handler in a way that it will just return error
 * code 500 in production mode. See
 * http://tapestry.apache.org/tapestry5/cookbook/exceptions.html On the
 * bottom of the page, "Version 3".
 */
public RequestExceptionHandler
decorateRequestExceptionHandler(final Logger logger, final Response
response,
@Symbol(SymbolConstants.PRODUCTION_MODE) final boolean
productionMode, final Object service) {
if (!productionMode) {
return null;
}
return new RequestExceptionHandler() {
public void handleRequestException(final Throwable
exception) throws IOException {
logger.error(exception.getMessage(), exception);

response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
"Internal Server Error");
}
};
}


Hth,

Lutz


On Mon, Feb 23, 2009 at 6:17 PM, Thomas Clavier  wrote:
>    Hello All,
>
> I search a solution to launch an http error (500) when tapestry throw an
> Exception. I have found documentation on how to override tapestry
> Exception ... but that launch a "200 OK"
>
> have you a solution ?
>
> --
> Thomas Clavier                 http://www.tcweb.org
> Argia Engineering              JabberID : clav...@argia.fr
> +33 (0)6 20 81 81 30           +33 (0)950 783 783
>
>
>



-- 
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: zone enhancements?

2009-01-13 Thread Lutz Hühnken
Fernando,

I agree with you, especially your suggestion (1) would be very helpful
and a welcome addition. The form/zone combination could maybe include
more callback hooks. I think I have a case of Rails envy, look at the
callbacks you can use for the remote_form_tag:

> The callbacks that may be specified are (in order):
> :loading: Called when the remote document is being loaded with data by 
> the browser.
> :loaded:  Called when the browser has finished loading the remote 
> document.
> :interactive: Called when the user can interact with the remote document, 
> even though it
> has not finished loading.
> :success: Called when the XMLHttpRequest is completed,
> and the HTTP status code is in the 2XX range.
> :failure: Called when the XMLHttpRequest is completed,
> and the HTTP status code is not in the 2XX range.
> :complete: Called when the XMLHttpRequest is complete (fires after 
> success/failure if
> they are present).
>
> You can further refine :success and :failure by adding additional callbacks 
> for specific
> status codes. A status code callback overrides the success/failure handlers 
> if present.
>
>  If you for some reason or another need synchronous processing (that'll block 
> the
> browser while the request is happening), you can specify options[:type] = 
> :synchronous.
>
> You can customize further browser side call logic by passing in JavaScript 
> code
> snippets via some optional parameters. In their order of use these are:
> :confirm: Adds confirmation dialog.
> :condition:   Perform remote request conditionally by this expression.
> Use this to describe browser-side conditions when request should not be 
> initiated.
> :before:  Called before request is initiated.
> :after:   Called immediately after request was initiated and before 
> :loading.
> :submit:  Specifies the DOM element ID that's used as the parent of the 
> form elements.
> By default this is the current form, but it could just as well be the ID of a 
> table
> row or any other DOM element.
> :with:A JavaScript expression specifying the parameters for the 
> XMLHttpRequest.
> Any expressions should return a valid URL query string.

With this, you could easily show a DIV with a spinner gif / busy
indicator "after" the click, and hide it again when on "complete":

<% form_remote_tag :url => { :action => "search" },
   :after => "Element.show('loading');
Element.hide('results')",
   :update => :results,
   :complete =>
"Element.hide('loading'); Element.show('results')" do %>


Oh, I'd love to have that in Tapestry. Doesn't Rails use
script.aculo.us, just like Tapestry? Wouldn't that be easy to
implement, given the hard part is done by script.aculo.us anyway? I've
never really looked at it, but I think the Tapestry tags don't produce
script.aculo.us code directly, the library is wrapped and thereby only
a reduced functionality is available. Thinking about it.. in
script.aculo.us, you can customize the effects (like the highlight and
fade) with parameters, such as hightlight time and colour. This also
is lost in Tapestry.

Assuming I would wish to extend the script.aculo.us integration, in
order to provide all those AJAX form callbacks, and effects
parameters.. what would be the way to go? What would be a good place
to start?



About (2) - I think that could maybe be more easily handled on the
server-side, using a transaction/synchronization token, like you would
to prevent regular forms from being double-submitted.


Lutz


-- 
altocon GmbH
http://www.altocon.de/
Software Development, Consulting
Hamburg, Germany


On Tue, Jan 13, 2009 at 8:00 AM, Fernando Padilla  wrote:
> We are starting to use zones a lot more and they are a great and simple
> concept.  I was wondering if anyone had any comments or had put any legwork
> towards these simple enhancements.
>
>
> 1) updatingEffects
>  along the lines of the showEffect and updateEffect currently supported,
> except that this would be an effect to run while the zoneManager was
> fetching the content (ajax request).
>
>  Could be as simple as a modal gray out, with a loading spinner...
>  or completely remove previous content, and replace with "Loading..."
>
>
> 2) no outstanding updates
>  if I keep clicking on a link while the zone is still fetching the new
> content, it will keep firing off ajax calls.. add a way to ignore new update
> requests, until the currently running one finishes..

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



Re: T5/Jetty: disabling jsessionid?

2009-01-02 Thread Lutz Hühnken
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  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: T5: encoding issues

2009-01-02 Thread Lutz Hühnken
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 ° and
use t:outputRaw instead of the $ notation.

hth,

Lutz



On Tue, Dec 23, 2008 at 10:24 PM, Christoph Jäger
 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 I am struggling with persisting form elements using onchange

2009-01-02 Thread Lutz Hühnken
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: JSESSIONID cookie, secure is set, how to not set

2009-01-02 Thread Lutz Hühnken
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  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] Pagelink bug in Tapestry 5.0.16?

2008-11-19 Thread Lutz Hühnken
Hi,

that is really quite the bug. I see you opened a jira ticket for it:

https://issues.apache.org/jira/browse/TAP5-362

I hope a lot of people vote for it so it gets resolved quickly. Does
anyone know of a good workaround?

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setting Cookies

2008-11-14 Thread Lutz Hühnken
On Tue, Nov 11, 2008 at 4:29 PM, Keith Bottner <[EMAIL PROTECTED]> wrote:
> Oddly enough that DID work. But if I specify the domain and path it doesn't.

There's probably a mismatch either of the given and the real hostname,
or the given and real context path.

> I will continue to look into this. In addition I also need to find out how I
> can set the secure attribute on the cookie.

I'm afraid from within Tapestry you can't. The API doc says:
"Note that when writing cookies, the cookie's secure flag will match
Request.isSecure()."

For most use cases, that should be fine, though.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setting Cookies

2008-11-09 Thread Lutz Hühnken
Hm. Works fine for me.

What happens if you leave out domain and path, like in

cookies.writeCookieValue(Constants.COOKIE_NAME, value)

?



On Wed, Nov 5, 2008 at 10:12 PM, Keith Bottner <[EMAIL PROTECTED]> wrote:
> I am attempting to set a cookie for a user; however, it does not seem to be
> retained by the browser. I have tried all 3 major browsers.
>
> Here is the relevant code:
>
> @Inject
> private Cookies cookies;
>
> private void setCookies()
> {
>  String value = "test";
>  cookies.writeCookieValue(Constants.COOKIE_NAME, value, "/", "localhost");
> }
>
> Has anyone had any problems with cookies or know of any problems?
>
> One more thing, I am doing all of this from within an onSetupRender within a
> component.
>
> Thanks in advance,
>
> Keith
>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[t5] nested radiogroups?

2008-11-05 Thread Lutz Hühnken
Hi,

is it possible (in 5.0.15) to have a radiogroup within a radiogroup?

In the Tapestry 4.1 docs, it says quite clearly "RadioGroup components
may not nest. ", but there is no such warning on the T5 RadioGroup
page.

Regards,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Spring prototype behavior equivalent ?

2008-10-31 Thread Lutz Hühnken
Hi Stephane,

I think you can inject the WebApplicationContext and then use
context.getBean to get fresh instances of your prototype bean.

See http://tapestry.apache.org/tapestry5/tapestry-spring/

"The Spring WebApplicationContext is also added as a service..."

"For the moment, you should consider the non-singleton beans to be
not-injectable. Instead, inject the WebApplicationContext service and
obtain the non-singleton beans as needed."


Hth,

Lutz


On Fri, Oct 31, 2008 at 4:58 PM, Stephane Decleire
<[EMAIL PROTECTED]> wrote:
> Is there a way to get the same behavior as Spring prototype in Tapestry 5 ?
> If not, what's the easiest way to inject Spring prototype bean ?
>
> thanks in advance
>
> Stephane
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: so much useless logging

2008-10-22 Thread Lutz Hühnken
Hi Fernando,

>  Sorry, I might be worked up, but really, wow this is just amazing me how no
> one has complained about this yet.

well, this is just not true. You will find many discussions regarding
this on this mailing list.

Workarounds have been proposed. For log4j, you might try a filter

http://www.nabble.com/T5%3A-How-to-configure-T5-not-to-display-unwanted-log-td16024408.html

(I used that in the past, but it doesn't seem to work anymore for me,
I haven't had the time to look into that yet.)

A probably better way would be to use markers, see
https://issues.apache.org/jira/browse/TAPESTRY-2474

Log4j 1.2.x doesn't support them, though.

hth,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: t5: using jetty

2008-10-17 Thread Lutz Hühnken
In your pom.xml, add a context handler to the jetty plugin:


org.mortbay.jetty
jetty-maven-plugin

/


/myimages
/the/path/to/myimages






You will have to change resourceBase to your real path, of course.

Hth,

Lutz


On Sun, Oct 12, 2008 at 8:05 AM, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Sorry if this is not related to Tapestry.
>
> I use jetty:run to test my web app and it works well, one issue that I can't
> solve is, in the standard tomcat deployment my app has to refer to
> webapps/myimages, myimages is actually a linked directory in Linux, how to
> define something like this when using jetty:run?
>
> Thanks,
> --
> View this message in context: 
> http://www.nabble.com/t5%3A-using-jetty-tp19938977p19938977.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: spring integration question

2008-09-30 Thread Lutz Hühnken
I'm just taking a guess here, but I think it won't. As far as I know
the tapestry spring integration was always limited to singleton beans.
I think the "prototype" variant is maybe difficult to handle since
tapestry ioc (and hivemind in the past) have a somewhat different
approach on object creation, using pooling and all, afaik.

I never really considered that a big drawback, though. Plus,
apparently you can just inject the application context and get your
prototype beans from there. See
http://tapestry.apache.org/tapestry5/tapestry-spring/ , last sentence.

Hth,

Lutz



On Sun, Sep 14, 2008 at 6:17 PM,  <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I noticed in the documentation that non-singleton beans are not handled 
> properly, will this be fixed before the official release of T5?
>
> Regards,
> Amir
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: CMS Integration

2008-09-30 Thread Lutz Hühnken
Dear Mr. Mason,

> Tapestry features so I can't us a conventional CMS like Magnolia. Has
> any one else had any success with this sort of integration.

yes, we had. If you look for example at "www.go7seas-kreuzfahrten.de",
you will see a "hybrid". The cruises, the booking process, ship and
journey information are all part of a tapestry application. All the
pages in the "Information" and "Service" areas are maintained by the
customer using the Magnolia CMS.
The site is somewhat "beta", so please be forgiving if you notice any glitches.

> What I was thinking was using Magnolia or another CMS as an editor
> then accessing the CMS's JCR data store (such as Jack Rabbit)
> directly. Then when the component tries to load its template it
> fetches it directly form the JCR.
[...]
> My problem is I am not really sure if this is possible using
> Tapestries IOC. I realise I could make changes to the tapestry code

I think the approach you describe is very well possible and would not
even involve any "low-level" changes or overriding services using
tapestry-ioc. One would have to implement a number of Tapestry
components that mirror the functionality given in the Magnolia JSP tag
library. Actually, I wanted to start an effort to do just that a long
time ago: "http://sourceforge.net/projects/tapestry-jcr/";. I haven't
found the time yet, though.

However, the approach has the drawback that you will have to maintain
two versions of your templates - a JSP-based one for Magnolia, and the
Tapestry ones. Basically, you'd have every page twice.

That's why we chose a different approach. We use Magnolias output as
the input for Tapestry. That is, the rendered Magnolia page is
actually a Tapestry template. Since Magnolia uses JSP, these to
approaches don't interfere. You can easily add t:ids and such to your
Magnolia templates.
You can use Tapestry's template location mechanism to  get the pages
from Magnolia, and put any pre-generation and/or caching in between.


Hth,

Lutz Hühnken

http://www.altocon.de/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] setup logging

2008-08-12 Thread Lutz Hühnken
Hm... I had the same problem once, and I figured it was because
Tapestry doesn't use the log level configured for the
"org.apache.tapestry5" category, but the level you define for your
components.

As it is said on http://tapestry.apache.org/tapestry5/guide/logging.html :
When a component's logger is configured at the DEBUG level, you will
also see added output when the class is first accessed identifying how
Tapestry is modifying the bytecode of the class.

That is something I find quite annoying and don't see much use in, by the way.

Anyway, for me it worked using a log4j filter, as described in an
earlier conversation on this list, see

http://www.nabble.com/T5%3A-How-to-configure-T5-not-to-display-unwanted-log-td16024408.html

I don't think it makes a difference if you use logger or category in
your log4j.xml. Actually, I think category has been renamed to logger
at some point, so you might actually want to stick with logger.

Hth,

Lutz



On Tue, Aug 12, 2008 at 12:24 AM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:
> Ah, okay.
>
> No, you don't have to configure SLF4J - it's using log4j by default.
>
> Looks like Sven might have given the answer you need. Does it work if you
> use  instead of ?
>
> -Filip
>
> Andy Pahne skrev:
>>
>> No, that's not the case if you use log4j XML configuration file format.
>>
>> Still no idea...
>>
>> Do I have to configure SLF4J or is it sufficient to configure log4j?
>>
>> Andy
>>
>>
>>
>> Filip S. Adamsen schrieb:
>>>
>>> Hi,
>>>
>>> You need to prefix the logger name with log4j.category. or it won't work.
>>>
>>> Or, at least that's how it was back when I used log4j - I'm now using
>>> SLF4J with Logback and I'm not going back. :)
>>>
>>> -Filip
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] How to handle DAOs?

2008-08-10 Thread Lutz Hühnken
Hi Sven,

this is the first time i hear of "chenillekit".  So I'm wondering (and
I'm sure others are, too) - what the relationship is between
"chenillekit" and "t5components" ? Are those two names for the same
project?

Regards,

Lutz


On Sat, Aug 9, 2008 at 2:13 PM, Sven Homburg <[EMAIL PROTECTED]> wrote:
> myself is using the chenillekit modules
> for my own customer projects but the libraries
> are poorly documented.
>
> for the future i suggest the using of chenillekit
> http://code.google.com/p/chenillekit/
>
>
>
> --
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
> http://chenillekit.googlecode.com
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: Trigger zone reload with just javascript?

2008-08-08 Thread Lutz Hühnken
Hi Mike,

I faced the same task, I solved it using the onEvent mixin from
Tapestry 5 components -
http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html

In more detail - say you have two selects, sel1 and sel2, and you want
sel2 to be updated when sel1 changes.

Add the mixin to sel1:

...


...

In your component class, implement a method that returns the options
all in one string, seperated by some characters not otherwise used in
your labels or options. For example, you could use ";" between labels
and options, and "||" between the label - option pairs.

 @OnEvent(component = "sel1", value = "change")
public StreamResponse selectionChanged(final YourClass parameter) {
   ... do something with parameter..
  ... build list of label - option pairs..
for (i...) {
  pair[i] = label + ";" + option;
}
return new TextStreamResponse("text/html",
StringUtils.join(pairs, "||"));
   }

Tapestry type coercion works for your parameter, but the return string
you have to build yourself.

Finally, the callback function in Javascript looks like this:

function populateSel2(response) {
document.getElementById('sel2').options.length = 0;
// Split the response
returnElements = response.split("||")
// Process each of the elements
for ( var i = 0; i < returnElements.length; i++) {
valueLabelPair = returnElements[i].split(";")
document.getElementById('sel2').options[i] = new Option(
valueLabelPair[0], valueLabelPair[1]);
}
}

I should mention that I picked that function up somewhere on the
internet, i didn't write it myself.

Anyway, hope this helps,

Lutz

On Thu, Aug 7, 2008 at 10:06 PM, Mike Leonardo <[EMAIL PROTECTED]> wrote:
> Hey All,
>
> I have a form where I want to be able to change one value and have the other 
> values in the form update. I have a zone around the whole form, and I'd like 
> to use the onchange event to reload the Zone, but what javascript I use to 
> trigger the reloading?
>
> Thanks for any help!
> - Mike
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 pagelink and http - >https redirect

2008-08-08 Thread Lutz Hühnken
I fell into that same trap once. Although it does it good job in
teaching a lesson about not just copying & pasting code from a web
page, it would really be nice if someone could correct the incorrect
code samples on

http://tapestry.apache.org/tapestry5/guide/secure.html

Samples (plural) because it seems the snippets above the one with the
mixed up ports also don't work anymore, I think it has to be
configuration.add instead of configuration.put.

Lutz



On Fri, Aug 8, 2008 at 4:34 AM, tapestry5 <[EMAIL PROTECTED]> wrote:
>
> It should not be
>
> String protocol = secure ? "https" : "http";
> int port = secure ? 8080 : 8443;
>
> but
>
> String protocol = secure ? "https" : "http";
> int port = secure ? 8443 : 8080;
>
>
>
>
> Argo Vilberg wrote:
>>
>> hi,
>>
>>
>> I have one page with http protocol and pagelink in it.
>> Pagelink points https @secure page.
>>
>> But problem is that pagelink generate https://localhost/digi/newpage link,
>> and not with alias localhost:8443.
>>
>> http page is in port 8080, but pagelink do not understand that https port
>> is
>> 8443.
>>
>> I also tried do add
>> public void contributeAlias(Configuration
>> configuration)
>>{
>>BaseURLSource source = new BaseURLSource()
>>{
>>   public String getBaseURL(boolean secure)
>> {
>> String protocol = secure ? "https" : "http";
>>
>> int port = secure ? 8080 : 8443;
>>
>> return String.format("%s://localhost:%d",
>> protocol,
>> port);
>> }
>> };
>>
>> configuration.add(AliasContribution.create(BaseURLSource.class,source));
>>
>>}
>>
>>
>> in AppModule.java
>>
>> But this does not help.
>>
>> Any ideas?
>>
>> Argo
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/T5-pagelink-and-http---%3Ehttps-redirect-tp18873545p18884134.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 How to tell T5 to send 301 (moved permanently)

2008-08-08 Thread Lutz Hühnken
I haven't tried it, but I think it should work with the approach described in

http://www.nabble.com/Index-page-context-and-404-response-to16649174.html#a16649174

It works fine for 404, you might have to extend it to include the URL
to the page you are redirecting to.

Hth,

Lutz


On Thu, Aug 7, 2008 at 3:16 PM, Martin Grotzke
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> when I return a link in some method T5 send a 302. I want to send a 301
> to the client. Is this possible with tapestry, without using the servlet
> stuff?
>
> Thanx && cheers,
> Martn
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: https actionlink

2008-08-06 Thread Lutz Hühnken
Hi,

have a look at 
"http://tapestry.apache.org/tapestry5/tapestry-core/guide/secure.html";.

If the first paragraph - @Secure - does not work for you (which seems
odd by the way because for me it seems to work just fine in 5.0.13),
you can configure it in your AppModule.java, see the other two
paragraphs of the page.

Hth,

Lutz


On Tue, Aug 5, 2008 at 4:50 PM, tapestry5 <[EMAIL PROTECTED]> wrote:
>
> I have a page object which is suppose to work in https.
>
> I can open that page via "https" but all the links in that page are created
> as "http" by tapestry.
> eg. Refresh
> Here when i click on Refresh i get "http://server:port";
>
> How can i change the links from http to https.
>
> I tried @Secure annotation but it still not working.
> I am working on Tapestry 5.0.13 version.
>
> --
> View this message in context: 
> http://www.nabble.com/https-actionlink-tp18832779p18832779.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 getApplicationName

2008-08-04 Thread Lutz Hühnken
Hi Argo,

if I understand you correctly, what you call application name is
usually (or, in "java servlet speak") referred to as the "context". It
is a property of the HttpServletRequest, which provides that
information to you by the method "getContextPath()".

Check the following pages:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html#getContextPath()
http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest


Hth,

Lutz

On Mon, Aug 4, 2008 at 6:56 PM, Argo Vilberg <[EMAIL PROTECTED]> wrote:
> hi,
>
>
> How to get Application Name in tapestry framework.
>
> http://localost:8080/appname/start
>
> appname??
>
>
>
> Argo
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] FormFragment and Radio Button - hidden Fragment still validated? (5.0.13)

2008-08-03 Thread Lutz Hühnken
Hi,

I'm trying to use a FormFragment triggered by a Radio Button.
Obviously, other people have done this before and ran into issues, see
http://www.nabble.com/Form-fragments-and-radio-buttons-td16493007.html#a16493007
and
https://issues.apache.org/jira/browse/TAPESTRY-2261

Having read that, I was under the impression that these issues have
been resolved and it should work just fine in 5.0.13 (which is the
version that I'm using). What I am experiencing now, though, is that
showing and hiding the FormFragment works fine, but if the fragment is
hidden, the fields are still validated on the server side.

The desired and documented behaviour should be that validation only
occurs when the fragment is visible to the user.

Now I don't know if I should file a JIRA issue for this or if I'm just
not doing it right, or maybe not using the right Tapestry version. So
please help me out:

Has anyone successfully used - and experienced the correct behaviour
regarding server-side validation - a FormFragment triggered by a radio
button?

Thanks for your help,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: index page in pages package acts as a catchall

2008-07-31 Thread Lutz Hühnken
>> Ends up as http://app.com/. Am I doing something wrong? Surely others
>> have run into this and deem it undesirable, no?
>
> yes and yes.

Sorry, that should  be no and yes and yes.

no - you're not doing anything wrong (or better said, if you are, I'm
doing something wrong, too)
yes - others - including me - have run into it
yes - in some cases I find it completely undesirable.

Regards,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: index page in pages package acts as a catchall

2008-07-31 Thread Lutz Hühnken
Dear Chris,

> Ends up as http://app.com/. Am I doing something wrong? Surely others
> have run into this and deem it undesirable, no?

yes and yes. It has been discussed on this list before and a
workaround (that works well for me) has been proposed. You can see the
thread here:
http://www.nabble.com/Index-page-context-and-404-response-to16649174.html#a16649174

Described very roughly:

Assuming your index page is not meant to be called with parameters -
if parameters are given, the user was probably actually requesting a
non-existing page. So if index is called with parameters, reply with a
404 not found.

Hth,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What if "Page" was removed from page names?

2008-06-25 Thread Lutz Hühnken
Shouldn't that be up to the developer (or whoever decides on the
URLs)? If you don't want the page suffix, why not just name the page
"Blogger" instead of "BloggerPage"? What if I wanted a url that reads
"mypage"? Would I have to name the page "MyPagePage"? I'm all for
convention over configuration, but here I feel some arbitrary rule
would be unnecessarily imposed on the developer.

Just my two cents,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Events from select component

2008-06-25 Thread Lutz Hühnken
Hi Brendan,

I think the "OnEvent" mixin from t5components does what you are looking for:

http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html

(I haven't used it myself, though. Let me know if it works as described.)
Hth,

Lutz


On Tue, Jun 24, 2008 at 8:21 PM, Brendan McNichols
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
>
>
> I have a  component on a page and I need to know when the user
> changes its value.  I presume that I need to implement an event handler
> as described in:
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/event.html, but
> I tried to do that and wasn't able to get it to work.  Is this the right
> approach?  Can anyone point out an example or let me know how to
> implement this behavior?
>
>
>
> Thanks very much,
>
> Brendan
>
>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[t5] form method="get", "old school" query parameters

2008-06-25 Thread Lutz Hühnken
Hi everybody,

what is the way to create a form with method="GET" in Tapestry 5?

I would like to create a simple form that produces a "GET" request
with query parameters, such as
www.example.com/books?author=king&category=crime. What is the
straight-forward way to do that?

Thanks for your help,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5 turn off form validation

2008-06-20 Thread Lutz Hühnken
Well, if you want stateless, you probably don't even want the session
to be created at all.

There has been a conversation about this on this mailing list before.
The solution takes advantage of the possibility to define the
persistence strategy per component. It also provides a custom
persistence strategy that only stores the tracker if errors have
actually been found. See http://markmail.org/message/jfmxfsjgiy3msnhf

I could imagine another good way to do: create your own
"StatelessForm" component. I don't know how much work that would be,
though. If you create such a component, please post the code on this
list or on the wiki!

Hth,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [NOOB] Getting the Locale without injection

2007-08-16 Thread Lutz Hühnken
Hi,

which Tapestry version are you referring to? And what exactly do you
mean with "in a final object" - are you talking about a component? In
what way is the "final" part relevant?

In Tapestry 4.0.x, the BasePage provides getLocale() and getMessages()
methods. But I guess that's not what you are looking for?

Lutz


On 8/16/07, Marcelo C. de Freitas <[EMAIL PROTECTED]> wrote:
> Hello there,
>
> I want to get the page locale (and the page messages) in a final
> object without having to set them manually (meaning I can't do the
> @InjectObject stuff).
>
> Is there a way I can do that?
>
> I've looked for it into the Hivemind docs but I couldn't find
> anything really useful.
>
>
> --
> Marcelo C. Freitas
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T4.1]Returning a list to a page

2007-08-09 Thread Lutz Hühnken
I'm not sure if I understand that correctly... I think the idea was
not return the page name as a string from a submit method, but to set
it..

in page A:
- inject page B
- set the name of page A as a property in page B
- activate (or redirect to) B

in page B:
- do not inject page A, but get it by name through cycle.getPage..
- set the list as a property in page A
- activate (or redirect to) A

To add to the confusion.. if you access that list from many pages,
wouldn't it be better to store it as an application state object
(ASO)?

Hth,

Lutz


On 8/9/07, Paolo Scopa <[EMAIL PROTECTED]> wrote:
>
> And you are right, actually i cant make it working.
> It seems that IPage is not serializable, so i cant use the
> @Persist("client")
>
> The problem using a string is that, when i return the string from my onOk
> listener, the calling page A is activated, but after the "return" statement
> it is too late to set the property we are talking about.
> What am i missing?
> Paolo
> p.s.: thanks for your patience...
>
>
>
> Ulrich Stärk wrote:
> >
> > Where's the problem to do the same thing with the name of the calling
> > page? Store the name in a string property of page B before activating
> > it...
> >
> > Uli
> >
> > Paolo Scopa schrieb:
> >> No prob.
> >> As i said to uli, i might call B from different pages, not only A.
> >> Maybe i should use a common interface for those pages.
> >> Ill try and let you know
> >> Paolo
> >>
> >>
> >> Patrick Klein wrote:
> >>> Hello Paolo,
> >>>
> >>> mea culpa, you are correct abot that :)
> >>> replace IPage with the A's class (implementing IPage) and cast the
> >>> result of cycle.getPage(...) accordingly
> >>>
> >>> Regards,
> >>> Patrick
>  Thanks Patrick,
>  this helps, except that the IPage does not expose the setList method,
>  so
>  i
>  don't think it would work the
>  page.setList(composedList);
>  maybe not even compile.
>  Paolo
> 
> 
>  Patrick Klein wrote:
> 
> > Hello Paolo,
> >
> > page a should hold an (persist) abstract getter and setter for the
> > list,
> > page b hold a persist abstract getter and setter for the name of the
> > calling page which is set when page b is accessed and maybe reset if
> > needed in the button's listener.
> > When you are done with compiling your list on page be and the button
> > is
> > pressed, do something like the following in the button's listener:
> >
> > (page b)
> > public void buttonListener(IRequestCycle cycle) {
> > [...]
> > IPage page = cycle.getPage(getPageNameOfA());
> > page.setList(composedList);
> > [...]
> > cycle.activate(page);
> > }
> >
> > Regards,
> > Patrick
> >
> >> Hi all,
> >> got a bit blocked here: i need to return a value to the invoking
> >> page.
> >> Page A calls page B -
> >> in Page B I select a list of item from a longer list
> >> when I press OK on page B, the browser returns to page A where the
> >> list
> >> is
> >> set according to the selection made.
> >> I can set the returning page but cant find a way to set there the
> >> value
> >> to
> >> return.
> >>
> >> I tried different ways but cant find a solution.
> >> Any help ?
> >>
> >> Paolo
> >>
> >>
> >>
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> 
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/-T4.1-Returning-a-list-to-a-page-tf4242051.html#a12072218
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T4] Tapestry-Acegi error

2007-08-08 Thread Lutz Hühnken
My first guess would be that you refer to something called
"ClassWorkers" in your hivemodule.xml, but it is undefined. I think it
might be helpful if you posted your hivemodule.xml.

Hth,

Lutz


On 8/8/07, kael20 <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am trying to setup tapestry-acegi using the wiki -
> http://wiki.apache.org/tapestry/AcegiSpringJava5
>
>
> I have tried for several hours to solve this error but I have been
> unsuccessful.  Hoping someone might be able to shed some light on this:
>
> exception
>
> javax.servlet.ServletException: Unable to initialize application servlet:
> Error at
> jar:file:/C:/jboss/jboss-4.2.1.GA/server/default/tmp/deploy/tmp20641YingYang-exp.war/WEB-INF/lib/tapestry-acegi.jar!/META-INF/hivemodule.xml,
> line 38, column 51: Module tapestry.acegi has contributed to unknown
> configuration point ClassWorkers. The contribution has been ignored.
> 
> org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:206)
>
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
>
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
> 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
> 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> java.lang.Thread.run(Thread.java:619)
>
> root cause
>
> org.apache.hivemind.ApplicationRuntimeException: Error at
> jar:file:/C:/jboss/jboss-4.2.1.GA/server/default/tmp/deploy/tmp20641YingYang-exp.war/WEB-INF/lib/tapestry-acegi.jar!/META-INF/hivemodule.xml,
> line 38, column 51: Module tapestry.acegi has contributed to unknown
> configuration point ClassWorkers. The contribution has been ignored.
> [jar:file:/C:/jboss/jboss-4.2.1.GA/server/default/tmp/deploy/tmp20641YingYang-exp.war/WEB-INF/lib/tapestry-acegi.jar!/META-INF/hivemodule.xml,
> line 38, column 51]
>
> org.apache.hivemind.impl.StrictErrorHandler.error(StrictErrorHandler.java:39)
>
> org.apache.hivemind.impl.RegistryInfrastructureConstructor.addContributions(RegistryInfrastructureConstructor.java:451)
>
> org.apache.hivemind.impl.RegistryInfrastructureConstructor.addImplementationsAndContributions(RegistryInfrastructureConstructor.java:400)
>
> org.apache.hivemind.impl.RegistryInfrastructureConstructor.constructRegistryInfrastructure(RegistryInfrastructureConstructor.java:176)
>
> org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:151)
>
> org.apache.tapestry.ApplicationServlet.constructRegistry(ApplicationServlet.java:253)
> 
> org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:194)
>
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
>
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
> 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
> 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> java.lang.Thread.run(Thread.java:619)
>
> --
> View this message in context: 
> http://www.nabble.com/-T4--Tapestry-Acegi-error-tf4233997.html#a12046203
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T4] wierd ognl error

2007-08-07 Thread Lutz Hühnken
Excuse me for being picky, but your subject is misleading. You claim
to have an ognl error, but obviously you are using tapestry-prop
instead of ognl.

>From a quick look at your code I would guess the problem is that at
some point the value of radioId is "mnpnull". Although you have
defined an initial value, it is not immutable and can take on other
values of type string, I guess.

If you think that's unlikely, you could also try to actually use ognl
instead of prop, just to make sure it's not a shortcoming of
tapestry-prop you're facing.

Hth,

Lutz


On 8/7/07, Peter Schröder <[EMAIL PROTECTED]> wrote:
> hi,
>
> we are running an t4 application wich has the following code in .jwc:
>
> 
>
> and in .html:
>
> ...
>
> this normally renders to:
>
> ...
>
> but some times, ognl fails and renders to:
>
> ...
>
>
> the only way to solve this is to reload the application!
> any comments on this?
>
> kind regards,
> peter
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [t4] How do I inject arbitrary services into a custom service encoder?

2007-08-07 Thread Lutz Hühnken
Hi there,

to me it seems the error message indicates that you don't have a
method "setSpringContext" in your CurrentFooEncoder. I think hivemind
will try to set that property using that method. Or maybe you need a
constructor with an argument of that type.

For a slightly different approach you might want to look at the
tapestry-spring library at
http://howardlewisship.com/tapestry-javaforge/tapestry-spring/. That
will allow you to reference objects defined in your spring application
context in your hivemodule.xml using the spring: - prefix. I'm not
sure how the syntax would be for your encoders, though.
I think you could just create an instance, and within the class you
can inject spring objects using the @InjectSpring annotation. I use it
in some places, works great, just can't seem to remember the
syntactical sugar..

Hope this helps anyway,

Lutz


On 8/7/07, Olle Hallin <[EMAIL PROTECTED]> wrote:
> Hi again,
>
> I tried your suggestion, but I get an ApplicationRuntimeException: No
> property editor exists for property springContext of class
> foo.web.CurrentFooEncoder.
>
> What else must I do? It smells writing some glue code...
>
> Regards,
> Olle
>
>
> 2007/8/7, Richard Kirby <[EMAIL PROTECTED]>:
> >
> > Hi Olle,
> >
> > Try
> >
> >  > object="instance:CurrentFooEncoder,springContext=spring:springContext" />
> >
> > Basically the instance: allows for properties to be set using comma
> > separated property=value
> >
> > Hope that works for you
> >
> > Richard
> >
> > Olle Hallin wrote:
> > > Hi!
> > >
> > > I have written a simple (Tapestry4) custom service encoder
> > > (CurrentFooEncoder) which works ok for now. It inserts/removes "/foo"
> > first
> > > in the encoding.getServletPath().
> > >
> > > It is declared in hivemodule.xml like
> > >
> > >   
> > > 
> > >  > service="external"
> > > />
> > >  > > stateful-extension="sdirect" />
> > > 
> > > 
> > >
> > >  > > before="*" />
> > >   
> > >
> > > Now I wan't my CurrentFooEncoder to do some useful work, for which it
> > needs
> > > my Spring context. How do I achieve that?
> > > I have already have a HiveMind service-point called
> > SpringContextFactory.
> > >
> > > I guess that I shall write something magic in the object attribute, but
> > > what?
> > >
> > > Regards,
> > > Olle Hallin
> > >
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Olle Hallin M.Sc.
> +46 70 6653071
> [EMAIL PROTECTED]
> www.hit.se
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T4.1: How do you combine Tapestry + Spring?

2007-07-14 Thread Lutz Hühnken

What is the most common way to use Spring in combinations with Tapestry?


I don't know.


How do you combine Tapestry and Spring?


I use the tapestry-spring library from
"http://howardlewisship.com/tapestry-javaforge/tapestry-spring/";.


Which parts of Spring?


I use dependency injection a lot, plus some of the database/hibernate
support stuff (I let Spring handle transactions,
OpenSessionInViewFilter),


Please share some of your experience with me :)


It works well, but then again, I don't think I tried anything too
fancy. You should give the tapestry-spring library a test drive, very
easy to use.

Hth,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Feature of Inheritance in Tapestry Template (not only Java)

2007-07-04 Thread Lutz Hühnken

You can define your own components, i.e. take the code that is common
to several templates and turn it into a tapestry component. You can
than compose your templates from your components.

Also, you might want to look at the "Border" component.


hth,

Lutz

On 7/4/07, Eko S.W. <[EMAIL PROTECTED]> wrote:

Hi All,

I just use Tapestry feature of inheritance in web pages.
For example, I could have a BasePage.java which contain single field,

@ApplicationState
User _userLogged;

So all pages will know who logged to the application

I setup all the base page class to be of Abstract type, all field to be
private,
with public getter/setter. Actual page (that is, page that will have HTML
template), of course,
will not be abstract. They will have HTML templates.

But my question is, how do you achieve the same feature, that is
inheritance, in HTML templates?
Maybe I am talking about decorating like we have in Sitemesh.
How do you do it in Tapestry?

(Currently I just paste all the HTML Code to new HTML Templates)

* I hope my question is clear

Thanks in advance!

--
Best wishes,
Eko SW
http://swdev.blogs.friendster.com/my_blog/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: a servlet with a tapestry servlet in one web.xml

2007-07-03 Thread Lutz Hühnken

Which servlet/filter handles which request is configured in web.xml.
Apparently, yours is set up in a way that a request which should go to
the WingS-Servlet is handled by the Tapestry filter, although it
shouldn't be.

Check the filter-mapping for the TapestryFilter, does it include
/application/  ? For your purpose, it shouldn't. If you can't resolve
it, you might want to post your web.xml, or the relevant sections of
it.

hth,

Lutz


On 7/3/07, Tina Umlandt <[EMAIL PROTECTED]> wrote:

Hello,

I have the following problem. I have a servlet which should be in the same 
context as the tapestry application but it is
built with a different framework named wings.

Wings is using another framework named dwr. dwr is sending request like "GET 
/application/dwr/engine.js".
Now I get the exception
"java.lang.IllegalArgumentException: Unable to resolve page 'dwr/engine' to a 
known page name. Available page names: ...
at 
org.apache.tapestry.internal.services.ComponentClassResolverImpl$8.invoke(ComponentClassResolverImpl.java:393)
at 
org.apache.tapestry.internal.services.ComponentClassResolverImpl$8.invoke(ComponentClassResolverImpl.java:388)
at 
org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
at
org.apache.tapestry.internal.services.ComponentClassResolverImpl.canonicalizePageName(ComponentClassResolverImpl.java:386)
..."

Is there a way to tell tapestry several request about which it should not care 
and just ignore?

Thx,
Tina


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: t5: i18 messages without different locale files

2007-06-20 Thread Lutz Hühnken

I'm not sure (since I'm still on Tapestry 4 and there it's done like
here: "http://wiki.apache.org/tapestry/UsingCustomResourceSource";),
but there was a thread about that on this list just a few weeks ago.
You can read it here:
"http://thread.gmane.org/gmane.comp.java.tapestry.user/49256";.

hth,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ForBean issues

2006-11-14 Thread Lutz Hühnken

I've been using Tapestry for a couple of month now and still haven't
understood how to work with collections in forms correctly.

What works well for me is the DefaultPrimaryKeyConverter. But it seems
such an overhead, I have to populate it in the beginPageRender, and
iterate it in the listener to update my original collection.

In the "Enjoy.." book by Kent Tong, he demonstrates using an
InvokeListener and calling a listener on every iteration, to process
the current item. Again, that seems odd to me, especially when you
want to delete items.

I also just used a list as source and the index attribute, it seems
Tapestry updates the items "in place" during rewind, which is fine.
But I don't understand how I can avoid the items being serialized into
hidden fields if I choose this approach.

Having said all that, I would like to add that I'm not new to
programing or Java. Quite the opposite, really, but I find Tapestry is
not very well documented in some areas (or the documentation is very
hard to find).

Anyway.. about your code: obviously, I can't tell you which is best.
But I think you don't have to pass your items as a parameter to the
listener method. Instead, the form fields (in this case, the
collection) will be bound to an instance variable in your page object.
Maybe you should drop that parameters attribute in the @Submit.
But you have to make sure the list is not null during rewind, and has
the right length, so you have to refill it before the rewind, and the
values will be overwritten during rewind.

The listener method that is called will be the one referenced in the
@Submit component. In your case, the one referenced in the @Form is
never called, I think. So you might want to lose on of those two, to
avoid confusion.

That's about all the advice I can give you let's just hope someone
who really knows let's us in on some "collections in forms" insight.

Lutz


On 11/13/06, Srinivas Yermal <[EMAIL PROTECTED]> wrote:

Can some tapestry savvy guys look at this and help us out here. Would really
appreciate the effort. This is quite a big blocker for me at present.
Thanks,
Srini.

On 11/10/06, Srinivas Yermal <[EMAIL PROTECTED]> wrote:
>
> BTW We currently use version 4.0.2. and run it on tomcat. I would also
> appreciate if somebody can point me to the "rewind" document if any. I have
> heard so many stories about common newbie rewind mistakes but couldnt find
> what they really are.
> Thanks again.
> Srini.
>
> On 11/10/06, Srinivas Yermal <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I am a newbie trying to learn Tapestry. I did try to search through the
> > archives for a solution, but couldnt find anything relavant. It would be
> > great if someone could point me in the right direction.
> >
> > I have a page with a listing of a collection. I am using "For" component
> > (ForBean) in the form. There are text fields against each item which has a
> > value from the items in the collection. Now one can change the text value
> > and hit the save button at the end of the form. The listener that is
> > associated with the form gets called but I dont have a clue as to how I can
> > obtain the changed values from the collection. I tried with both form
> > listener and submit action listener. I always end up with a null or empty
> > item collection.
> >
> > Some code snippet below -
> >
> > public abstract Collection getItems();
> > public abstract void setItems(Collection items);
> >
> > ActionListener Method 1:
> > public void saveHistory(IRequestCycle cycle, Object[] list) {
> > LOG.debug("saveHistory(cycle, array) invoked");
> > if (null == list) return;
> > for (Object o : list) {
> > Question mh = (Question)o;
> > LOG.debug(mh.getQuestionText() + " " + mh.getAnswerText());
> > }
> > }
> >
> > ActionListener Method 2:
> > public void saveHistory(IRequestCycle cycle) {
> > LOG.debug("saveHistory(cycle, array) invoked");
> > List list = cycle.getListenerParameters();
> > if (null == list) return;
> > for (Object o : list) {
> > Question mh = (Question)o;
> > LOG.debug(mh.getQuestionText() + " " + mh.getAnswerText());
> >  }
> > }
> >
> >
> > FormListner Method:
> > public void saveFormHistory(IRequestCycle cycle) {
> > LOG.debug("saveFormHistory(cyle) invoked");
> > Collection list = getItems();
> > if (null == list) return;
> > for (Question mh: list) {
> > LOG.debug(mh.getQuestionText () + " " + mh.getAnswerText());
> > }
> > }
> >
> > The HTML file -
> >
> > 
> > ...
> > 
> >
> >
> >   Question 
Text
> >   
> >
> > 
> > ...
> >  >
> >  parameters="ognl:items"/>
> >
> > Please do let me know if something here is not right or if you have any
> > further questions. Looking forward for some advice.
> >
> > Thanks in advance.
> > Regards,
> > Srini.
> >
>
>


--
http://www.indygosoft.com





Re: Timing processing time of a page

2006-09-26 Thread Lutz Hühnken

Oh, I think all the database access and other stuff you mentioned is
done in between the begin render end end render. It clearly looks like
it from the debugging output, there's a lot more going on than just
"rendering".

But the whole @Shell think sounds even easier anyway, maybe we should
give that a try some time.


On 9/26/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

But I think renderComponent() would just be the rendering time of the page 
similar to what I'm doing in the Border component? Maybe I should put some slow 
down's in to double check.

-----Original Message-
From: Lutz Hühnken [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 26, 2006 1:38 PM
To: Tapestry users
Subject: Re: Timing processing time of a page


I believe if your set the log level for tapestry to "debug", as in
putting a line like "log4j.logger.org.apache.tapestry=debug" in your
log4j.properties, it will output such information.

Like
19:30:56,135 DEBUG BaseComponent:89 - Begin render Home
19:30:57,807 DEBUG BaseComponent:95 - End render Home

It would probably be nicer to see the actual time amount then just the
two logging timestamps... I guess you could just modify/overwrite
BaseComponent.renderComponent to output that.

Hth,
Lutz



On 9/26/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi. I'm wondering if anyone has done any simple timing of the processing for 
a page?
>
> I've changed my border slightly so at the start it creates a Date, and at the 
end creates another and determines the difference.
>
> However, I think this only works out to be the render time of the page 
itself, not the processing time to get all the information for that page (eg. slow 
DB queries).
>
> Maybe something like this would go in a Servlet method? I'm really unsure.
>
> Anyone have any insight? This way I can work on tuning my application and 
have some hard numbers to see if, on average, they are getting smaller or not.
>
> Thanks,
> Greg
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Timing processing time of a page

2006-09-26 Thread Lutz Hühnken

I believe if your set the log level for tapestry to "debug", as in
putting a line like "log4j.logger.org.apache.tapestry=debug" in your
log4j.properties, it will output such information.

Like
19:30:56,135 DEBUG BaseComponent:89 - Begin render Home
19:30:57,807 DEBUG BaseComponent:95 - End render Home

It would probably be nicer to see the actual time amount then just the
two logging timestamps... I guess you could just modify/overwrite
BaseComponent.renderComponent to output that.

Hth,
Lutz



On 9/26/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

Hi. I'm wondering if anyone has done any simple timing of the processing for a 
page?

I've changed my border slightly so at the start it creates a Date, and at the 
end creates another and determines the difference.

However, I think this only works out to be the render time of the page itself, 
not the processing time to get all the information for that page (eg. slow DB 
queries).

Maybe something like this would go in a Servlet method? I'm really unsure.

Anyone have any insight? This way I can work on tuning my application and have 
some hard numbers to see if, on average, they are getting smaller or not.

Thanks,
Greg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CMS Integration

2006-07-12 Thread Lutz Hühnken

Simeon,

it would of course be great if you'd provide your code.

I wasn't aware you had already done some work in the area, only today
by means of google I read your posting from november 05. What is the
status of your code? Is it currently in use with alfresco? Have you
tried it with other JCRs, such as jackrabbit? Is it available for
download anywhere? Apparently, there is a handful of people interested
in JCR access through Tapestry, so I think we should set something up.

If it wasn't for you mail, I would have created a "tapestry-jcr"
sourceforge project
and would have started working on the functionality your code
apparently provides. I have little time to spare for it, though, so to
start of with already working code would give it quite a
boost. But I don't want to "steal" your project from you - maybe you
want to turn it into a sourceforge project yourself? I'm sure people
will use those components and you'll get a lot of credit for it.

Well, if you don't, let me know. In that case I'll be happy to start a
project based on your implementation.

Regards,

Lutz

On 7/10/06, Simeon Koptelov <[EMAIL PROTECTED]> wrote:

Oh, if you're interested in it, I can give my code for JCR integration as a
base :)

2006/7/9, Lutz Hühnken <[EMAIL PROTECTED]>:
>
> Hi,
>
> I haven't really looked at it, but I was wondering... as far as I
> understand, you'd like to integrate CMS-managed content into a
> Tapestry-based site.
>
> You mention Magnolia... afaik, Magnolia uses a JSR 170 compliant
> content repository, such as Apache Jackrabbit
> ("http://jackrabbit.apache.org/";), to store the content.
> It provides a number of JSP tags to access that content from within
> your page templates
> ("http://magnolia.sourceforge.net/30/taglib/intro.html";).
>
> It seems getting content out of Jackrabbit is not all that hard. So
> here's my idea: Why don't we start a project to build some Tapestry
> components to access content repositories that conform with JSR 170? A
> possible approach could be to re-implement the Magnolia JSP taglib, or
> parts of it, as Tapestry components. Or maybe Stitches could be used
> as a starting point.
>
> This way, I would think, you could use any JSR 170 compliant CMS to
> manage your content, and could integrate the content in a Tapestry
> based site using this new component library.
>
> What do people think? Is that realistic? Would it work? Would such a
> component library be of interest to anyone?
>
> Lutz
>
>
> On 7/1/06, Mike Grundvig <[EMAIL PROTECTED]> wrote:
> > Has anyone integrated any sort of CMS tool with Tapestry? I've looked
> into
> > Magnolia and several others, but all seem to require an uphill battle if
> > they are to be tied into Tapestry and I was wondering if someone else
> has
> > already done this. Thanks!
> >
> > Michael Grundvig
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CMS Integration

2006-07-09 Thread Lutz Hühnken

Hi,

I haven't really looked at it, but I was wondering... as far as I
understand, you'd like to integrate CMS-managed content into a
Tapestry-based site.

You mention Magnolia... afaik, Magnolia uses a JSR 170 compliant
content repository, such as Apache Jackrabbit
("http://jackrabbit.apache.org/";), to store the content.
It provides a number of JSP tags to access that content from within
your page templates
("http://magnolia.sourceforge.net/30/taglib/intro.html";).

It seems getting content out of Jackrabbit is not all that hard. So
here's my idea: Why don't we start a project to build some Tapestry
components to access content repositories that conform with JSR 170? A
possible approach could be to re-implement the Magnolia JSP taglib, or
parts of it, as Tapestry components. Or maybe Stitches could be used
as a starting point.

This way, I would think, you could use any JSR 170 compliant CMS to
manage your content, and could integrate the content in a Tapestry
based site using this new component library.

What do people think? Is that realistic? Would it work? Would such a
component library be of interest to anyone?

Lutz


On 7/1/06, Mike Grundvig <[EMAIL PROTECTED]> wrote:

Has anyone integrated any sort of CMS tool with Tapestry? I've looked into
Magnolia and several others, but all seem to require an uphill battle if
they are to be tied into Tapestry and I was wondering if someone else has
already done this. Thanks!

Michael Grundvig


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 3 field date component

2006-06-20 Thread Lutz Hühnken

Any ideas out there on how we can get a better inventory of components?


I think it would be easiest if everybody would just list their
components (or components they know of) in the tapestry wiki
("http://wiki.apache.org/tapestry/ExtraComponents";).

On a funny side note, the first one listed under "Third party
components" is "alternative date component using three text fields."
I've really only just seen that for the first time.

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: R: R: Not solved! Re: Problem with mixing HTTP and HTTPS

2006-06-20 Thread Lutz Hühnken

I have not used google analytics, so I don't know. In theory, it
could/should still work. The original client ip is, afaik, included in
the http header "X-Forwarded-For".
It's pretty much as if the user uses a proxy server (i.e. a forward
proxy, not a reverse proxy) - how does google analytics deal with
that?
Plus, I think they use cookies for the actual tracking, those should
not be affected. But as I said, I have never used it, so I really
can't be sure.

I used mod_proxy it in the past to include some snippets provided on a
site via plain html inside an https page. No kind of tracking was
necessary.

hth, Lutz

On 6/19/06, Giampaolo Tomassoni <[EMAIL PROTECTED]> wrote:

If this is done to fire a hit in google analytics, wouldn't google report the 
ip address and country of the server instead of the client's ones?

giampaolo


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: R: Not solved! Re: Problem with mixing HTTP and HTTPS

2006-06-19 Thread Lutz Hühnken

What I don't understand: in an earlier posting you wrote:

On 5/29/06, Josip Gracin <[EMAIL PROTECTED]> wrote:
[...]

scheme, but relying only on Tapestry mechanisms, i.e. not using Tomcat etc.?

[...]

Why would you not want to use an external mechanism? Is it not rather
a feature of the framework to be "SSL agnostic"? I think more often
than not people would keep, for example, security and access right
aspects out of the application and deal with it declaratively. Now
you're looking for a way to move http/https - switching into your
application?

Well, anyway: with Apache httpd, what you try to achieve is often done
by using mod_rewrite. For https-only pages, the protocol part can be
rewritten to https if the page is accessed via http, and vice versa.
If the URL rewrite filter ("http://tuckey.org/urlrewrite/";) does what
it aspires (to be a very powerful tool just like Apache's
mod_rewrite), it should allow you to do the same in a more portable
way.

Talking about apache: including external content on https sites via
http can in many cases be done without triggering warnings, by making
a directory on your https server a reverse proxy using mod_proxy.

hth,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hibernate persisted data never makes it to DB

2006-05-27 Thread Lutz Hühnken

Mark,


 I added "hibernate.connection.autocommit=true" to my
hibernate.properties and that fixed it...


hm. I don't know if that's a good idea. I'm not comfortable with
hibernate.properties in a Spring environment, anyway. Is it clear to
you in which order they are read? Will Spring configuration override
hibernate.properties, or the other way around? And about this
property: if it was set to or defaults to false, it probably does so
for a reason. Why is that so, and why does noone else besides you
experience the behaviour you experience? Still a lot of questions
unanswered...


 So I assume Spring by default does no Session/TX handling, unless I use the
HibernateTransactionManager or do programmatic transaction handling...


Well, that's not quite possible, is it? Of course it handles sessions
and transactions, it's not just a mock-up, you know. Talking about
transaction managers - what do you have configured there? I said this
in every post on this topic so far, and this being the last one I will
say it just once more: Do check your applicationContext.xml. I'm sure
you'll find the reason for the undesired behaviour in there. Your
setup is configured in a way that it does not show the default
behaviour.


 One last question, to get back to Tapestry - is Spring's
OpenSessionInViewFilter going to work with Tapestry without limitations?


Afaik yes. What limitations where you thinking of? I can't think of
any right now. I don't understand the apparent popularity of it,
though, I think it's not that good a concept.


 I see all these posts about Tapernate and others, but I'm not sure whether
OpenSessionInViewFilter will work...


I might be mistaken, but I thought Tapernate was about providing a
Hibernate session factory through hivemind, allowing you to inject it
into your Daos *without* Spring. Plus some extra stuff for convenience
(similar to the OpenSessionInViewFilter from Spring). What is the
benefit of "Tapernate" when you are going to use Spring anyway? Maybe
someone could enlighten me on this?

regards,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hibernate persisted data never makes it to DB

2006-05-25 Thread Lutz Hühnken

I asked for applicationContext.xml, and I get a mysql log... well,
near enough :)


From your last mail I understand you have the same problem if you use

the mysql command line client. Makes me wonder why you thought the
problem had to do with Hibernate in the first place (let alone
Tapestry, for this Tapestry mailing list this has been OT for a while
now...).

So generally, your sql statements never get committed... which is
weird, because by default, mysql starts new connections with
autocommit enabled.

If you connect to mysql from the command line and do
select @@autocommit;
what do you get?

About your Hibernate configuration, since you use Spring anyway, I
would recommend you use Spring for the datasource setup, makes it
easier to switch, plus it makes sense (to me, anyway) to have it in
the same place as the SessionFactory.
Oh, and although the classname you use for the jdbc driver still
works, since the mysql connector/j provides backwards compatibility in
this respect, nowadays people tend to use "com.mysql.jdbc.Driver"
because of a name change four years ago.


lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hibernate persisted data never makes it to DB

2006-05-25 Thread Lutz Hühnken

Yes, the Spring HibernateTemplate will take care of that for you. The
actual behaviour depends on your transaction management, but let's not
get into that for now.

So, the save you call will commit the changes to the database.
Hibernate then disconnects the session, I believe, anyhow, there is no
need for you to add extra code.
Since you even flush your session, there is no doubt Hibernate will
try to store your object in the database. Even if it doesn't work, you
should get some exception.

So...
- have you checked the rest of your code? Are you sure this piece of
code is actually called? Step through it or add debugging output.
- if you're sure your application is otherwise correct, the code gets
executed with the room object you intend it to, and you still don't
have anything in your database, I believe you have something severely
misconfigured and suggest you post your configuration.
That would be the part of your Spring applicationContext.xml (or
whatever it is called in your case) where you set up the data source
and the session factory.

some more comments...


I figured since everybody has problems with Spring closing sessions too
early and thereby causing problems with lazy-load, it should not affect
me in this case and actually work for me.
But maybe not???


Since you have no problem with lazy loading, in fact, you are not even
loading, I believe keeping the session open until the view is rendered
will not help you.


The Page gets the Service (a singleton SpringBean) via tapestry-spring
library ("spring:...").
The Service gets a DAO through Spring IoC.


Just out of curiosity: Why do you not inject your Dao into the page?
What does "the Service"? do?


So I guess the DAO is a singleton that opens a session once and never
closes it? Does that mean that everything is one session/transaction,
across all requests and user-web-sessions?


No.


hth,
Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hibernate persisted data never makes it to DB

2006-05-24 Thread Lutz Hühnken

Hm... given that you don't use OpenSessionInViewFilter, I think it is
really pretty optimistic to believe your current problem can be solved
by subclassing it and/or changing its flushing behaviour.



On 5/25/06, Mark <[EMAIL PROTECTED]> wrote:

Is there a way to set this in the hibernate.properties?

Right now I do not use OpenSessionInViewFilter...

MARK


Daniel Lydiard wrote:
> Are you using OpenSessionInViewFilter (spring/hibernate)?
>
> The default flushmode is set to NEVER, so you need to override
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
> @Override
>
> protected Session getSession(SessionFactory sessionFactory) throws
> DataAccessResourceFailureException {
>
> Session session = super.getSession(sessionFactory);
>
> session.setFlushMode(FlushMode.AUTO);
>
> return session;
>
> }
>
> @Override
>
> protected void closeSession(Session session, SessionFactory
> sessionFactory) {
>
> session.flush();
>
> super.closeSession(session, sessionFactory);
>
> }
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hibernate persisted data never makes it to DB

2006-05-24 Thread Lutz Hühnken

my two cents, in three parts...

- about the problem:
well, usually, it kind of works. This may sound silly, but do you
maybe have hbm2ddl.auto set to "create-drop" ? Or when you check if
something has been stored, are you sure you're checking the right
database? I'm not making fun of you, I have seen these things happen,
to very smart people. One more: are you using the HibernateTemplate
from the right package (there is a hibernate and a hibernate3 package.
Actually, I don't know what happens if you use the wrong one, might
even work).

Anyhow, if nothing is stored and yet you don't get any error message,
I guess you have to recheck your configuration carefully.

- about the log file location
if you just give the filename, it will be created in the current
working directory. If you start Tomcat from the command line, that
will be $CATALINA_HOME/bin. If you start it using the Eclipse plugin,
the location is, well, eclipsed - I have not managed to find it yet.
Anyhow, both variants are not very desirable, so you might consider
providing an absolute path to your logfile (as in
/var/log/hibernate.log). Personally, on my development machine, I just
log to stdout.

- about the "wanting to know the internals":
don't get me wrong, no offense intended, and it's really none of my
business, I just can't keep the thought to myself: I think it is a
very valid standpoint, but I also think it is slightly contradictory
in your case. You claim you want to know internals, but yet you use
the Spring HibernateTemplate? Isn't that all about hiding a lot of
internals?

hth,
Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How would I know?

2006-05-23 Thread Lutz Hühnken

Yes, it has:
"http://wiki.apache.org/tapestry/HowTos";.

Hth,

Lutz

On 5/24/06, albartell <[EMAIL PROTECTED]> wrote:

 Thanks Ignatyev, that worked great!  How would I have gotten to that
without the list though?

I think we should start a page called "How to do x in Tapestry" because
these things just aren't jumping off the page for people to understand. Has
a page like this already been started that is easy for people to add content
to?

Aaron Bartell

-Original Message-
From: Konstantin Ignatyev [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 23, 2006 5:12 PM
To: Tapestry users
Subject: Re: How would I know?

How about something like
 @InjectObject("service:tapestry.globals.HttpServletResponse")
  public abstract HttpServletResponse getHttpResponse();


and then send redirect where you need to

albartell <[EMAIL PROTECTED]> wrote: I am lost in Tapestry documentation
today (which is becoming a common
occurrence as of late).

First let me describe what I was trying to do. I needed to redirect the user
to a static page outside of my application context after they fill out a
form.  I thought it would be easy enough because I know how to use
@InjectPage to go to another Tapestry page, but I just couldn't find how to
do it from looking at the Tapestry documentation.  I finally decided to use
IRequestCycle.sendRedirect() because I remembered seeing that somewhere in
the past.  So I went in search of how to use IRequestCycle.  Sure I can find
it in the JavaDocs, but where in the heck does one find that you can specify
IRequestCycle as a parm on a java method?

for example I found this in the mail archives:

public void validate(IRequestCycle cycle) {
...
cycle.sendRedirect("http://mysite.com/somepage.html";);
}

I assume it should be in the user guide, but where?  It would rock to have a
"how do I" section on the Tapestry page just showing how to do simple things
that all web developers need and allow the user to dig further into the
framework from that vantage point vs. giving them every single entry point
of API documentation at a top layer.

Aaron Bartell




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tap 4 integration with Spring and Hibernate

2006-05-19 Thread Lutz Hühnken

About Spring: There is a Wiki page at
"http://wiki.apache.org/tapestry/Tapestry4Spring"; and a "drop-in" jar
at "http://howardlewisship.com/tapestry-javaforge/tapestry-spring/";.
The latter is by the Tapestry author himself, which makes some people
(including me) favor it among the "quite a few solutions found on the
net".

If you use that, you will probably configure Hibernate using Spring,
so you don't really integrate Hibernate with Tapestry, as that is done
indirectly via Spring.

If you only need Hibernate and Dependency Injection, you could achieve
that without Spring. I believe Tapernate, mentioned in the other
replies, offers a solution for that based on Hivemind.

Hth,

Lutz


On 5/19/06, Tony Herstell <[EMAIL PROTECTED]> wrote:

Can someone please point me to the preferred pattern for this as there are
quite a few different solutions on the net.

I have an existing Tap 4 project and want to integrate it with
Spring/Hibernate.

Thanks.

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.0/342 - Release Date: 17/05/2006



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: component that will get localized resources from database?

2006-05-15 Thread Lutz Hühnken

No, but it is implemented in AbstractComponent:
public Messages getMessages()
   {
   throw new
IllegalStateException(TapestryMessages.providedByEnhancement("getMessages"));
   }

and it is clearly created by the enhancement worker nevertheless,
otherwise we'd be getting quite some exceptions. I can't see why that
should be different custom components. Or am I missing something?


On 5/15/06, James Carman <[EMAIL PROTECTED]> wrote:

If getMessages() is already implemented, the enhancement worker shouldn't
try to create the method.  Have you tried just overriding getMessages()?



-Original Message-
From: Paul Cantrell [mailto:[EMAIL PROTECTED]
Sent: Monday, May 15, 2006 12:36 PM
To: Tapestry users
Subject: Re: component that will get localized resources from database?

There is no obligation to use Hivemind if it is not appropriate to
your problem. Hivemind is useful for decoupling parts of the system,
and for making "aspecty" customization that cut across the framework.
If you don't need decoupling, and don't need to customize across the
whole framework, perhaps you don't need to bother with Hivemind.

So there may be a Hivemind way to inject a different message worker
into only certain classes, but I would guess overriding getMessages()
is probably just fine. Did you try it? Does it work? Is it simple? If
so, no worries!

Cheers, P

On May 15, 2006, at 10:57 AM, Lutz Hühnken wrote:

> Hi there,
>
> assume you want to create a localized tapestry application, but there
> are localized messages that you don't want to store in a properties
> file / text file.
>
> In a plain Java application, you could just write your own
> implementation of ResourceBundle, that could take the messages from
> anywhere, e.g., a database, and use that instead of
> PropertyResourceBundle.
>
> With Tapestry, it seems to be more complicated, though. If I
> understand correctly, the "AbstractComponent" is "enhanced" by an
> "InjectMessagesWorker", as defined in "tapestry.enhance.xml". The
> "InjectMessagesWorker" will inject a getMessages() method that will
> return the result of ComponentMessagesSource.getMessages(IComponent).
>
> Now, that's not what I want...
>
> A straight-forward approach would be to override "getMessages()" in my
> own component. Would that work? To me it seems to collide with the
> Hivemind enhancement/injection approach.
>
> Alternatively, I could probably change the InjectMessagesWorker to
> something of my own liking. But that would affect *all* components
> (that inherit from AbstractComponent), while I would like the modified
> behaviour just for my own. Plus, I don't really want to mess with the
> "tapestry.enhance.xml", since it is part of the packaged Tapestry
> distribution.
>
> So what would be the proper way to do it? Can I override the
> "inject-messages" command from "tapestry.enhance.xml" for my own
> components? How?
>
> Thanks in advance,
>
> Lutz
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

_
Piano music podcast: http://inthehands.com
Other interesting stuff: http://innig.net



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: component that will get localized resources from database?

2006-05-15 Thread Lutz Hühnken

Hi,

actually no, I haven't even tried it, but it *must* collide with the
enhancement stuff...

However, I came across the page
"http://wiki.apache.org/tapestry/UsingCustomResourceSource";, which
provides quite a good solution.

It "overrides" a default service implementation with a specific one in
the applications hivemodule.xml. Kind of obvious, only I just didn't
know if and how it works in Hivemind. Thanks to
"http://jakarta.apache.org/hivemind/override.html";, that's clearer
now.

And instead of the InjectMessagesWorker it overrides the
ComponentMessagesSource, which is probably also a good idea.

So I'm almost there. The only question remaining is: If I understand
correctly, this will affect *all* components. Is there a way to
achieve this behaviour just for my own, custom components?

Thanks again,

Lutz


On 5/15/06, Paul Cantrell <[EMAIL PROTECTED]> wrote:

There is no obligation to use Hivemind if it is not appropriate to
your problem. Hivemind is useful for decoupling parts of the system,
and for making "aspecty" customization that cut across the framework.
If you don't need decoupling, and don't need to customize across the
whole framework, perhaps you don't need to bother with Hivemind.

So there may be a Hivemind way to inject a different message worker
into only certain classes, but I would guess overriding getMessages()
is probably just fine. Did you try it? Does it work? Is it simple? If
so, no worries!

Cheers, P


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



component that will get localized resources from database?

2006-05-15 Thread Lutz Hühnken

Hi there,

assume you want to create a localized tapestry application, but there
are localized messages that you don't want to store in a properties
file / text file.

In a plain Java application, you could just write your own
implementation of ResourceBundle, that could take the messages from
anywhere, e.g., a database, and use that instead of
PropertyResourceBundle.

With Tapestry, it seems to be more complicated, though. If I
understand correctly, the "AbstractComponent" is "enhanced" by an
"InjectMessagesWorker", as defined in "tapestry.enhance.xml". The
"InjectMessagesWorker" will inject a getMessages() method that will
return the result of ComponentMessagesSource.getMessages(IComponent).

Now, that's not what I want...

A straight-forward approach would be to override "getMessages()" in my
own component. Would that work? To me it seems to collide with the
Hivemind enhancement/injection approach.

Alternatively, I could probably change the InjectMessagesWorker to
something of my own liking. But that would affect *all* components
(that inherit from AbstractComponent), while I would like the modified
behaviour just for my own. Plus, I don't really want to mess with the
"tapestry.enhance.xml", since it is part of the packaged Tapestry
distribution.

So what would be the proper way to do it? Can I override the
"inject-messages" command from "tapestry.enhance.xml" for my own
components? How?

Thanks in advance,

Lutz

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]