T5: changed URI encoding - create valid URIs in javascript

2008-11-07 Thread Martin Grotzke
Hi,

with the fix of TAP5-302 (URL encoded strings that contain symbols such
as %2f (encoded /) are decoded incorrectly in some environments) the
URI encoding/decoding changed.

AFAICS URIs containing anything else than a-z, A-Z, 0-9 or one of -_.:
are considered invalid.

Therefore, when I have an URI that contains e.g. the '*' char, this is
invalid. The URLEncoderImpl expects $002a as a representation for this
char ($ + the four hex digits for this char).

We're doing custom ajax calls and therefore need to build valid URIs
in javascript (in terms of T5-URI-encoding). So I need to encode s.th.
like foo*bar to foo$002abar

Has anybody else this problem and has it solved already?

Is there another / a better way to come around this URI encoding issue
on the client side?

Thx  cheers,
Martin


[1] https://issues.apache.org/jira/browse/TAP5-302



signature.asc
Description: This is a digitally signed message part


Re: T5: changed URI encoding - create valid URIs in javascript

2008-11-07 Thread Martin Grotzke
Hi,

thanx for your answer, martijn!

[ And sorry for my post picking up an already existing topic as a new
thread (I right now *found* the T5-list posts in my mail client, I must
have configured a filter without remembering this :)) ]

We're using AJAX GETs to links with context arguments, I would have to
change many parts in our application. For those who are interested: I
wrote two js-functions for this (at the end of the post).

However, after that I realized that all URLs containing special chars
changed, so that our former URLs are no longer valid. Partly they can be
seen as perma-links - therefore I cannot (don't want to) change the
behavior that much and need to stick (basically) with the former
behavior.

So now I'm contributing a custom URLEncoder - I'll enter the thread
related to the new URLEncoder service for this.

Cheers,
Martin


var VALID_T5_CHARS = 
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890-_.:.split(  
);
function encodeURIComponentForTapestry(uri) {

if ( uri == null || uri.length == 0 ) {
return $B;
}

var result = ;
for( i = 0; i  uri.length; i++ ) {
var c = uri.charAt( i );
if( VALID_T5_CHARS.indexOf( c )  -1 ) {
result += c;
}
else {
result += $00 + uri.charCodeAt( i ).toString(16);
}
}

return result;
}

function encodeURIForTapestry(uri) {
var result = ;
var parts = uri.split( / );
for ( var i = 0; i  parts.length; i++ ) {
result += encodeURIComponentForTapestry( parts[i] );
if ( (i + 1)  parts.length ) {
result += /;
}
}
return result; 
}



On Fri, 2008-11-07 at 10:53 +0100, Martijn Brinkers wrote:
 Initially I used to activation context for my Ajax calls as well. I now
 use the request parameters and JSON for Ajax calls instead of the
 activation context. I think the rationale for the activation context is
 that it makes nicer looking URLs but that's not needed for Ajax calls.
 So you can either create your own specialized URL encoder in Javascript
 or you can change your Ajax calls to use the request parameters.
 
 Martijn
 
 On Fri, 2008-11-07 at 09:56 +0100, Martin Grotzke wrote:
  Hi,
  
  with the fix of TAP5-302 (URL encoded strings that contain symbols such
  as %2f (encoded /) are decoded incorrectly in some environments) the
  URI encoding/decoding changed.
  
  AFAICS URIs containing anything else than a-z, A-Z, 0-9 or one of -_.:
  are considered invalid.
  
  Therefore, when I have an URI that contains e.g. the '*' char, this is
  invalid. The URLEncoderImpl expects $002a as a representation for this
  char ($ + the four hex digits for this char).
  
  We're doing custom ajax calls and therefore need to build valid URIs
  in javascript (in terms of T5-URI-encoding). So I need to encode s.th.
  like foo*bar to foo$002abar
  
  Has anybody else this problem and has it solved already?
  
  Is there another / a better way to come around this URI encoding issue
  on the client side?
  
  Thx  cheers,
  Martin
  
  
  [1] https://issues.apache.org/jira/browse/TAP5-302
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Restore former behavior of URL encoding [WAS: Re: new URLEncoder Service]

2008-11-07 Thread Martin Grotzke
Hi,

I also want to keep the former behavior of URL encoding but have issues
with form submissions.

For keeping the former behavior I added a custom URLEncoder service
which does mostly what was before done in TapestryInternalUtils (see the
code at the end of the post).

However, when I do a form submission containing special chars (like
german umlauts), they are decoded wrong. We're using UTF-8, and have
configured UTF-8 support in our AppModule (Utf8Filter).

AFAICS RequestImpl.getParameter already returns the wrong parameter
value when the form input fields are processed.

Can anybody help with this issue?

Thx  cheers,
Martin


public class UrlEncoderImpl implements URLEncoder {

private final static URLCodec CODEC = new URLCodec();
private static final String PERCENT = %;
private static final Pattern PERCENT_PATTERN = Pattern.compile(PERCENT);
private static final String ENCODED_PERCENT = %25;
private static final Pattern ENCODED_PERCENT_PATTERN = 
Pattern.compile(ENCODED_PERCENT);
private static final String SLASH = /;
private static final Pattern SLASH_PATTERN = Pattern.compile(SLASH);
// just a special char that denotes the slash, to circumvent issues with 
mod_jk
private static final String ENCODED_SLASH = 172;
private static final Pattern ENCODED_SLASH_PATTERN = 
Pattern.compile(ENCODED_SLASH, Pattern.CASE_INSENSITIVE);

/* (non-Javadoc)
 * @see org.apache.tapestry5.services.URLEncoder#decode(java.lang.String)
 */
public String decode( String input ) {
return unescapePercentAndSlash( input );
}

/* (non-Javadoc)
 * @see org.apache.tapestry5.services.URLEncoder#encode(java.lang.String)
 */
public String encode( String input ) {
try {
return CODEC.encode( escapePercentAndSlash(input) );
} catch ( EncoderException e ) {
throw new RuntimeException( e );
}
}
/**
 * Encodes percent and slash characters in the string for later decoding 
via [EMAIL PROTECTED]
 * #unescapePercentAndSlash(String)}.
 *
 * @param input string to encode
 * @return modified string
 */
public static String escapePercentAndSlash(String input) {
return replace(replace(input, PERCENT_PATTERN, ENCODED_PERCENT), 
SLASH_PATTERN, ENCODED_SLASH);
}

/**
 * Used to decode certain escaped characters that are replaced when using 
[EMAIL PROTECTED] #encodeContext(String)}}.
 *
 * @param input a previously encoded string
 * @return the string with slash and percent characters restored
 */
public static String unescapePercentAndSlash(String input) {
return replace( replace( input, ENCODED_SLASH_PATTERN, SLASH ), 
ENCODED_PERCENT_PATTERN, PERCENT );
}

private static String replace( String input, Pattern pattern, String 
replacement ) {
return pattern.matcher(input).replaceAll(replacement);
}

public static void main( String[] args ) {
print( foo/bar test );
print( tästumlaut );

}

private static void print( final String uri ) {
System.out.println( encoded:  + new UrlEncoderImpl().encode( uri ) );
System.out.println( decoded:  + new UrlEncoderImpl().decode( new 
UrlEncoderImpl().encode( uri ) ) );
}

}


On Tue, 2008-10-28 at 15:39 -0700, Howard Lewis Ship wrote:
 Contribute a new implementation of URLEncoder to the Alias service
 configuration and Tapestry will use the contributed one instead of the
 default URLEncoder service.
 
 Alternately, you can decorate the URLEncoder service with an
 alternative implementation, or a filter depending on how much of the
 existing URLEncoder service implementation you want to keep.
 
 Could you provide some more context as to why URLEncoder is a problem?
 
 On Tue, Oct 28, 2008 at 11:39 AM, jthompson209 [EMAIL PROTECTED] wrote:
 
  Hello I am in need of either turning off this new service or overriding it
  and having it do nothing, it is currently breaking some code that I have,
  what would be the best way of doing that, also if overriding it is the
  answer how would i go about doing it.
 
  thanks so much
  -jeff
  --
  View this message in context: 
  http://n2.nabble.com/new-URLEncoder-Service-tp1389907p1389907.html
  Sent from the Tapestry Users mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Bug with grid default-sorting

2008-10-13 Thread Martin Grotzke
Hi,

can anybody help with https://issues.apache.org/jira/browse/TAP5-135
(Grid.getSortContraints NPE when sortColumnId != null)?

Is there any workaround for this or any other solution?

1) We really want to upgrade T5 because of
https://issues.apache.org/jira/browse/TAPESTRY-2561
2) We really need a default sorting, as this is very important for our
customer.

Any help appreciated!

Thanx in advance,
cheers,
Martin



signature.asc
Description: This is a digitally signed message part


Re: t5.0.15 datefield

2008-09-24 Thread Martin Grotzke
Hi,

On Tue, 2008-09-23 at 23:59 +0200, Luca Menegus wrote:
[snip]
 if anybody is interested I'll have some more tests tomorrow.
I have also seen this issue but didn't find the time to have a look at
it. So I'm definitely interested :)

 Looking forward to have a fix for this issue included in the next release.
Sounds really good!

Cheers,
Martin



On Tue, 2008-09-23 at 23:59 +0200, Luca Menegus wrote:
 Hi all,
  don't know if this has been already reported but the new datefield 
 component's not working for me. The problem seems to lie in the onParse 
 methos of the org.apache.tapestry5.corelib.components.DateField class 
 which reads:
 
 JSONObject onParse()
 {
 String input = request.getParameter(INPUT_PARAMETER);
 JSONObject response = *new* JSONObject();
 *try*
 {
 Date date = format.parse(input);
 response.put(RESULT, date.toString());
 }
 *catch* (ParseException ex)
 {
 response.put(ERROR, ex.getMessage());
 }
 *return* response;
 }
 
 It formats the response using date.toString() which returns a string 
 which is not parsable by JS in my current setup. I got around it 
 replacing response.put(RESULT,date.toString()); with 
 response.put(RESULT, popupFormat.format(date)); (popupFormat is 
 defined in the same class as *new* SimpleDateFormat(*MM/dd/*);). 
 Don't know if this format is correctly parsed by all browser in every 
 Locale, if anybody is interested I'll have some more tests tomorrow.
 Looking forward to have a fix for this issue included in the next release.
 Nice night,
  Luca
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


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

2008-08-13 Thread Martin Grotzke
Hi Lutz,

this approach sounds really good, I'll give it a try.

Thanx  cheers,
Martin


On Sat, 2008-08-09 at 00:11 +0200, Lutz Hühnken wrote:
 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]



signature.asc
Description: This is a digitally signed message part


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

2008-08-07 Thread Martin Grotzke
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



signature.asc
Description: This is a digitally signed message part


Re: T5: Different behavior of Palette Component in FireFox, Safari and IE

2008-07-10 Thread Martin Grotzke
Hi,

we experience exactly the same issue: with FF3 the palette submits the
form, with FF2 this is not the case. Max, when you submit the issue in
jira please send a ping here, so that I can vote :)

Cheers,
Martin


On Wed, 2008-07-09 at 18:23 +0200, Maximilian Weißböck wrote:
 Palette Component behaves different in FireFox then it does in Safari and IE
 
  
 
 If  palette item is moved in FireFox the following events are triggered
 
   
 
   onSuccess()
 
   onSubmit()
 
  
 
 If  palette item is moved in Safari or IE none of the above events is 
 triggered.
 
  
 
 Is this suggested to be a bug? Then I would file a Jira Issue.
 
 Tested with FF 3.0, Safari 3.1 and IE 6 (all on Windows)
 
  
 
 Regards, Max
 
  
 


signature.asc
Description: This is a digitally signed message part


Re: T5: Different behavior of Palette Component in FireFox, Safari and IE

2008-07-10 Thread Martin Grotzke
Hi Yunhua,

really good news! We're using 5.0.11...

Thanx for the hint,
cheers,
Martin


On Thu, 2008-07-10 at 07:37 -0400, Yunhua Sang wrote:
 What version of T5 are you guys using?
 
 I think there was a jira about it and it has been fixed already. see.
 
 https://issues.apache.org/jira/browse/TAPESTRY-2507 - Palette
 component forces an unwanted form submit under FireFox 3
 
 Yunhua
 
 On Thu, Jul 10, 2008 at 5:44 AM, Martin Grotzke
 [EMAIL PROTECTED] wrote:
  Hi,
 
  we experience exactly the same issue: with FF3 the palette submits the
  form, with FF2 this is not the case. Max, when you submit the issue in
  jira please send a ping here, so that I can vote :)
 
  Cheers,
  Martin
 
 
  On Wed, 2008-07-09 at 18:23 +0200, Maximilian Weißböck wrote:
  Palette Component behaves different in FireFox then it does in Safari and 
  IE
 
 
 
  If  palette item is moved in FireFox the following events are triggered
 
 
 
onSuccess()
 
onSubmit()
 
 
 
  If  palette item is moved in Safari or IE none of the above events is 
  triggered.
 
 
 
  Is this suggested to be a bug? Then I would file a Jira Issue.
 
  Tested with FF 3.0, Safari 3.1 and IE 6 (all on Windows)
 
 
 
  Regards, Max
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


signature.asc
Description: This is a digitally signed message part


Re: T5 application not responding, blocked at PerThreadServiceCreator.createObject

2008-05-15 Thread Martin Grotzke
Hi Howard,

I have upgraded our application to T5.0.11 and deployed it on one tomcat
for testing, this one is running fine now - the issue seems to be solved
with this. Thanx a lot! :)

Though there are still 2 issues introduced with the upgrade to 5.0.11:
- dateField component does not allow specifying format
  
(http://www.nabble.com/T5-dateField-component-does-not-allow-specifying-format-%28in-5.0.11%29-%5E-td17168397.html)
- setting initial sort order for grid in T5.0.11
  
(http://www.nabble.com/T5-setting-initial-sort-order-for-grid-in-T5.0.11-td17165163.html)

AFAICS the first one is represented by issue 
TAPESTRY-2198 which is not yet assigned and has no target fix version.
Can you say what you think regarding this issue?

The second issue seems to be still open, I got no response until now
here on the list. Can you help me with this? Shall I enter an issue for
this one?

For us it's important to be able to tell our customers what's going on,
that we can give a timeline and provide orientation :)

Thanx for your help,
cheers,
Martin


On Fri, 2008-05-09 at 18:08 -0700, Howard Lewis Ship wrote:
 Perhaps an upgrade to 5.0.11 rather than the .12-SNAPSHOT?  I'm not
 sure how much changed between .10 and .11 API-wise.  It already seems
 like ancient history to me :-)
 
 On Fri, May 9, 2008 at 5:56 PM, Martin Grotzke
 [EMAIL PROTECTED] wrote:
  On Fri, 2008-05-09 at 17:43 -0700, Howard Lewis Ship wrote:
  The problem with snapshots is that it makes it that much harder to
  figure out if this is a bug that's been fixed, or something new.
  Completely true. I already search jira for fixes in 5.0.10 to 5.0.12
  that might be related to this but found none.
 
  As there are changes in the API it's not that easy for us to upgrade to
  5.0.12, and IIRC there were issues with the calendar/date-component.
  Then we also need to have testing cycles with the customers.
  I'm also thinking about upgrading because then it's easier to track this
  down, but it will take about 2 weeks until we could shift our
  application with the latest T5 to production.
 
  That's why I asked directly on this list...
 
  Cheers,
  Martin
 
 
 
  On Fri, May 9, 2008 at 5:39 PM, Martin Grotzke
  [EMAIL PROTECTED] wrote:
   Hi,
  
   yesterday we deployed our application upgraded from T5.0.5 to 5.0.10
   (SNAPSHOT 2008-02-11) on the production system, now it hangs from time
   to time with several thread blocked at
   PerThreadServiceCreator.createObject.
  
   We started with default settings for thetapestry.page-pool.hard-limit
   and soft-limit (20, 5). With this we got a page pool exausted error on
   one tomcat after some time, while others were fine with this.
  
   Then we increased the soft-limit to 20 and the hard-limit to 100, which
   also produced this error, but not always. Even without the pool exausted
   error the application hung and did not respond for some minutes (about 3
   minutes).
  
   Now we have the hard-limit set to 150, which does not produce any pool
   exausted errors, but still the application hangs.
  
   All thread dumps that are created when the application is not responding
   show blocked threads at PerThreadServiceCreator.createObject, and I
   cannot see anything else that might cause this behaviour.
   Looking at jconsole when the app is not responding shows an increasing
   number of threads, and an increasing amount of used memory (e.g. from
   500M to 800M), CPU is very low all the time.
  
   I have uploaded a complete threaddump at http://senduit.com/a7afc7, an
   aggregated version of this can be found at http://senduit.com/0d3f16.
  
   We're running java-1.6.0_02, T5.0.10-SNAPSHOT and Tomcat 6.
  
   Has anybody an idea what might be the reason for this behavior?
  
   Thanx a lot for your help,
   cheers,
   Martin
  
  
  
 
 
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Martin Grotzke
Hi,

I'm just upgrading our app from 5.0.10-SNAPSHOT to 5.0.11 and get
exceptions for ASOs that have a non default constructor (additionally to
the default constructor):

Caused by: java.lang.RuntimeException: Error invoking constructor 
com.freiheit.shopping24.shop.search.model.AnalysedSearchParameters(DBShopCategory,
 List, String, String, String, String, List, List, DisplayedEntriesEnum, 
SortOrderField, ViewStyle, int, String, boolean, boolean, boolean, boolean, 
boolean) (at AnalysedSearchParameters.java:73) (for service 
'ApplicationStateManager'): No service implements the interface 
com.freiheit.shopping24.shop.search.model.DBShopCategory.
at 
org.apache.tapestry.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:62)
at 
org.apache.tapestry.ioc.internal.ServiceResourcesImpl.autobuild(ServiceResourcesImpl.java:123)
at 
org.apache.tapestry.internal.services.ApplicationStateManagerImpl$1.create(ApplicationStateManagerImpl.java:98)
at 
org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:56)
at 
org.apache.tapestry.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:45)
at 
org.apache.tapestry.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:126)
at 
$ApplicationStateManager_119d7fb59ed.get($ApplicationStateManager_119d7fb59ed.java)
at 
com.freiheit.shopping24.shop.search.presentation.pages.Search._$read_searchParameters(Search.java)
at 
com.freiheit.shopping24.shop.search.presentation.pages.Search.onActivate(Search.java:188)
at 
com.freiheit.shopping24.shop.search.presentation.pages.Search.dispatchComponentEvent(Search.java)
at 
org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843)
at 
org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1004)
... 91 more
Caused by: java.lang.RuntimeException: No service implements the interface 
com.freiheit.shopping24.shop.search.model.DBShopCategory.
at 
org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:517)
at 
org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46)
at 
$MasterObjectProvider_119d7fb5998.provide($MasterObjectProvider_119d7fb5998.java)
at 
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:621)
at 
org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:675)
at 
org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:50)
at 
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209)
at 
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239)
at 
org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersForConstructor(InternalUtils.java:227)
at 
org.apache.tapestry.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:46)
... 102 more

The class AnalysedSearchParameters still has a default constructor.

Is this really not allowed, or is this a bug?

Thanx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Martin Grotzke
On Sun, 2008-05-11 at 15:13 +0200, Filip S. Adamsen wrote:
 Hi,
 
 Tapestry is trying to inject services into your ASO's constructor. In 
 5.0.12-SNAPSHOT you can put @Inject on the constructor Tapestry should 
 use when auto-instantiating.
Ok, thanx! This will solve our issue when we can upgrade to 5.0.12.

 
 Until you can upgrade to 5.0.12 I guess a workaround would be to 
 contribute and ApplicationStateCreator for your ASO.
The parameters of the ASO constructor are runtime parameters, so AFAICS
we could not use an ApplicationStateCreator.

I now added a test if the ASO already exists before we access it, so
that T5 does not has to create the ASO. Hopefully I found all cases
where this would be an issue ;)

Cheers,
Martin


 
 See Configuring ASOs at the bottom:
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html
 
 -Filip
 
 On 2008-05-11 14:54, Martin Grotzke wrote:
  Hi,
  
  I'm just upgrading our app from 5.0.10-SNAPSHOT to 5.0.11 and get
  exceptions for ASOs that have a non default constructor (additionally to
  the default constructor):
  
  Caused by: java.lang.RuntimeException: Error invoking constructor 
  com.freiheit.shopping24.shop.search.model.AnalysedSearchParameters(DBShopCategory,
   List, String, String, String, String, List, List, DisplayedEntriesEnum, 
  SortOrderField, ViewStyle, int, String, boolean, boolean, boolean, boolean, 
  boolean) (at AnalysedSearchParameters.java:73) (for service 
  'ApplicationStateManager'): No service implements the interface 
  com.freiheit.shopping24.shop.search.model.DBShopCategory.
  at 
  org.apache.tapestry.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:62)
  at 
  org.apache.tapestry.ioc.internal.ServiceResourcesImpl.autobuild(ServiceResourcesImpl.java:123)
  at 
  org.apache.tapestry.internal.services.ApplicationStateManagerImpl$1.create(ApplicationStateManagerImpl.java:98)
  at 
  org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:56)
  at 
  org.apache.tapestry.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:45)
  at 
  org.apache.tapestry.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:126)
  at 
  $ApplicationStateManager_119d7fb59ed.get($ApplicationStateManager_119d7fb59ed.java)
  at 
  com.freiheit.shopping24.shop.search.presentation.pages.Search._$read_searchParameters(Search.java)
  at 
  com.freiheit.shopping24.shop.search.presentation.pages.Search.onActivate(Search.java:188)
  at 
  com.freiheit.shopping24.shop.search.presentation.pages.Search.dispatchComponentEvent(Search.java)
  at 
  org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843)
  at 
  org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1004)
  ... 91 more
  Caused by: java.lang.RuntimeException: No service implements the interface 
  com.freiheit.shopping24.shop.search.model.DBShopCategory.
  at 
  org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:517)
  at 
  org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46)
  at 
  $MasterObjectProvider_119d7fb5998.provide($MasterObjectProvider_119d7fb5998.java)
  at 
  org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:621)
  at 
  org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:675)
  at 
  org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:50)
  at 
  org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209)
  at 
  org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239)
  at 
  org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersForConstructor(InternalUtils.java:227)
  at 
  org.apache.tapestry.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:46)
  ... 102 more
  
  The class AnalysedSearchParameters still has a default constructor.
  
  Is this really not allowed, or is this a bug?
  
  Thanx  cheers,
  Martin
  
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


signature.asc
Description: This is a digitally signed message part


Re: T5 ASO cannot have a non default constructor in 5.0.11?

2008-05-11 Thread Martin Grotzke
On Sun, 2008-05-11 at 16:15 +0200, Filip S. Adamsen wrote:
 You can still use an ApplicationStateCreator. Just instantiate the ASO 
 in the creator and set the values wherever you want after its creation.
Ha, you're right, I simply want to invoke the default constructor - I
forgot this ;)

Thanx  cheers,
Martin


 
 -Filip
 
 On 2008-05-11 16:12, Martin Grotzke wrote:
  On Sun, 2008-05-11 at 15:13 +0200, Filip S. Adamsen wrote:
  Hi,
 
  Tapestry is trying to inject services into your ASO's constructor. In 
  5.0.12-SNAPSHOT you can put @Inject on the constructor Tapestry should 
  use when auto-instantiating.
  Ok, thanx! This will solve our issue when we can upgrade to 5.0.12.
  
  Until you can upgrade to 5.0.12 I guess a workaround would be to 
  contribute and ApplicationStateCreator for your ASO.
  The parameters of the ASO constructor are runtime parameters, so AFAICS
  we could not use an ApplicationStateCreator.
  
  I now added a test if the ASO already exists before we access it, so
  that T5 does not has to create the ASO. Hopefully I found all cases
  where this would be an issue ;)
  
  Cheers,
  Martin
  
  
  See Configuring ASOs at the bottom:
  http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html
 
  -Filip
 
  On 2008-05-11 14:54, Martin Grotzke wrote:
  Hi,
 
  I'm just upgrading our app from 5.0.10-SNAPSHOT to 5.0.11 and get
  exceptions for ASOs that have a non default constructor (additionally to
  the default constructor):
 
  Caused by: java.lang.RuntimeException: Error invoking constructor 
  com.freiheit.shopping24.shop.search.model.AnalysedSearchParameters(DBShopCategory,
   List, String, String, String, String, List, List, DisplayedEntriesEnum, 
  SortOrderField, ViewStyle, int, String, boolean, boolean, boolean, 
  boolean, boolean) (at AnalysedSearchParameters.java:73) (for service 
  'ApplicationStateManager'): No service implements the interface 
  com.freiheit.shopping24.shop.search.model.DBShopCategory.
  at 
  org.apache.tapestry.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:62)
  at 
  org.apache.tapestry.ioc.internal.ServiceResourcesImpl.autobuild(ServiceResourcesImpl.java:123)
  at 
  org.apache.tapestry.internal.services.ApplicationStateManagerImpl$1.create(ApplicationStateManagerImpl.java:98)
  at 
  org.apache.tapestry.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:56)
  at 
  org.apache.tapestry.internal.services.ApplicationStateManagerImpl$ApplicationStateAdapter.getOrCreate(ApplicationStateManagerImpl.java:45)
  at 
  org.apache.tapestry.internal.services.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:126)
  at 
  $ApplicationStateManager_119d7fb59ed.get($ApplicationStateManager_119d7fb59ed.java)
  at 
  com.freiheit.shopping24.shop.search.presentation.pages.Search._$read_searchParameters(Search.java)
  at 
  com.freiheit.shopping24.shop.search.presentation.pages.Search.onActivate(Search.java:188)
  at 
  com.freiheit.shopping24.shop.search.presentation.pages.Search.dispatchComponentEvent(Search.java)
  at 
  org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843)
  at 
  org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1004)
  ... 91 more
  Caused by: java.lang.RuntimeException: No service implements the 
  interface com.freiheit.shopping24.shop.search.model.DBShopCategory.
  at 
  org.apache.tapestry.ioc.internal.RegistryImpl.getService(RegistryImpl.java:517)
  at 
  org.apache.tapestry.ioc.internal.services.MasterObjectProviderImpl.provide(MasterObjectProviderImpl.java:46)
  at 
  $MasterObjectProvider_119d7fb5998.provide($MasterObjectProvider_119d7fb5998.java)
  at 
  org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:621)
  at 
  org.apache.tapestry.ioc.internal.RegistryImpl.getObject(RegistryImpl.java:675)
  at 
  org.apache.tapestry.ioc.internal.ObjectLocatorImpl.getObject(ObjectLocatorImpl.java:50)
  at 
  org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameterValue(InternalUtils.java:209)
  at 
  org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParameters(InternalUtils.java:239)
  at 
  org.apache.tapestry.ioc.internal.util.InternalUtils.calculateParametersForConstructor(InternalUtils.java:227)
  at 
  org.apache.tapestry.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:46)
  ... 102 more
 
  The class AnalysedSearchParameters still has a default constructor.
 
  Is this really not allowed, or is this a bug?
 
  Thanx  cheers,
  Martin

T5 setting initial sort order for grid in T5.0.11

2008-05-10 Thread Martin Grotzke
Hi,

I'm just upgrading our T5 app from 5.0.10-SNAPSHOT to 5.0.11.
Before we specified the initial sort order with this:

  _grid.setSortColumnId(month);
  _grid.setSortAscending(false);

With 5.0.11 this is gone. Can anybody tell me how one can specify the
initial sort order (coumn and ascending) in 5.0.11?

Thanx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


T5 dateField component does not allow specifying format (in 5.0.11)?^

2008-05-10 Thread Martin Grotzke
Hi,

I'm just upgrading our app to 5.0.11. I see that the dateField component
changed (IIRC because of licensing issues). Is it correct, that this
version of dateField does not allow setting the format/localization?

If so, is this also the case for 5.0.12-SNAPSHOT?

Thanx  cheers,
Martin



signature.asc
Description: This is a digitally signed message part


Re: T5 dateField component does not allow specifying format (in 5.0.11)?^

2008-05-10 Thread Martin Grotzke
Yes, correct localization is important for us, too. Just voted.

Cheers,
Martin


On Sun, 2008-05-11 at 09:18 +1000, Geoff Callender wrote:
 Hi Martin,
 
 Perhaps you'd like to vote for Date formatting global support
 https://issues.apache.org/jira/browse/TAPESTRY-2198
 
 Cheers,
 
 Geoff
 
 On 11/05/2008, at 8:55 AM, Martin Grotzke wrote:
 
  Hi,
 
  I'm just upgrading our app to 5.0.11. I see that the dateField  
  component
  changed (IIRC because of licensing issues). Is it correct, that this
  version of dateField does not allow setting the format/localization?
 
  If so, is this also the case for 5.0.12-SNAPSHOT?
 
  Thanx  cheers,
  Martin
 
 


signature.asc
Description: This is a digitally signed message part


T5 application not responding, blocked at PerThreadServiceCreator.createObject

2008-05-09 Thread Martin Grotzke
Hi,

yesterday we deployed our application upgraded from T5.0.5 to 5.0.10
(SNAPSHOT 2008-02-11) on the production system, now it hangs from time
to time with several thread blocked at
PerThreadServiceCreator.createObject.

We started with default settings for thetapestry.page-pool.hard-limit
and soft-limit (20, 5). With this we got a page pool exausted error on
one tomcat after some time, while others were fine with this.

Then we increased the soft-limit to 20 and the hard-limit to 100, which
also produced this error, but not always. Even without the pool exausted
error the application hung and did not respond for some minutes (about 3
minutes).

Now we have the hard-limit set to 150, which does not produce any pool
exausted errors, but still the application hangs.

All thread dumps that are created when the application is not responding
show blocked threads at PerThreadServiceCreator.createObject, and I
cannot see anything else that might cause this behaviour.
Looking at jconsole when the app is not responding shows an increasing
number of threads, and an increasing amount of used memory (e.g. from
500M to 800M), CPU is very low all the time.

I have uploaded a complete threaddump at http://senduit.com/a7afc7, an
aggregated version of this can be found at http://senduit.com/0d3f16.

We're running java-1.6.0_02, T5.0.10-SNAPSHOT and Tomcat 6.

Has anybody an idea what might be the reason for this behavior?

Thanx a lot for your help,
cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5 application not responding, blocked at PerThreadServiceCreator.createObject

2008-05-09 Thread Martin Grotzke
On Fri, 2008-05-09 at 17:43 -0700, Howard Lewis Ship wrote:
 The problem with snapshots is that it makes it that much harder to
 figure out if this is a bug that's been fixed, or something new.
Completely true. I already search jira for fixes in 5.0.10 to 5.0.12
that might be related to this but found none.

As there are changes in the API it's not that easy for us to upgrade to
5.0.12, and IIRC there were issues with the calendar/date-component.
Then we also need to have testing cycles with the customers.
I'm also thinking about upgrading because then it's easier to track this
down, but it will take about 2 weeks until we could shift our
application with the latest T5 to production.

That's why I asked directly on this list...

Cheers,
Martin


 
 On Fri, May 9, 2008 at 5:39 PM, Martin Grotzke
 [EMAIL PROTECTED] wrote:
  Hi,
 
  yesterday we deployed our application upgraded from T5.0.5 to 5.0.10
  (SNAPSHOT 2008-02-11) on the production system, now it hangs from time
  to time with several thread blocked at
  PerThreadServiceCreator.createObject.
 
  We started with default settings for thetapestry.page-pool.hard-limit
  and soft-limit (20, 5). With this we got a page pool exausted error on
  one tomcat after some time, while others were fine with this.
 
  Then we increased the soft-limit to 20 and the hard-limit to 100, which
  also produced this error, but not always. Even without the pool exausted
  error the application hung and did not respond for some minutes (about 3
  minutes).
 
  Now we have the hard-limit set to 150, which does not produce any pool
  exausted errors, but still the application hangs.
 
  All thread dumps that are created when the application is not responding
  show blocked threads at PerThreadServiceCreator.createObject, and I
  cannot see anything else that might cause this behaviour.
  Looking at jconsole when the app is not responding shows an increasing
  number of threads, and an increasing amount of used memory (e.g. from
  500M to 800M), CPU is very low all the time.
 
  I have uploaded a complete threaddump at http://senduit.com/a7afc7, an
  aggregated version of this can be found at http://senduit.com/0d3f16.
 
  We're running java-1.6.0_02, T5.0.10-SNAPSHOT and Tomcat 6.
 
  Has anybody an idea what might be the reason for this behavior?
 
  Thanx a lot for your help,
  cheers,
  Martin
 
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Re: T5 application not responding, blocked at PerThreadServiceCreator.createObject

2008-05-09 Thread Martin Grotzke
On Fri, 2008-05-09 at 17:47 -0700, Howard Lewis Ship wrote:
 The code in question was certainly changed by a bug fixed related to
 threading issues; rather than hangs, some users were seeing NPEs.
 
 Here's the bug: https://issues.apache.org/jira/browse/TAPESTRY-2141
I thought this would not apply to java 1.6, and we don't see NPEs in
ThreadLocal. Do you think the previous implementation of
PerThreadServiceCreator might cause the behaviour of our app?

 
 Fixed in 5.0.11.
Great! :)

 
 Can you try upgrading from 5.0.10-SNAPSHOT to 5.0.11?
Yes I can try, but this may take some time until we have this on
production. And having the current situation for two weeks on the
production system is not too far from beeing a desaster ;)
We also ran load tests before shifting the app with the changes to
production, but (unfortunately) didn't experience these problems.

Thanx for your help,
cheers,
Martin

 
 On Fri, May 9, 2008 at 5:39 PM, Martin Grotzke
 [EMAIL PROTECTED] wrote:
  Hi,
 
  yesterday we deployed our application upgraded from T5.0.5 to 5.0.10
  (SNAPSHOT 2008-02-11) on the production system, now it hangs from time
  to time with several thread blocked at
  PerThreadServiceCreator.createObject.
 
  We started with default settings for thetapestry.page-pool.hard-limit
  and soft-limit (20, 5). With this we got a page pool exausted error on
  one tomcat after some time, while others were fine with this.
 
  Then we increased the soft-limit to 20 and the hard-limit to 100, which
  also produced this error, but not always. Even without the pool exausted
  error the application hung and did not respond for some minutes (about 3
  minutes).
 
  Now we have the hard-limit set to 150, which does not produce any pool
  exausted errors, but still the application hangs.
 
  All thread dumps that are created when the application is not responding
  show blocked threads at PerThreadServiceCreator.createObject, and I
  cannot see anything else that might cause this behaviour.
  Looking at jconsole when the app is not responding shows an increasing
  number of threads, and an increasing amount of used memory (e.g. from
  500M to 800M), CPU is very low all the time.
 
  I have uploaded a complete threaddump at http://senduit.com/a7afc7, an
  aggregated version of this can be found at http://senduit.com/0d3f16.
 
  We're running java-1.6.0_02, T5.0.10-SNAPSHOT and Tomcat 6.
 
  Has anybody an idea what might be the reason for this behavior?
 
  Thanx a lot for your help,
  cheers,
  Martin
 
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Re: T5 application not responding, blocked at PerThreadServiceCreator.createObject

2008-05-09 Thread Martin Grotzke
On Fri, 2008-05-09 at 18:08 -0700, Howard Lewis Ship wrote:
 Perhaps an upgrade to 5.0.11 rather than the .12-SNAPSHOT?  I'm not
 sure how much changed between .10 and .11 API-wise.  
I just changed the dependency to 5.0.11. Some changes have to be made,
but hopefully not too many. I'll have a look...

Cheers,
Martin

 It already seems
 like ancient history to me :-)
 
 On Fri, May 9, 2008 at 5:56 PM, Martin Grotzke
 [EMAIL PROTECTED] wrote:
  On Fri, 2008-05-09 at 17:43 -0700, Howard Lewis Ship wrote:
  The problem with snapshots is that it makes it that much harder to
  figure out if this is a bug that's been fixed, or something new.
  Completely true. I already search jira for fixes in 5.0.10 to 5.0.12
  that might be related to this but found none.
 
  As there are changes in the API it's not that easy for us to upgrade to
  5.0.12, and IIRC there were issues with the calendar/date-component.
  Then we also need to have testing cycles with the customers.
  I'm also thinking about upgrading because then it's easier to track this
  down, but it will take about 2 weeks until we could shift our
  application with the latest T5 to production.
 
  That's why I asked directly on this list...
 
  Cheers,
  Martin
 
 
 
  On Fri, May 9, 2008 at 5:39 PM, Martin Grotzke
  [EMAIL PROTECTED] wrote:
   Hi,
  
   yesterday we deployed our application upgraded from T5.0.5 to 5.0.10
   (SNAPSHOT 2008-02-11) on the production system, now it hangs from time
   to time with several thread blocked at
   PerThreadServiceCreator.createObject.
  
   We started with default settings for thetapestry.page-pool.hard-limit
   and soft-limit (20, 5). With this we got a page pool exausted error on
   one tomcat after some time, while others were fine with this.
  
   Then we increased the soft-limit to 20 and the hard-limit to 100, which
   also produced this error, but not always. Even without the pool exausted
   error the application hung and did not respond for some minutes (about 3
   minutes).
  
   Now we have the hard-limit set to 150, which does not produce any pool
   exausted errors, but still the application hangs.
  
   All thread dumps that are created when the application is not responding
   show blocked threads at PerThreadServiceCreator.createObject, and I
   cannot see anything else that might cause this behaviour.
   Looking at jconsole when the app is not responding shows an increasing
   number of threads, and an increasing amount of used memory (e.g. from
   500M to 800M), CPU is very low all the time.
  
   I have uploaded a complete threaddump at http://senduit.com/a7afc7, an
   aggregated version of this can be found at http://senduit.com/0d3f16.
  
   We're running java-1.6.0_02, T5.0.10-SNAPSHOT and Tomcat 6.
  
   Has anybody an idea what might be the reason for this behavior?
  
   Thanx a lot for your help,
   cheers,
   Martin
  
  
  
 
 
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Re: T5 (5.0.11) - ready for production deployment

2008-03-27 Thread Martin Grotzke
Hi,

we also have a production app running T5 http://www.smatch.com, very
stable, up and running.

Cheers,
Martin


On Wed, 2008-03-26 at 21:14 +0100, Jan Vissers wrote:
 Hi,
 
 I have an opportunity to use T5 (5.0.11) in an assignment. My question is;
 is it safe for me to do so? The application is quite simple in that not
 many UI components/forms have to be created. There will be a requirement
 to have google suggest like functionality, along with a small other Ajax
 component. The deployment platform will be tomcat.
 
 What do you think - 'is it safe' ?
 
 Thanks for any feedback,
 -J.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


signature.asc
Description: This is a digitally signed message part


Re: [T5] How to get ampersand () rendered raw / not encoded as amp;?

2008-03-18 Thread Martin Grotzke
Hi,

On Tue, 2008-03-18 at 14:19 +0100, Chris Lewis wrote:
 Martin,
 
 I'm guessing your mail client converted Josh's message because it
 rendered the  in the url as amp; - just as you have explained and
 shown.
Ok, thanx :)

  As he said, url's with amp; in place of  are actually correct
 and should not cause problems (I personally have never seen these urls
 cause any).
I would say that a request parameter appended with amp;param=value
would be seen by the server as amp;param instead of just param.

Cheers,
Martin

 
 chris
 
 Martin Grotzke wrote:
  On Mon, 2008-03-17 at 15:24 -0700, Josh Canfield wrote:

  If I am understanding you correctly, you are getting something like
  this in your source:
 
  iframe src=http://host/page?arg1=val1arg2=val2;/iframe
  
  Nope, unfortunately I get src=http://host/page?arg1=val1arg2=val2;
  so the  is rendered as amp;
 
  Cheers,
  Martin
 
 

  That is actually the correct behavior and it shouldn't be causing a
  problem in your browser. Are you seeing a problem?
 
  http://htmlhelp.com/tools/validator/problems.html#amp
 
  Josh
 
 
  On Mon, Mar 17, 2008 at 1:18 PM, Martin Grotzke
  [EMAIL PROTECTED] wrote:
  
  Hi,
 
  I have a an html element (iframe) that get's a property of my page class
  (the current query string) appended to its src attribute.
 
  The query string may contain the  char, which always gets expanded as
  amp;. Is there any possibility to prevent T5 from encoding this char?
 
  Thanx  cheers,
  Martin
 
 
 

 
  


signature.asc
Description: This is a digitally signed message part


Re: [T5] How to get ampersand () rendered raw / not encoded as amp;?

2008-03-18 Thread Martin Grotzke
Hi,

On Tue, 2008-03-18 at 17:51 +0100, Filip S. Adamsen wrote:
  I would say that a request parameter appended with amp;param=value
  would be seen by the server as amp;param instead of just param.
 
 W3C says otherwise: With HTML, the browser translates amp; to  so 
 the Web server would only see  and not amp; in the query string of 
 the request.
 
 http://htmlhelp.com/tools/validator/problems.html#amp
 
 It's not a problem. I see the exact same behaviour and it's working just 
 fine. :)
You're right! It was indeed only an asumption that it would not work, I
wasn't aware that browsers not only translate entities for what is going
to the user but also for such things - what is requested elsewhere...

New day - a new thing learned, great :)

Thanx  cheers,
Martin


On Tue, 2008-03-18 at 17:51 +0100, Filip S. Adamsen wrote:
 Hi,
 
 On 2008-03-18 15:41, Martin Grotzke wrote:
  Hi,
  
  On Tue, 2008-03-18 at 14:19 +0100, Chris Lewis wrote:
  Martin,
 
  I'm guessing your mail client converted Josh's message because it
  rendered the  in the url as amp; - just as you have explained and
  shown.
  Ok, thanx :)
  
   As he said, url's with amp; in place of  are actually correct
  and should not cause problems (I personally have never seen these urls
  cause any).
  I would say that a request parameter appended with amp;param=value
  would be seen by the server as amp;param instead of just param.
 
 W3C says otherwise: With HTML, the browser translates amp; to  so 
 the Web server would only see  and not amp; in the query string of 
 the request.
 
 http://htmlhelp.com/tools/validator/problems.html#amp
 
 It's not a problem. I see the exact same behaviour and it's working just 
 fine. :)
 
 -Filip
 
  
  Cheers,
  Martin
  
  chris
 
  Martin Grotzke wrote:
  On Mon, 2008-03-17 at 15:24 -0700, Josh Canfield wrote:

  If I am understanding you correctly, you are getting something like
  this in your source:
 
  iframe src=http://host/page?arg1=val1arg2=val2;/iframe
  
  Nope, unfortunately I get src=http://host/page?arg1=val1arg2=val2;
  so the  is rendered as amp;
 
  Cheers,
  Martin
 
 

  That is actually the correct behavior and it shouldn't be causing a
  problem in your browser. Are you seeing a problem?
 
  http://htmlhelp.com/tools/validator/problems.html#amp
 
  Josh
 
 
  On Mon, Mar 17, 2008 at 1:18 PM, Martin Grotzke
  [EMAIL PROTECTED] wrote:
  
  Hi,
 
  I have a an html element (iframe) that get's a property of my page class
  (the current query string) appended to its src attribute.
 
  The query string may contain the  char, which always gets expanded as
  amp;. Is there any possibility to prevent T5 from encoding this char?
 
  Thanx  cheers,
  Martin
 
 
 

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


signature.asc
Description: This is a digitally signed message part


Re: [T5] How to get ampersand () rendered raw / not encoded as amp;?

2008-03-18 Thread Martin Grotzke
Hi,

On Tue, 2008-03-18 at 10:06 -0700, Josh Canfield wrote:
 Hi Martin,
 
 I'm confused by your statement:
  I would say that a request parameter appended with amp;param=value
  would be seen by the server as amp;param instead of just param.
 
 Does this mean that you are seeing a problem on the server side? 
Nope, as I just wrote I simply asumed that - misleadingly ;)

Cheers,
Martin


 What
 you are describing is not what I would expect, if you are seeing this
 then there might be something else going on.
 
 Josh
 
 On Tue, Mar 18, 2008 at 7:41 AM, Martin Grotzke
 [EMAIL PROTECTED] wrote:
  Hi,
 
  On Tue, 2008-03-18 at 14:19 +0100, Chris Lewis wrote:
   Martin,
  
   I'm guessing your mail client converted Josh's message because it
   rendered the  in the url as amp; - just as you have explained and
   shown.
  Ok, thanx :)
 
As he said, url's with amp; in place of  are actually correct
   and should not cause problems (I personally have never seen these urls
   cause any).
  I would say that a request parameter appended with amp;param=value
  would be seen by the server as amp;param instead of just param.
 
  Cheers,
  Martin
 
  
   chris
  
   Martin Grotzke wrote:
On Mon, 2008-03-17 at 15:24 -0700, Josh Canfield wrote:
   
If I am understanding you correctly, you are getting something like
this in your source:
   
iframe src=http://host/page?arg1=val1arg2=val2;/iframe
   
Nope, unfortunately I get src=http://host/page?arg1=val1arg2=val2;
 
so the  is rendered as amp;
   
Cheers,
Martin
   
   
   
That is actually the correct behavior and it shouldn't be causing a
problem in your browser. Are you seeing a problem?
   
http://htmlhelp.com/tools/validator/problems.html#amp
   
Josh
   
   
On Mon, Mar 17, 2008 at 1:18 PM, Martin Grotzke
[EMAIL PROTECTED] wrote:
   
Hi,
   
I have a an html element (iframe) that get's a property of my page 
class
(the current query string) appended to its src attribute.
   
The query string may contain the  char, which always gets expanded 
as
amp;. Is there any possibility to prevent T5 from encoding this 
char?
   
Thanx  cheers,
Martin
   
   
   
   
   
   
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Re: AW: [T5] How to get ampersand () rendered raw / not encoded as amp;?

2008-03-18 Thread Martin Grotzke
Hi Martin (K.) :)

just to have this complete, the template part was this:

iframe src=http://foo/?foo=bar#38;${queryString};

with queryString beeing a page property...

Cheers,
Martin



On Tue, 2008-03-18 at 18:11 +0100, Martin Kersten wrote:
 Hi Martin,
 
   how is the query string is appended? There is always a difference in 
 writing 
 text and html. If you write text everything gets converted. If you write html 
 (raw)
 everything will work.
 
 Please just post the tml-part in question. Maybe we can give a shorty for it.
 
 
 Cheers,
 
 Martin (Kersten)
 
 
 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Josh Canfield
 Gesendet: Dienstag, 18. März 2008 18:06
 An: Tapestry users
 Betreff: Re: [T5] How to get ampersand () rendered raw / not encoded as 
 amp;?
 
 Hi Martin,
 
 I'm confused by your statement:
  I would say that a request parameter appended with amp;param=value 
  would be seen by the server as amp;param instead of just param.
 
 Does this mean that you are seeing a problem on the server side? What you are 
 describing is not what I would expect, if you are seeing this then there 
 might be something else going on.
 
 Josh
 
 On Tue, Mar 18, 2008 at 7:41 AM, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi,
 
  On Tue, 2008-03-18 at 14:19 +0100, Chris Lewis wrote:
   Martin,
  
   I'm guessing your mail client converted Josh's message because it 
   rendered the  in the url as amp; - just as you have explained and 
   shown.
  Ok, thanx :)
 
As he said, url's with amp; in place of  are actually correct and 
   should not cause problems (I personally have never seen these urls 
   cause any).
  I would say that a request parameter appended with amp;param=value 
  would be seen by the server as amp;param instead of just param.
 
  Cheers,
  Martin
 
  
   chris
  
   Martin Grotzke wrote:
On Mon, 2008-03-17 at 15:24 -0700, Josh Canfield wrote:
   
If I am understanding you correctly, you are getting something 
like this in your source:
   
iframe src=http://host/page?arg1=val1arg2=val2;/iframe
   
Nope, unfortunately I get src=http://host/page?arg1=val1arg2=val2;
 
so the  is rendered as amp;
   
Cheers,
Martin
   
   
   
That is actually the correct behavior and it shouldn't be causing 
a problem in your browser. Are you seeing a problem?
   
http://htmlhelp.com/tools/validator/problems.html#amp
   
Josh
   
   
On Mon, Mar 17, 2008 at 1:18 PM, Martin Grotzke 
[EMAIL PROTECTED] wrote:
   
Hi,
   
I have a an html element (iframe) that get's a property of my 
page class (the current query string) appended to its src attribute.
   
The query string may contain the  char, which always gets 
expanded as amp;. Is there any possibility to prevent T5 from 
encoding this char?
   
Thanx  cheers,
Martin
   
   
   
   
   
   
 
 
 
 
 --
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet 
 delivered fresh to your inbox.
 
 -
 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]
 


signature.asc
Description: This is a digitally signed message part


Re: AW: AW: AW: [T5] How to get ampersand () rendered raw / notencodedas amp;?

2008-03-18 Thread Martin Grotzke
On Tue, 2008-03-18 at 19:42 +0100, Martin Kersten wrote:
 Hi Martin (G.),
 
dude I wasn't aware of it either. Nice to know! Thanks!
Thanx to Filip :)

Cheers,
Martin

 
 
 Cheers,
 
 Martin (Kersten) 
 
 -Ursprüngliche Nachricht-
 Von: Martin Grotzke [mailto:[EMAIL PROTECTED] 
 Gesendet: Dienstag, 18. März 2008 19:39
 An: Tapestry users
 Betreff: Re: AW: AW: [T5] How to get ampersand () rendered raw / 
 notencodedas amp;?
 
 On Tue, 2008-03-18 at 18:53 +0100, Martin Kersten wrote:
  Hi Martin (G.),
  
and to recap it would result into amp; replacements and it would be 
  interpreted by some browsers correctly and some incorrectly?
 Hopefully all browsers would interpret amp; correctly as  when sending the 
 request - as Filip wrote, also referencing 
 http://htmlhelp.com/tools/validator/problems.html#amp
 
 
  So t:outputraw wont help. I see. Any solution (beside providing an 
  iframe component). I would like to see a 'raw:' binding or do I miss 
  something?
 The solution is that amp; is totally fine and simply I was wrong when I 
 thought this would end up with amp; going into the request...
 
 So nothing has to be done or changed or anything :)
 
 Thanx  cheers,
 Martin
 
  
  Cheers,
  
  Martin (Kersten)
  
  
  -Ursprüngliche Nachricht-
  Von: Martin Grotzke [mailto:[EMAIL PROTECTED]
  Gesendet: Dienstag, 18. März 2008 18:37
  An: Tapestry users
  Betreff: Re: AW: [T5] How to get ampersand () rendered raw / not encodedas 
  amp;?
  
  Hi Martin (K.) :)
  
  just to have this complete, the template part was this:
  
  iframe src=http://foo/?foo=bar${queryString};
  
  with queryString beeing a page property...
  
  Cheers,
  Martin
  
  
  
  On Tue, 2008-03-18 at 18:11 +0100, Martin Kersten wrote:
   Hi Martin,
   
 how is the query string is appended? There is always a difference 
   in writing text and html. If you write text everything gets 
   converted. If you write html (raw) everything will work.
   
   Please just post the tml-part in question. Maybe we can give a shorty for 
   it.
   
   
   Cheers,
   
   Martin (Kersten)
   
   
   -Ursprüngliche Nachricht-
   Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im 
   Auftrag von Josh Canfield
   Gesendet: Dienstag, 18. März 2008 18:06
   An: Tapestry users
   Betreff: Re: [T5] How to get ampersand () rendered raw / not encoded as 
   amp;?
   
   Hi Martin,
   
   I'm confused by your statement:
I would say that a request parameter appended with 
amp;param=value would be seen by the server as amp;param instead of 
just param.
   
   Does this mean that you are seeing a problem on the server side? What you 
   are describing is not what I would expect, if you are seeing this then 
   there might be something else going on.
   
   Josh
   
   On Tue, Mar 18, 2008 at 7:41 AM, Martin Grotzke [EMAIL PROTECTED] wrote:
Hi,
   
On Tue, 2008-03-18 at 14:19 +0100, Chris Lewis wrote:
 Martin,

 I'm guessing your mail client converted Josh's message because 
 it rendered the  in the url as amp; - just as you have 
 explained and shown.
Ok, thanx :)
   
  As he said, url's with amp; in place of  are actually correct 
 and should not cause problems (I personally have never seen 
 these urls cause any).
I would say that a request parameter appended with 
amp;param=value would be seen by the server as amp;param instead of 
just param.
   
Cheers,
Martin
   

 chris

 Martin Grotzke wrote:
  On Mon, 2008-03-17 at 15:24 -0700, Josh Canfield wrote:
 
  If I am understanding you correctly, you are getting 
  something like this in your source:
 
  iframe src=http://host/page?arg1=val1arg2=val2;/iframe
 
  Nope, unfortunately I get src=http://host/page?arg1=val1arg2=val2;
   
  so the  is rendered as amp;
 
  Cheers,
  Martin
 
 
 
  That is actually the correct behavior and it shouldn't be 
  causing a problem in your browser. Are you seeing a problem?
 
  http://htmlhelp.com/tools/validator/problems.html#amp
 
  Josh
 
 
  On Mon, Mar 17, 2008 at 1:18 PM, Martin Grotzke 
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I have a an html element (iframe) that get's a property of 
  my page class (the current query string) appended to its src 
  attribute.
 
  The query string may contain the  char, which always gets 
  expanded as amp;. Is there any possibility to prevent T5 from 
  encoding this char?
 
  Thanx  cheers,
  Martin
 
 
 
 
 
 
   
   
   
   
   --
   --
   TheDailyTube.com. Sign up and get the best new videos on the internet 
   delivered fresh to your inbox.
   
   
   - To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED

[T5] How to get ampersand () rendered raw / not encoded as amp;?

2008-03-17 Thread Martin Grotzke
Hi,

I have a an html element (iframe) that get's a property of my page class
(the current query string) appended to its src attribute.

The query string may contain the  char, which always gets expanded as
amp;. Is there any possibility to prevent T5 from encoding this char?

Thanx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5.0.10: DateField on IE

2008-02-26 Thread Martin Grotzke
If you're working on linux, there's the possibility to run IE:
http://www.tatanka.com.br/ies4linux/page/Main_Page

Cheers,
Martin


On Mon, 2008-02-25 at 12:08 -0800, Howard Lewis Ship wrote:
 I've done some work on it in 5.0.11, and tested with Mac Firefox 2 and
 Windows IE 7.  I don't have access to an IE 6 right now (I need to
 setup yet another virtual machine).
 
 On Mon, Feb 25, 2008 at 10:30 AM, Joel Wiegman [EMAIL PROTECTED] wrote:
  Hello all,
 
   Can anyone confirm that the DateField component is broken in IE 6.0
   (possibly 7.0) and T5.0.10?
 
   I'm getting JavaScript errors when the pop-up image is clicked.
 
   Thanks!
 
   Joel
 
 
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Re: T5: Put template in other directory

2008-02-22 Thread Martin Grotzke
Hi,

it should be possible to resolve templates as you want, see
http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html
for example.

Cheers,
Martin


On Fri, 2008-02-22 at 09:23 -0600, Robert Zeigler wrote:
 Page templates can be placed in the context root (or appropriate  
 subfolders, depending on your package structure).
 Component templates are (currently) required to be on the classpath.
 
 Robert
 
 On Feb 22, 2008, at 2/224:24 AM , Joshua Jackson wrote:
 
  Dear all,
 
  Is it possible to place the templates inside other directory other
  than inside the package alongside with the Java class? Somehow this is
  not convenient for our webdesigner so we want to place our templates
  inside another folder just like T4.
 
  Thnx in advance
 
  --
  Let's show the world what we've got.
  Blog: http://joshuajava.wordpress.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]
 


signature.asc
Description: This is a digitally signed message part


Re: T5 template selection based on the current request (e.g. request parameters)

2008-02-07 Thread Martin Grotzke
Yep, you're right. But there are several posts that state that there is
a one-to-one relationship of page class and template (with support for
i18n'ed templates). Having such a simple solution I wonder where these
statements come from and if they are completely wrong.

And the question is, if the mentioned solution works correctly without
side effects, having the full template lifecycle supported (however this
works in detail).

So do you say, that the shown solution is working correctly?

Thanx  cheers,
Martin



On Thu, 2008-02-07 at 01:17 +0100, Renat Zubairov wrote:
 Hello Martin,
 What isn't clear, is what is the question? If it's how to implement it I
 guess the post you've already found describes it good enough.
 
 Renat
 
 On 06/02/2008, Martin Grotzke [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I have a question concerning the relation between template and page
  class, which admittedly has already been raised sometimes :)
 
  Especially, the thread T5: Personalizing page and component template
  (
  http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html
  )
  seems to show a solution for I want to achieve (or, to be honest, my
  collegues need in a project they are starting).
 
  The requirement is to select the chosen page template (or even the
  template of the layout component) at request time based on e.g. some
  request parameters, session attribute or s.th. else. I think common use
  cases are whitelabeling, country specific templates, personalization and
  there are probably a lot more.
 
  I would asume that some of you also have this requirement, so I (and my
  collegues :)) would be happy if you could share your experiences /
  solutions concerning this requirement.
 
  Jeffrey, as you already presented your solution (mentioned above), did
  you experience any drawbacks/problems with this implementation?
 
  Thanx in advance,
  cheers,
  Martin
 
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Re: T5 template selection based on the current request (e.g. request parameters)

2008-02-07 Thread Martin Grotzke
On Thu, 2008-02-07 at 14:26 +0100, Chris Lewis wrote:
 I'm not 100% clear either. A page class has one and only one page 
 template, albeit localizeable. 
What do you think about the mentioned solution
(http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html)?

It's somehow confusing to find a solution that show custom template
selection and to read that A page class has one and only one page...

Thanx for clarification,
cheers,
Martin


 It seems like you'll need to do at least 
 2 things:
 
 1. Use a Layout component specific to the user/page.
 For this you will have your page template wrap itself in a layout 
 component, the exact type of which must be determined at runtime. If I'm 
 not mistaken there is a way to do this using a delegate or placeholder, 
 but you'll need to look at the core docs to be sure.
 
 2. Embed blocks your page component which render the specifics.
 You can render these blocks conditionally using t:if. Granted your 
 page will look a bit cobbled, but that is what requirements like this 
 dictate. I've not heard of any method more elegant than this 
 unfortunately - you can see the same thing in RoR (widgets, etc).
 
 Hope this helps - sorry I couldn't be more specific about the dynamic 
 layout.
 
 chris
 
 Martin Grotzke wrote:
  Yep, you're right. But there are several posts that state that there is
  a one-to-one relationship of page class and template (with support for
  i18n'ed templates). Having such a simple solution I wonder where these
  statements come from and if they are completely wrong.
 
  And the question is, if the mentioned solution works correctly without
  side effects, having the full template lifecycle supported (however this
  works in detail).
 
  So do you say, that the shown solution is working correctly?
 
  Thanx  cheers,
  Martin
 
 
 
  On Thu, 2008-02-07 at 01:17 +0100, Renat Zubairov wrote:

  Hello Martin,
  What isn't clear, is what is the question? If it's how to implement it I
  guess the post you've already found describes it good enough.
 
  Renat
 
  On 06/02/2008, Martin Grotzke [EMAIL PROTECTED] wrote:
  
  Hello,
 
  I have a question concerning the relation between template and page
  class, which admittedly has already been raised sometimes :)
 
  Especially, the thread T5: Personalizing page and component template
  (
  http://www.nabble.com/T5%3A-Personalizing-page-and-component-template-td14098291.html
  )
  seems to show a solution for I want to achieve (or, to be honest, my
  collegues need in a project they are starting).
 
  The requirement is to select the chosen page template (or even the
  template of the layout component) at request time based on e.g. some
  request parameters, session attribute or s.th. else. I think common use
  cases are whitelabeling, country specific templates, personalization and
  there are probably a lot more.
 
  I would asume that some of you also have this requirement, so I (and my
  collegues :)) would be happy if you could share your experiences /
  solutions concerning this requirement.
 
  Jeffrey, as you already presented your solution (mentioned above), did
  you experience any drawbacks/problems with this implementation?
 
  Thanx in advance,
  cheers,
  Martin
 
 
 
 

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


signature.asc
Description: This is a digitally signed message part


Re: T5: Edit page best practice - Mk VI

2008-01-30 Thread Martin Grotzke
On Wed, 2008-01-30 at 21:38 +1100, Geoff Callender wrote:
 * Perhaps what we really need is @Persist(redirection)?!?!?!
+1, this would make things more easy!

Cheers,
Martin


On Wed, 2008-01-30 at 21:38 +1100, Geoff Callender wrote:
 Good point, Davor.  The way I've used flash persistence it could
 just  
 as well have been session persistence. The effect would be identical.
 
 * Perhaps what we really need is @Persist(redirection)?!?!?!
 
 It's a serious suggestion.  After all, what we're aiming for is  
 persistence during a redirection and only during a redirection.  We  
 don't want persistence after arriving from PageLink or browser Reload/ 
 Refresh because it causes anomalies (and that's why Mk VI uses  
 cleanupRender()).  Even better, redirection-persistence could be keyed  
 by a temporary conversation id behind the scenes.
 
 What does everyone think?
 
 * Mk VI might be unacceptable in clustered environments, because it  
 uses server-side persistence, requiring session replication traffic.   
 In that situation I guess the options are either the Mk V solution or  
 some sort of client-side persistence - hidden fields,  
 @Persist(client). or something new.
 
 As for your generic editing, I like it.  It's exactly where I wanted  
 to take this once we have the possible solutions codified.  Perhaps an  
 @EditPage annotation rather than a superclass would be even nicer?
 
 Cheers,
 
 Geoff
 
 On 30/01/2008, at 1:15 AM, Davor Hrg wrote:
 
  cleanupRender is not a fix for flash persistence, it's more like
  replacement for it.
  flash persistence is made for the same reason (only persisting until
  next request)
 
  you can take your example even further and make it generic
  thus allowing actual edit page to be as simple as:
 
  public class EditCompany extends EntityEditPageCompany, Long{
 
 @Override
 protected Object getNextPage() {
 return ListCompany.class;
 }
 
  }
 
 
  the generic edit page I'm working on
  gets entity class like this:
 
 @SuppressWarnings(unchecked)
 public AbstractEntityEdit() {
 Type genericSuperclassType = getClass().getGenericSuperclass();
 if((genericSuperclassType instanceof ParameterizedType)){
 ParameterizedType genericSuperclass = (ParameterizedType)
  genericSuperclassType;
 if(genericSuperclass.getActualTypeArguments()[0]  
  instanceof Class){
 this.persistentClass = (ClassT)
  genericSuperclass.getActualTypeArguments()[0];
 this.idClass = (ClassT_ID)
  genericSuperclass.getActualTypeArguments()[1];
 }
 }
 }
 
  uses Session to load entity when needed,
  persists only entityId as string
  uses TypeCoercer to convert string to idClass before calling  
  session.get()
 
  resets the form if cancel button is pressed or entityId changes
 
  Davor Hrg
 
 
  On Jan 29, 2008 2:48 PM, Geoff Callender
  [EMAIL PROTECTED] wrote:
  Thanks for all the comments.  They've been invaluable.  Below is the
  result, Mark Vi.
 
  Kalle, I'm using T5.0.9, but I think 5.0.7 would behave similarly.
  Yes, I'm trying frantically to keep up with the releases!
 
  As Davor pointed out, if validation has failed then getting the  
  entity
  again doesn't overwrite the form in recent releases.  I believe,
  however, that this only works if you keep everything that can fail in
  the onValidate... methods, eg. changePerson is called in
  onValidateFromForm instead of in onSuccess for this very reason.
 
  As Martin pointed out, I can avoid getting the entity every time in
  onActivate if I use @Persist(flash), test for null entity in
  onActivate, and nullify flash fields in cleanupRender, ie. right
  before the page is displayed.   The reason for the last bit is that
  sometimes there's only one onActivate before a page is displayed, so
  an attempt to refresh the page won't work because the entity is still
  in flash-persistence. A second attempt would work, which is very
  disconcerting.
 
  Davor, I like Martin's cleanupRender effect, so I don't think the  
  new
  window problems you describe occur, and therefore I don't think I
  need the @Meta form annotation.  Have I missed a corner-case here?
 
  If you're using BeanEditForm, just replace Form with  
  BeanEditForm.
 
 private Long _personId;
 
 @Persist(flash)
 private Person _person;
 
 @Component(id = form)
 private Form _form;
 
 @InjectPage
 private NextPage _nextPage;
 
 void onActivate(Long id) throws Exception {
 _personId = id;
 if (_person == null) {
 _person =  
  getPersonService().findPerson(_personId);
 }
 }
 
 Long onPassivate() {
 return _personId;
 }
 
 void onValidateFromForm() {
 if (...a bit of validation logic detects an  
  error...) {
 _form.recordError(...);

Re: T5: Edit page best practice - Mk III - now Mk V

2008-01-28 Thread Martin Grotzke
() {
 _form.clearErrors();
  }
 
  Cheers,
 
  Geoff
 
  On 12/12/2007, at 4:53 AM, jeffrey ai wrote:
 
 
  Geoff, I think your code is great for **ONE** edit-page.
  Our project is looking for a web flow from T5, like the Spring one.
  Do you have any idea about it?
  Howard mentioned he may add this feature in the next release.
  Might be a little late to us, but I am expecting to see it.
 
  Cheers,
  Jeffrey Ai
 
 
  Geoff Callender-2 wrote:
 
  Hi,
 
  In search of best practice for an edit page, here's my 3rd  
  attempt.
  It's looking pretty clean-cut to me, but I'm looking for suggestions
  on how to improve it further.
 
private Long _personId;

@Persist(client)
// Persistence is needed here because this is a detached Entity
  Bean.  When we call the service to
// accept our changes, it will need its id and version fields  
  intact
  to be able to do optimistic
// locking check and a successful merge. client is used so that
  even if you use the Back button
// to get to this page, we will have the right Person object.
private Person _person;

void onActivate(Long id) throws Exception { _personId = id; }
 
Long onPassivate() { return _person.getId(); }
 
void setupRender() throws Exception {
if (!_form.getHasErrors()) {
_person = getPersonService().findPerson(_personId);
}
}
 
void onValidate() throws Exception {
if (...a bit of validation logic detects an error...) {
_form.recordError(...);
}
}

Object onSuccess() {
try {
getPersonService().changePerson(_person);
_nextPage.onActivate(_personId);
return _nextPage;
}
catch (Exception e) {
_form.recordError(ExceptionUtil.getRootCause(e));
return null;
}
}
 
void cleanupRender() {
   _form.clearErrors();
}

  Some notes:
 
  1. Detached object - Person is a detached entity.  I am deliberately
  avoiding refreshing it every time in setupRender() because a) it  
  would
  overwrite the user's changes, and b) it would defeat optimistic
  locking: if someone else has changed the object then I DO want
  getPersonService().changePerson(_person) to reject the transaction
  when Save is pressed.
 
  2. Thread-safety - I'm using client persistence to avoid the whole
  thread-safety issue caused by the user opening a new window or  
  tabs in
  same browser (T5 can't tell them apart so they share the same
  HttpSession).
 
  3. onPrepareFromForm() - I'm avoiding it because it gets called too
  often (something to do with rewind?).  setupRender() seems better
  for the job.  Any downside t this?
 
  4. cleanupRender() - if/when 5.0.7 uses flash persistence on the
  form's ValidationTracker then I'll ditch this method.
 
  Suggestions please!
 
  Thanks,
 
  Geoff
 
 
 
 
  -- 
  View this message in context: 
  http://www.nabble.com/T5%3A-Edit-page-best-practice---Mk-III-tp14249141p14279495.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]
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


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



Re: T5 Encoding issue (repost)

2008-01-28 Thread Martin Grotzke
On Mon, 2008-01-28 at 18:54 +0100, Francois Armand wrote:
 I spoke to fast : it seems that in T5.0.9, even slashes are handled 
 correctly with utf-8 filter activated.
This would be really great - then we should take the effort and upgrade...

Good luck to you,
cheers,
Martin


On Mon, 2008-01-28 at 18:54 +0100, Francois Armand wrote:
 Francois Armand wrote:
  Are you sure this issue is solved in the latest version of T5? So that
  you can even have slashes in your activation parameters?

  Well, you are right : slashes are not supported. But spaces, +, 
  accented  letters are well encoded/decoded
 
 
 I spoke to fast : it seems that in T5.0.9, even slashes are handled 
 correctly with utf-8 filter activated.
 
 My test (I hope it's relevant) :
 * I create a page link with a context comporting all these nasty chars, 
 and a click to it write the good output.
 * I wrote directly in the URL all these char but /, the output is what 
 expected.
 
 All in all,  I can't  switch to this version, there is far too others 
 behavior modification between the two :/
 


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



Re: T5 Encoding issue (repost)

2008-01-28 Thread Martin Grotzke
Hi Francois,

we're currently living with a really ugly hack: we use a patched version
of TapestryInternalUtils, with the methods urlEncode and urlDecode
changed [1].

For us this is still an issue we want to investigate, I believe this is
an issue in combination with mod_jk. But my memory is really bad, so I
will have to start again investigating.

Are you sure this issue is solved in the latest version of T5? So that
you can even have slashes in your activation parameters?

Cheers,
Martin


[1] 

private static final String SLASH_REPLACEMENT_CHAR =  + 127;
private static final String SLASH_REPLACEMENT_CHAR_ENC =
UrlUtf8Encoder.encode(SLASH_REPLACEMENT_CHAR);

public static String urlEncode(String input) {
try {
String res = CODEC.encode(url);
if (StringUtils.isNotEmpty(res)) {
res = res.replace(+, %20);
res = res.replace(%2F, SLASH_REPLACEMENT_CHAR_ENC);
}
return res;
} catch (EncoderException e) {
LOG.error(Could not encode URL: + url, e);
return url;
}
}

public static String urlDecode(String input) {
// only decode slashes
String decoded = input.replace(SLASH_REPLACEMENT_CHAR, /);
return decoded;
}




On Mon, 2008-01-28 at 17:19 +0100, Francois Armand wrote:
 Martin Grotzke wrote:
  Hi,

 
 Hi Martin,
 
  I just want to pickup this topic in a new thread, to make sure
  it's noticed - thx to Uli's suggestion in the previous thread :)
 
  At first a short summary again:
  - T5 (the PageRenderDispatcher) tries to decode activation context
arguments (in convertActivationContext).
  [...]
  Our encoding is UTF-8 btw.
 
  My question is: why does PageRenderDispatcher.convertActivationContext
  try to decode the already decoded string again? I asume there's *some*
  reason for this ;)

 Sorry to resurrect this old post, but I encounter the very same bug. I 
 know it is corrected in recent version of T5 (after 5.0.8, I believe) 
 but for now, I'm stuck with 5.0.6.
 
 So, to bypass it, I contribute to master dispatcher a 
 PageRenderDispatcher without the double decoding, but now it seems to be 
 worst :
 - it almost work but  sometimes (I think it's when I call 
 ComponentResources#createPageLink or similar methods), spaces are 
 encoded with +, but the + are not decoded. So, returned link are not 
 understood by Tapestry, but if a replace + by %20 or  , everything 
 works.
 - changing the order of utf8filter (with after:* or before:* in 
 configuration) doesn't seem to do anything
 
 
 I believe I forgot to switch a configuration to UTF-8,  somewhere.  But 
 I don't know where :/
 
 So, Martin, have you find a way to have it to work ? Have you any idea ?
 
 It's a really important bug for us :/
 
 Thanks,
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


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



Re: t:type=loop problem

2007-09-17 Thread Martin Grotzke
On Mon, 2007-09-17 at 10:23 +0900, Nick Westgate wrote:
 It's mentioned somewhere (maybe in the source) that expansions are
 treated as literals, and therefore cached and never re-evaluated.
I'd think this is fixed with
https://issues.apache.org/jira/browse/TAPESTRY-1667, isn't it?

Cheers,
Martin


 
 The result is quite non-intuitive in a loop, which has irked me for
 some time, and I'm beginning to consider it a bug. It's also one
 reason I still value the Any component.
 
 I'll log a JIRA.
 
 Cheers,
 Nick.
 
 
 Michael Gottschalk wrote:
  Hi Leon,
  
  On Sunday 16 September 2007 18:41:07 Leon Derks wrote:
  I have a problem with the t:type=loop component in my Menu Component
 
  [...]
  Every categoryId is 1. (and it generates to much ul tags).
  [...]
  This is what is in Menu.html
 
  ul t:type=loop source=categories value=category
 li
t:actionlink t:id=category
  context=${category.id}${category.name} | ${category.id}/t:actionlink
  /li
  /ul
  
  it will work if you don't use the expansion in the actionLink context 
  parameter:
  t:actionlink t:id=category context=category.id
  
  Never use the ${}-notation when giving parameters to a component. I don't 
  know 
  why, but it will not work as expected.
  
  Regards,
  Michael
  
  -
  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]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: [T5]Encoding Problem while submiting form with a Upload component.

2007-08-28 Thread Martin Grotzke
On Tue, 2007-08-28 at 12:22 +0200, Christian Koeberl wrote:
  I have a form with a 'textfield' and a 'upload' field .
  The Chinese words I input in textfield will be irrecognizable  when I 
  submit the form .
 
 I wondered, why nobody found this bug before. Anyway, I filed the
 bug yesterday and provided a fix.
 
 https://issues.apache.org/jira/browse/TAPESTRY-1723
 
 You can easyily apply the fix and generate your own tapestry-upload jar
 or wait until one of the committers applies the patch.
Thanx a lot, we also ran into this issue!

Cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: [T5] Select, palette, multiselect

2007-07-30 Thread Martin Grotzke
On Fri, 2007-07-27 at 17:37 -0300, Thiago H de Paula Figueiredo wrote:
 And has anyone implemented a Select-like component for multiple option  
 selection? It would be very nice to have both multiselect and palette, as  
 T4 has.
Take a look at this thread, it's really easy to implement multiselect
with T5:
http://www.nabble.com/T5%3A-select-component-with-support-for-attribute-%22multiple%22-tf3880056.html#a10996038

Cheers,
Martin


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



signature.asc
Description: This is a digitally signed message part


Re: [T5] Eclipse WTP - conflict between class reloading and context reloading

2007-07-30 Thread Martin Grotzke
Hi,

you should set up your environment as it's described in the tutorial
(http://tapestry.apache.org/tapestry5/tutorial1/env.html).

AFAIK T5 class reloading does work with jetty 5 + jetty launcher only.

Cheers,
Martin


On Mon, 2007-07-30 at 11:42 -0700, entelechon wrote:
 I am using Eclipse WTP and Tomcat 5.5 to develop with Tapestry 5. Changes to
 page classes are supposedly picked up by Tapestry, via an inspection of the
 class path. 
 
 Now, when I change a page class, Tomcat notices the changed file and reloads
 the whole context - effectively resetting the application state and taking
 ages to re-initialize everything.
 
 I can change the context to be non-reloadable (in server.xml, specifying
 reloadable=false). However, then nothing happens: Neither does Tomcat
 reload the context (expected), nor does Tapestry load the changed page class
 (unexpected).
 
 Any help?
 
 Thanks,
Markus



signature.asc
Description: This is a digitally signed message part


Re: T5 component parameter binding not updated

2007-07-25 Thread Martin Grotzke
On Wed, 2007-07-25 at 09:09 -0700, Howard Lewis Ship wrote:
 https://issues.apache.org/jira/browse/TAPESTRY-1667
 
 And, yes, it's a bug.  Expansions were treated as invariant when they are,
 in fact, variant.
Wow, very fast in fixing this!

Respect :)
cheers,
Martin


 
 On 7/25/07, Howard Lewis Ship [EMAIL PROTECTED] wrote:
 
  You've bound the parameter _currentPage to the value obtained from
  ${currentPage}.
 
  Expansions are always read-only.  prop:currentPage is read/write, but
  ${currentPage} is read-only.
 
  The instance variable in the component is always reading or updating the
  binding.  So if you update _currentPage its going to try to update the
  binding to match the new value; for ${currentPage} this fails (as it is a
  read-only binding).
 
  There may be a bug here, however.  It looks like Tapestry may be overly
  aggressive in terms of caching the value of ${currentPage}, as if it were a
  literal value and not a dynamic expression.  Again, prop:currentPage will do
  the right thing.
 
 
  On 7/20/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  
   Anybody out there?
  
   What should I check for analysing this issue?
  
   Thanx  cheers,
   Martin
  
  
   On Fri, 2007-07-13 at 18:17 +0200, Martin Grotzke wrote:
I suppose that what I'm expecting is not the way it should work.
   
Can I do anything to see what's the reason for this?
   
Any help appreciated,
thx,
Martin
   
   
On Thu, 2007-07-12 at 09:43 +0200, Martin Grotzke wrote:
 On Thu, 2007-07-12 at 08:45 +0200, Kristian Marinkovic wrote:
 
  hi martin,
 
  try to set the cache attribute of your  @Parameter
  annotation of your currentPage component parameter
  to false
 I tried that, but it didn't solve the issue - same behavior.
   Debugging
 showed that _$currentPage_cached is still true...


 Then I tried to reset the currentPage property manually and added

 _currentPage = 0;

 to the start of the beginRender method, which produced the following
  
 error:

 Failure writing parameter currentPage of component Search:pager:
   Binding

   [EMAIL PROTECTED]
 is read-only.

 Is there another way of resetting a parameter binding?

 How is it intended to work, when is a cached parameter reset?

 Thanx  cheers,
 Martin


 
 
  @Parameter(cache=false,...)
 
  g,
  kris
 
 
 
  Martin Grotzke
  [EMAIL PROTECTED]
 
  11.07.2007 22:20
  Bitte antworten an
   Tapestry users
  users@tapestry.apache.org
 
 
 
 
 An
  Tapestry users
  users@tapestry.apache.org
  Kopie
 
  Thema
  T5 component
  parameter binding
  not updated
 
 
 
 
 
 
 
 
  Hi,
 
  I wrote a simple pager component but one parameter (currentPage)
  is not updated in a second request.
 
  In the template I have the following:
 
 t:pager t:numberOfPages=${numberOfPages}
 t:currentPage=${currentPage}
 ... some other attributes ... /
 
  In the page class this currentPage accessor:
 
 public int getCurrentPage() {
 return _currentPage;
 }
 
  which is an int and has the correct values in all requests.
 
  The pager component contains this currentPage property
 
 @Parameter(required = true, defaultPrefix=prop)
 private Integer _currentPage;
 
  which is used in
 
 @BeginRender
 boolean beginRender( MarkupWriter writer )
 
  which returns false (no other render methods, no template).
 
  When I debug the code I see, that the first time, the _currentPage
   is
  accessed, the pages getCurrentPage method is invoked.
  In all subsequent page requests, the value of the first request is
  still stored and not updated.
 
  What am I doing wrong, or should T5 behave differently?
 
  Do I have to take any action to unbind/uncache/reset the
   currentPage
  property in the pager component?
 
  Thanx  cheers,
  Martin
 
 
 
 
   -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
   --
   Martin Grotzke
   http://www.javakaffee.de/blog/
  
  
 
 
  --
  Howard M. Lewis Ship
  TWD Consulting, Inc.
  Independent J2EE / Open-Source Java Consultant
  Creator and PMC Chair, Apache Tapestry
  Creator, Apache HiveMind
 
  Professional Tapestry training, mentoring, support
  and project work.   http://howardlewisship.com
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 component parameter binding not updated

2007-07-25 Thread Martin Grotzke
Hi Howard,

thanx a lot for this explanation, again I learned s.th. about T5 :)

Indeed, prop:currentPage works, unfortunately my eyes were blind
these days to tell me that there's the ${expansions} stuff - or my
brain didn't tell my eyes that this is s.th. special ;)

Thanx a lot,
cheers,
Martin


On Wed, 2007-07-25 at 09:00 -0700, Howard Lewis Ship wrote:
 You've bound the parameter _currentPage to the value obtained from
 ${currentPage}.
 
 Expansions are always read-only.  prop:currentPage is read/write, but
 ${currentPage} is read-only.
 
 The instance variable in the component is always reading or updating the
 binding.  So if you update _currentPage its going to try to update the
 binding to match the new value; for ${currentPage} this fails (as it is a
 read-only binding).
 
 There may be a bug here, however.  It looks like Tapestry may be overly
 aggressive in terms of caching the value of ${currentPage}, as if it were a
 literal value and not a dynamic expression.  Again, prop:currentPage will do
 the right thing.
 
 
 On 7/20/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 
  Anybody out there?
 
  What should I check for analysing this issue?
 
  Thanx  cheers,
  Martin
 
 
  On Fri, 2007-07-13 at 18:17 +0200, Martin Grotzke wrote:
   I suppose that what I'm expecting is not the way it should work.
  
   Can I do anything to see what's the reason for this?
  
   Any help appreciated,
   thx,
   Martin
  
  
   On Thu, 2007-07-12 at 09:43 +0200, Martin Grotzke wrote:
On Thu, 2007-07-12 at 08:45 +0200, Kristian Marinkovic wrote:

 hi martin,

 try to set the cache attribute of your  @Parameter
 annotation of your currentPage component parameter
 to false
I tried that, but it didn't solve the issue - same behavior. Debugging
showed that _$currentPage_cached is still true...
   
   
Then I tried to reset the currentPage property manually and added
   
_currentPage = 0;
   
to the start of the beginRender method, which produced the following
error:
   
Failure writing parameter currentPage of component Search:pager:
  Binding
[EMAIL PROTECTED]
is read-only.
   
Is there another way of resetting a parameter binding?
   
How is it intended to work, when is a cached parameter reset?
   
Thanx  cheers,
Martin
   
   


 @Parameter(cache=false,...)

 g,
 kris



 Martin Grotzke
 [EMAIL PROTECTED]

 11.07.2007 22:20
 Bitte antworten an
  Tapestry users
 users@tapestry.apache.org




An
 Tapestry users
 users@tapestry.apache.org
 Kopie

 Thema
 T5 component
 parameter binding
 not updated








 Hi,

 I wrote a simple pager component but one parameter (currentPage)
 is not updated in a second request.

 In the template I have the following:

t:pager t:numberOfPages=${numberOfPages}
t:currentPage=${currentPage}
... some other attributes ... /

 In the page class this currentPage accessor:

public int getCurrentPage() {
return _currentPage;
}

 which is an int and has the correct values in all requests.

 The pager component contains this currentPage property

@Parameter(required = true, defaultPrefix=prop)
private Integer _currentPage;

 which is used in

@BeginRender
boolean beginRender( MarkupWriter writer )

 which returns false (no other render methods, no template).

 When I debug the code I see, that the first time, the _currentPage
  is
 accessed, the pages getCurrentPage method is invoked.
 In all subsequent page requests, the value of the first request is
 still stored and not updated.

 What am I doing wrong, or should T5 behave differently?

 Do I have to take any action to unbind/uncache/reset the currentPage
 property in the pager component?

 Thanx  cheers,
 Martin




  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
  --
  Martin Grotzke
  http://www.javakaffee.de/blog/
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5 component parameter binding not updated

2007-07-13 Thread Martin Grotzke
I suppose that what I'm expecting is not the way it should work.

Can I do anything to see what's the reason for this?

Any help appreciated,
thx,
Martin


On Thu, 2007-07-12 at 09:43 +0200, Martin Grotzke wrote:
 On Thu, 2007-07-12 at 08:45 +0200, Kristian Marinkovic wrote:
  
  hi martin, 
  
  try to set the cache attribute of your  @Parameter  
  annotation of your currentPage component parameter  
  to false 
 I tried that, but it didn't solve the issue - same behavior. Debugging
 showed that _$currentPage_cached is still true...
 
 
 Then I tried to reset the currentPage property manually and added
 
 _currentPage = 0;
 
 to the start of the beginRender method, which produced the following
 error:
 
 Failure writing parameter currentPage of component Search:pager: Binding
 [EMAIL PROTECTED]
 is read-only.
 
 Is there another way of resetting a parameter binding?
 
 How is it intended to work, when is a cached parameter reset?
 
 Thanx  cheers,
 Martin
 
 
  
  
  @Parameter(cache=false,...) 
  
  g, 
  kris
  
  
  
  Martin Grotzke
  [EMAIL PROTECTED] 
  
  11.07.2007 22:20 
  Bitte antworten an
   Tapestry users
  users@tapestry.apache.org
  
  
  
  
 An
  Tapestry users
  users@tapestry.apache.org 
  Kopie
  
  Thema
  T5 component
  parameter binding
  not updated
  
  
  
  
  
  
  
  
  Hi,
  
  I wrote a simple pager component but one parameter (currentPage)
  is not updated in a second request.
  
  In the template I have the following:
  
 t:pager t:numberOfPages=${numberOfPages}
 t:currentPage=${currentPage}
 ... some other attributes ... /
  
  In the page class this currentPage accessor:
  
 public int getCurrentPage() {
 return _currentPage;
 }
  
  which is an int and has the correct values in all requests.
  
  The pager component contains this currentPage property
  
 @Parameter(required = true, defaultPrefix=prop)
 private Integer _currentPage;
  
  which is used in 
  
 @BeginRender
 boolean beginRender( MarkupWriter writer )
  
  which returns false (no other render methods, no template).
  
  When I debug the code I see, that the first time, the _currentPage is
  accessed, the pages getCurrentPage method is invoked.
  In all subsequent page requests, the value of the first request is
  still stored and not updated.
  
  What am I doing wrong, or should T5 behave differently?
  
  Do I have to take any action to unbind/uncache/reset the currentPage
  property in the pager component?
  
  Thanx  cheers,
  Martin
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5 component parameter binding not updated

2007-07-12 Thread Martin Grotzke
On Thu, 2007-07-12 at 08:45 +0200, Kristian Marinkovic wrote:
 
 hi martin, 
 
 try to set the cache attribute of your  @Parameter  
 annotation of your currentPage component parameter  
 to false 
I tried that, but it didn't solve the issue - same behavior. Debugging
showed that _$currentPage_cached is still true...


Then I tried to reset the currentPage property manually and added

_currentPage = 0;

to the start of the beginRender method, which produced the following
error:

Failure writing parameter currentPage of component Search:pager: Binding
[EMAIL PROTECTED]
is read-only.

Is there another way of resetting a parameter binding?

How is it intended to work, when is a cached parameter reset?

Thanx  cheers,
Martin


 
 
 @Parameter(cache=false,...) 
 
 g, 
 kris
 
 
 
 Martin Grotzke
 [EMAIL PROTECTED] 
 
 11.07.2007 22:20 
 Bitte antworten an
  Tapestry users
 users@tapestry.apache.org
 
 
 
 
An
 Tapestry users
 users@tapestry.apache.org 
 Kopie
 
 Thema
 T5 component
 parameter binding
 not updated
 
 
 
 
 
 
 
 
 Hi,
 
 I wrote a simple pager component but one parameter (currentPage)
 is not updated in a second request.
 
 In the template I have the following:
 
t:pager t:numberOfPages=${numberOfPages}
t:currentPage=${currentPage}
... some other attributes ... /
 
 In the page class this currentPage accessor:
 
public int getCurrentPage() {
return _currentPage;
}
 
 which is an int and has the correct values in all requests.
 
 The pager component contains this currentPage property
 
@Parameter(required = true, defaultPrefix=prop)
private Integer _currentPage;
 
 which is used in 
 
@BeginRender
boolean beginRender( MarkupWriter writer )
 
 which returns false (no other render methods, no template).
 
 When I debug the code I see, that the first time, the _currentPage is
 accessed, the pages getCurrentPage method is invoked.
 In all subsequent page requests, the value of the first request is
 still stored and not updated.
 
 What am I doing wrong, or should T5 behave differently?
 
 Do I have to take any action to unbind/uncache/reset the currentPage
 property in the pager component?
 
 Thanx  cheers,
 Martin
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5: NPE in Base64InputStream and locked/waitingCheckForUpdatesFilter

2007-07-11 Thread Martin Grotzke
Ben, thanx a lot for this info!

We were running our app under jdk 6u1 and tapestry 5.0.5, so it's
matching perfectly.

I just installed jdk 6u2 on our test-system and started our app
with this - so we'll see if it happens again.

I'll give a feedback after say 5 days when our app is fine, or of course
if this problem occurs again.

Btw: it's very amazing communicating on this list, as there's so much
useful and fast feedback - really great!!

Thanx for now,
cheers,
Martin



On Tue, 2007-07-10 at 19:52 -1000, Ben Sommerville wrote:
 If you are running under jdk 6u1 and tapestry 5.0.5 (or greater) then
 there is
 a jvm bug that can cause a deadlock.
 
 The bug report is at
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6571733.  
 It is supposed to be fixed in jdk 6u2 (which was release recently) but I 
 haven't had a chance to test it yet.
 
 cheers
 Ben
 
  -Original Message-
  From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
  Sent: Wednesday, 11 July 2007 9:06 AM
  To: Tapestry users
  Subject: Re: T5: NPE in Base64InputStream and 
  locked/waitingCheckForUpdatesFilter
  
  The NPE seems to be caused by a missing t:formdata request parameter.
  
  I just reproduced this (weird) situation by removing the hidden form
  field t:formdata with firebug, so that I could produce the NPE.
  
  Although, following request went through well, and the number 
  of request
  processing threads did not increase.
  
  So there seems to be no (direct) interrelationship between the NPE
  and the locked threads.
  
  Cheers,
  Martin
  
  
  
  On Tue, 2007-07-10 at 23:43 +0200, Martin Grotzke wrote:
   Hi,
   
   we had an issue with our deployed application that did not respond
   anymore. This happened two or three times in the last 4 days, but
   I was not able to reproduce it until now.
   
   The analysis of the logs showed, that there was a NPE in
   Base64InputStream, and afterwards the application did not respond
   anymore.
   
   When I triggered a thread dump, all 200 tomcat threads were 
  in status
   WAITING, like this one:
   
   http-9090-1 daemon prio=10 tid=0x2aaaf7e1fc00 
  nid=0x3f05 waiting on condition 
  [0x4459e000..0x4459fbc0]
  java.lang.Thread.State: WAITING (parking)
   at sun.misc.Unsafe.park(Native Method)
   - parking to wait for  0x2aaab8228360 (a 
  java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
   at 
  java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
   at 
  java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndC
  heckInterrupt(AbstractQueuedSynchronizer.java:712)
   at 
  java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquir
  eShared(AbstractQueuedSynchronizer.java:842)
   at 
  java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireS
  hared(AbstractQueuedSynchronizer.java:1162)
   at 
  java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.loc
 k(ReentrantReadWriteLock.java:594)
   at 
  org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRe
  ad(ConcurrentBarrier.java:70)
   at 
  org.apache.tapestry.internal.services.CheckForUpdatesFilter.se
  rvice(CheckForUpdatesFilter.java:110)
   at 
  $RequestHandler_1139c29ae4a.service($RequestHandler_1139c29ae4a.java)
   at 
  $RequestHandler_1139c29ae41.service($RequestHandler_1139c29ae41.java)
   at 
  org.apache.tapestry.services.TapestryModule$11.service(Tapestr
 yModule.java:1044)
   at 
  $HttpServletRequestHandler_1139c29ae40.service($HttpServletReq
 uestHandler_1139c29ae40.java)
   at 
  org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:135)
   at 
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
  er(ApplicationFilterChain.java:235)
   at 
  org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
  cationFilterChain.java:206)
   at 
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
  rapperValve.java:230)
   at 
  org.apache.catalina.core.StandardContextValve.invoke(StandardC
  ontextValve.java:175)
   at 
  org.apache.catalina.core.StandardHostValve.invoke(StandardHost
  Valve.java:128)
   at 
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
  Valve.java:104)
   at 
  org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
  gineValve.java:109)
   at 
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdap
  ter.java:261)
   at 
  org.apache.coyote.http11.Http11Processor.process(Http11Process
  or.java:844)
   at 
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
 r.process(Http11Protocol.java:581)
   at 
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.
 java:447)
   at java.lang.Thread.run(Thread.java:619)
   
   I'm not sure if the NPE that happened before is the reason 
  for this, as I don't
   see

Re: tutorial not working with jetty plugin.

2007-07-11 Thread Martin Grotzke
Hi,

I don't remember if it was this error that we also encountered,
but if you are running eclipse/jetty launcher with jdk6, then
you need to replace the jettyplugin.jar by a patched version.

Cheers,
Martin


On Wed, 2007-07-11 at 19:18 +0800, John Lee wrote:
 Dear list,
 
 I followed the tutorial to work on the BeanEditForm, the web work perfectly 
 with
 mvn jetty:run, but it doesn't work inside eclipse.  I followed the tutorial 
 to create
 the jetty web.  I got No root element has been defined error when I click 
 on the
 Create new address page link.  Does anyone know what went wrong?
 
 Thanks
 John 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: tutorial not working with jetty plugin.

2007-07-11 Thread Martin Grotzke
You might search in the list archives for jettylauncher.jar (to find
e.g. the thread
http://www.nabble.com/Tapestry-5-and-Template-Reloading-t3671362.html)
or have a look at this posting:
http://papercut.biz/blog/matt/2005/02/17/gotta-love-open-source-i-fixed-it-myself/

Additionally you should have followed the installation description of
Howards tutorial (to run jettylauncher with jetty 5).

Cheers,
Martin


On Wed, 2007-07-11 at 16:46 +0300, Peter Stavrinides wrote:
 Are you saying that you can get it to work with JDK 6, thought this 
 wasn't possible?? Is there any way I can find out more about this... 
 this is really important for my organization.
 
 thanks in advance!
 Peter
 
 Thanks in advance
 peter
 
 Martin Grotzke wrote:
  Hi,
 
  I don't remember if it was this error that we also encountered,
  but if you are running eclipse/jetty launcher with jdk6, then
  you need to replace the jettyplugin.jar by a patched version.
 
  Cheers,
  Martin
 
 
  On Wed, 2007-07-11 at 19:18 +0800, John Lee wrote:

  Dear list,
 
  I followed the tutorial to work on the BeanEditForm, the web work 
  perfectly 
  with
  mvn jetty:run, but it doesn't work inside eclipse.  I followed the 
  tutorial 
  to create
  the jetty web.  I got No root element has been defined error when I 
  click 
  on the
  Create new address page link.  Does anyone know what went wrong?
 
  Thanks
  John 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
  
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


T5 component parameter binding not updated

2007-07-11 Thread Martin Grotzke
Hi,

I wrote a simple pager component but one parameter (currentPage)
is not updated in a second request.

In the template I have the following:

t:pager t:numberOfPages=${numberOfPages}
t:currentPage=${currentPage}
... some other attributes ... /

In the page class this currentPage accessor:

public int getCurrentPage() {
return _currentPage;
}

which is an int and has the correct values in all requests.

The pager component contains this currentPage property

@Parameter(required = true, defaultPrefix=prop)
private Integer _currentPage;

which is used in 

@BeginRender
boolean beginRender( MarkupWriter writer )

which returns false (no other render methods, no template).

When I debug the code I see, that the first time, the _currentPage is
accessed, the pages getCurrentPage method is invoked.
In all subsequent page requests, the value of the first request is
still stored and not updated.

What am I doing wrong, or should T5 behave differently?

Do I have to take any action to unbind/uncache/reset the currentPage
property in the pager component?

Thanx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


T5: NPE in Base64InputStream and locked/waiting CheckForUpdatesFilter

2007-07-10 Thread Martin Grotzke
Hi,

we had an issue with our deployed application that did not respond
anymore. This happened two or three times in the last 4 days, but
I was not able to reproduce it until now.

The analysis of the logs showed, that there was a NPE in
Base64InputStream, and afterwards the application did not respond
anymore.

When I triggered a thread dump, all 200 tomcat threads were in status
WAITING, like this one:

http-9090-1 daemon prio=10 tid=0x2aaaf7e1fc00 nid=0x3f05 waiting on 
condition [0x4459e000..0x4459fbc0]
   java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  0x2aaab8228360 (a 
java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:712)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:842)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1162)
at 
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:594)
at 
org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:70)
at 
org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:110)
at $RequestHandler_1139c29ae4a.service($RequestHandler_1139c29ae4a.java)
at $RequestHandler_1139c29ae41.service($RequestHandler_1139c29ae41.java)
at 
org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java:1044)
at 
$HttpServletRequestHandler_1139c29ae40.service($HttpServletRequestHandler_1139c29ae40.java)
at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:135)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

I'm not sure if the NPE that happened before is the reason for this, as I don't
see the relationship between both issues (apart from the correlation of 
events/time).

Hopefully someone closer to the code can have a look at this and tell what's the
problem here? Then I'd like to submit a bug report / help fixing(?)...

More output of the logs you find at the end of this email.

Thanx a lot in advance,
cheers,
Martin



[INFO ] 2007-07-09 11:56:35,513 TP-Processor1 
org.comp.proj.search.presentation.pages.Search.onActivate:
Got invoked args hose, cat:Herrenbekleidung, n, 100

[INFO ] 2007-07-09 11:56:35,518 TP-Processor1 
org.comp.proj.search.presentation.pages.Search.setupRender:
Starting search...

[DEBUG] 2007-07-09 11:56:35,520 TP-Processor1 
org.comp.proj.search.business.SearchServiceSolrImpl.search:
Starting query:
q=hose;score+descfq=cat:Herrenbekleidungstart=0rows=100facet=truefacet.field=catfacet.field=brandfacet.field=typefacet.field=colorfacet
.field=pricefacet.limit=5facet.zeros=falsefacet.missing=falseversion=2.2

[DEBUG] 2007-07-09 11:56:35,610 TP-Processor1 
org.comp.proj.search.business.SearchServiceSolrImpl.logResponse:
Got response: numFound: 207, queryTime: 43

[INFO ] 2007-07-09 11:56:35,803 TP-Processor1 
org.comp.proj.search.presentation.services.AppModule.TimingFilter.service:
Request time: 292 ms

[INFO ] 2007-07-09 11:57:05,982 TP-Processor5 
org.comp.proj.search.presentation.pages.Search.onActivate:
Got invoked args hose, n, 100

[INFO ] 2007-07-09 11:57:05,988 TP-Processor5 
org.comp.proj.search.presentation.pages.Search.setupRender:
Starting search...

[DEBUG] 2007-07-09 11:57:05,989 TP-Processor5 
org.comp.proj.search.business.SearchServiceSolrImpl.search:
Starting query:
q=hose;score+descstart=0rows=100facet=truefacet.field=catfacet.field=brandfacet.field=typefacet.field=colorfacet.field=pricefacet.limit
=5facet.zeros=falsefacet.missing=falseversion=2.2

[DEBUG] 2007-07-09 11:57:06,078 

Re: T5: NPE in Base64InputStream and locked/waiting CheckForUpdatesFilter

2007-07-10 Thread Martin Grotzke
The NPE seems to be caused by a missing t:formdata request parameter.

I just reproduced this (weird) situation by removing the hidden form
field t:formdata with firebug, so that I could produce the NPE.

Although, following request went through well, and the number of request
processing threads did not increase.

So there seems to be no (direct) interrelationship between the NPE
and the locked threads.

Cheers,
Martin



On Tue, 2007-07-10 at 23:43 +0200, Martin Grotzke wrote:
 Hi,
 
 we had an issue with our deployed application that did not respond
 anymore. This happened two or three times in the last 4 days, but
 I was not able to reproduce it until now.
 
 The analysis of the logs showed, that there was a NPE in
 Base64InputStream, and afterwards the application did not respond
 anymore.
 
 When I triggered a thread dump, all 200 tomcat threads were in status
 WAITING, like this one:
 
 http-9090-1 daemon prio=10 tid=0x2aaaf7e1fc00 nid=0x3f05 waiting on 
 condition [0x4459e000..0x4459fbc0]
java.lang.Thread.State: WAITING (parking)
 at sun.misc.Unsafe.park(Native Method)
 - parking to wait for  0x2aaab8228360 (a 
 java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync)
 at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
 at 
 java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:712)
 at 
 java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared(AbstractQueuedSynchronizer.java:842)
 at 
 java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(AbstractQueuedSynchronizer.java:1162)
 at 
 java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(ReentrantReadWriteLock.java:594)
 at 
 org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:70)
 at 
 org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:110)
 at 
 $RequestHandler_1139c29ae4a.service($RequestHandler_1139c29ae4a.java)
 at 
 $RequestHandler_1139c29ae41.service($RequestHandler_1139c29ae41.java)
 at 
 org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java:1044)
 at 
 $HttpServletRequestHandler_1139c29ae40.service($HttpServletRequestHandler_1139c29ae40.java)
 at 
 org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:135)
 at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
 at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
 at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
 at 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
 at 
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Thread.java:619)
 
 I'm not sure if the NPE that happened before is the reason for this, as I 
 don't
 see the relationship between both issues (apart from the correlation of 
 events/time).
 
 Hopefully someone closer to the code can have a look at this and tell what's 
 the
 problem here? Then I'd like to submit a bug report / help fixing(?)...
 
 More output of the logs you find at the end of this email.
 
 Thanx a lot in advance,
 cheers,
 Martin
 
 
 
 [INFO ] 2007-07-09 11:56:35,513 TP-Processor1 
 org.comp.proj.search.presentation.pages.Search.onActivate:
 Got invoked args hose, cat:Herrenbekleidung, n, 100
 
 [INFO ] 2007-07-09 11:56:35,518 TP-Processor1 
 org.comp.proj.search.presentation.pages.Search.setupRender:
 Starting search...
 
 [DEBUG] 2007-07-09 11:56:35,520 TP-Processor1 
 org.comp.proj.search.business.SearchServiceSolrImpl.search:
 Starting query:
 q=hose;score+descfq=cat:Herrenbekleidungstart=0rows=100facet=truefacet.field=catfacet.field=brandfacet.field=typefacet.field=colorfacet
 .field=pricefacet.limit=5facet.zeros=falsefacet.missing=falseversion=2.2
 
 [DEBUG] 2007-07-09 11:56:35,610 TP-Processor1 
 org.comp.proj.search.business.SearchServiceSolrImpl.logResponse:
 Got response: numFound: 207, queryTime: 43
 
 [INFO ] 2007-07-09 11:56:35,803 TP-Processor1 
 org.comp.proj.search.presentation.services.AppModule.TimingFilter.service:
 Request time: 292 ms
 
 [INFO ] 2007-07-09 11

Re: Antwort: Re: Antwort: RE: T5 Decoupling a Template From its Component Class

2007-07-03 Thread Martin Grotzke
On Tue, 2007-07-03 at 08:27 +0200, Kristian Marinkovic wrote:
 
 just remove the InjectService annotation from your service  
 method and try it again :)
Cool, really easy :)

Thanx a lot,
cheers,
Martin


 
 
 
 Martin Grotzke
 [EMAIL PROTECTED] 
 
 02.07.2007 16:50 
 Bitte antworten an
  Tapestry users
 users@tapestry.apache.org
 
 
 
 
An
 Tapestry users
 users@tapestry.apache.org 
 Kopie
 
 Thema
 Re: Antwort: RE:
 T5 Decoupling a
 Template From
 its Component
 Class
 
 
 
 
 
 
 
 
 On Mon, 2007-07-02 at 16:06 +0200, Kristian Marinkovic wrote:
  
  service implementations contributed to the alias service will  
  override the other service implementations. this is also true for 
  implementations originally provided by tapestry 
  
  the additional id is to distinguish multiple implementations of the 
  same interface. in your case you should only need it twice: 
  1) to define your service 
  2) to contribute to the alias service then you can forget it :) 
 
 If I understand you correctly, you say that 
 
   public static PageResponseRenderer decoratePageResponseRenderer(
   @InjectService(PageMarkupRenderer)
   final PageMarkupRenderer markupRenderer,
   @InjectService(MarkupWriterFactory)
   final MarkupWriterFactory markupWriterFactory,
   final Object delegate )
 
 should provide our custom MarkupWriterFactory?
 This is not the fact - with @InjectService(MarkupWriterFactory)
 T5 provides its MarkupWriterFactoryImpl and not our custom
 MarkupWriterFactory.
 Did I understand you wrong, or is this a bug in T5?
 
 Cheers,
 Martin
 
 
 
  
  g, 
  kris 
  
  
  
  Martin Grotzke
  [EMAIL PROTECTED] 
  
  02.07.2007 14:10 
  Bitte antworten an
   Tapestry users
  users@tapestry.apache.org
  
  
  
  
 An
  Tapestry users
  users@tapestry.apache.org 
  Kopie
  
  Thema
  RE: T5 Decoupling
  a Template From
  its Component
  Class
  
  
  
  
  
  
  
  
  On Mon, 2007-07-02 at 11:03 +0200, Kristian Marinkovic wrote:
   
   hi martin, 
   
   if you use the ServiceBinder to contribute a class that implements
  an
   already 
   contributed interface you have to assign an id for your class by
   invoking withId, 
   because the Interface is no longer sufficient to identifiy the
  service
   
binder.bind(PageTemplateLocator.class, 
   MyPageTemplateLocatorImpl.class).withId(myLocator); 
   
   furthermore you have to contribute to the aliasOverrides Service 
   to actually replace the old implementation: 
   
   public static void contributeAliasOverrides( 
   @InjectService(myLocator) PageTemplateLocator
  locator, 
   ConfigurationAliasContribution configuration) { 

  configuration.add( 
AliasContribution.create( 
PageTemplateLocator.class, locator)); 
  
  Great, this works - thanx a lot!
  
  Just for clarification: the specified id has to be used anywhere
 else,
  right? E.g. for us the service in question is the
 MarkupWriterFactory,
  and previously we also had this in our AppModule:
  
 public static PageResponseRenderer decoratePageResponseRenderer(
 @InjectService(PageMarkupRenderer)
 final PageMarkupRenderer markupRenderer,
 @InjectService(MarkupWriterFactory)
 final MarkupWriterFactory markupWriterFactory,
 final Object delegate )
  
  which we have to change to @InjectService(myMarkupWriterFactory)
  then.
  Is this the intended way? Is it guaranteed, that T5 does not
 reference
  the MarkupWriterFactory implementation by the id
  MarkupWriterFactory?
  
  Thanx  cheers,
  Martin 
  
  
   
   
   g, 
   kris 
   
   
   
   Martin Grotzke
   [EMAIL PROTECTED] 
   
   02.07.2007 10:00 
   Bitte antworten an
Tapestry users
   users@tapestry.apache.org
   
   
   
   
  An
   Tapestry users
   users@tapestry.apache.org 
   Kopie
   
   Thema
   RE: T5 Decoupling
   a Template From
   its Component
   Class
   
   
   
   
   
   
   
   
Digging through the code I notice there is a PageTemplateLocator
interface which seems like the appropriate service to override.
  What
   I
have tried is to add the following method to my AppModule
  class


public static void bind(ServiceBinder binder) {
  ServiceBindingOptions options = 
  binder.bind(
   
PageTemplateLocator.class,
   
MyPageTemplateLocatorImpl.class
   );
}


...but I get the following exception at startup.


java.lang.RuntimeException: Service id 'PageTemplateLocator' has
   already
been defined by
   
   Did you solve this issue? I get the same exception with another
   Service
   that's defined

RE: T5 Decoupling a Template From its Component Class

2007-07-02 Thread Martin Grotzke
 Digging through the code I notice there is a PageTemplateLocator
 interface which seems like the appropriate service to override. What I
 have tried is to add the following method to my AppModule class
 
 
 public static void bind(ServiceBinder binder) {
   ServiceBindingOptions options = 
   binder.bind(
   PageTemplateLocator.class,
   MyPageTemplateLocatorImpl.class
   );
 }
 
 
 ...but I get the following exception at startup.
 
 
 java.lang.RuntimeException: Service id 'PageTemplateLocator' has already
 been defined by

Did you solve this issue? I get the same exception with another Service
that's defined in TapestryModule that I want to override in my AppModule
with my custom implementation...

Thx  cheers,
Martin


On Wed, 2007-05-30 at 19:17 -0700, David Kendall wrote:
  From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] 
  Sent: Wednesday, May 30, 2007 5:15 PM
  There are internal services that can be overridden to handle those 
  kinds of situations.
  The goal is to create something that works amazingly well for all 
  the more typical cases, then start going after these others.  Often 
  it will involve moving a private interface out into the public space
 ..
 
 
 
 
 Thanks Howard - I appreciate your prompt response.  However - I am not
 clear if you are saying it cannot be done currently - or if you mean
 that it can be done - but that I would be treading on somewhat unstable
 ground given that the internal interfaces are subject to change.
 
 Digging through the code I notice there is a PageTemplateLocator
 interface which seems like the appropriate service to override. What I
 have tried is to add the following method to my AppModule class
 
 
 public static void bind(ServiceBinder binder) {
   ServiceBindingOptions options = 
   binder.bind(
   PageTemplateLocator.class,
   MyPageTemplateLocatorImpl.class
   );
 }
 
 
 ...but I get the following exception at startup.
 
 
 java.lang.RuntimeException: Service id 'PageTemplateLocator' has already
 been defined by
 org.apache.tapestry.internal.services.InternalModule.build(AssetFactory,
 ComponentClassResolver) (at InternalModule.java:231) and may not be
 redefined by
 org.example.myapp.services.AppModule$MyPageTemplateLocatorImpl() (at
 AppModule.java:159). You should rename one of the service builder
 methods.
 
 
 
 
 Am I wasting my time trying this? I can tolerate a certain amount of
 instability when pulling in subsequent revisions of Tap5 - however - I
 would like to get a proof of concept up and running if at all possible.
 
 Any thoughts on this?
 
 Thanks again.
 
 David Kendall
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 XHTML compliant markup

2007-07-02 Thread Martin Grotzke
On Fri, 2007-06-29 at 11:57 -0700, Howard Lewis Ship wrote:
 This is an unimplemented feature; currently Tapestry isn't smart
 enough to output well-formed markup just because the template
 specified an XML doctype. Please check JIRA and add an issue if not
 present.
I couldn't find an appropriate issue, so I created
https://issues.apache.org/jira/browse/TAPESTRY-1621

Cheers,
Martin


 
 On 6/19/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  On Mon, 2007-06-18 at 20:21 +0200, Martin Grotzke wrote:
   Our template uses the following DOCTYPE definition:
  
   !DOCTYPE html
PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
  
   What's wrong with this to get well-formed XML?
  Or is the doctype correct and s.th. else might be the reason
  for the not well-formed xml?
 
  Cheers,
  Martin
 
 
  
   Thx  cheers,
   Martin
  
  
  
  
   On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote:
To elaborate; Tapestry uses the !DOCTYPE of the component template
to determine the type of markup it will send; when the !DOCTYPE is
omitted, it is assumed to be legacy HTML as defined by SGML, where
many element are unclosed.  When you provide an explicit !DOCTYPE,
Tapestry switches over to rendering out well-formed XML.
   
On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote:
 On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi,
 
  T5 currently renders markup that is not XHTML compliant.

 Yes and no.

  E.g. the element 'meta http-equiv=Content-Type 
  content=text/html;
  charset=utf-8 /' is rendered as 'meta content=text/html;
  charset=utf-8 http-equiv=Content-Type' - the tag is not closed
  properly.
 
  Is there any way to force T5 to generate XHTML compliant markup?

 If your template uses HTML (SGML) markup, T5 generates HTML markup, if
 your template uses XHTML, T5 generates XHTML. See previous posts on
 this list.

 --
 regards,
 Robin

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


   
   
  --
  Martin Grotzke
  http://www.javakaffee.de/blog/
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5 Decoupling a Template From its Component Class

2007-07-02 Thread Martin Grotzke
On Mon, 2007-07-02 at 11:03 +0200, Kristian Marinkovic wrote:
 
 hi martin, 
 
 if you use the ServiceBinder to contribute a class that implements an
 already 
 contributed interface you have to assign an id for your class by
 invoking withId, 
 because the Interface is no longer sufficient to identifiy the service
 
  binder.bind(PageTemplateLocator.class, 
 MyPageTemplateLocatorImpl.class).withId(myLocator); 
 
 furthermore you have to contribute to the aliasOverrides Service 
 to actually replace the old implementation: 
 
 public static void contributeAliasOverrides( 
 @InjectService(myLocator) PageTemplateLocator locator, 
 ConfigurationAliasContribution configuration) { 
  
configuration.add( 
  AliasContribution.create( 
  PageTemplateLocator.class, locator)); 

Great, this works - thanx a lot!

Just for clarification: the specified id has to be used anywhere else,
right? E.g. for us the service in question is the MarkupWriterFactory,
and previously we also had this in our AppModule:

public static PageResponseRenderer decoratePageResponseRenderer(
@InjectService(PageMarkupRenderer)
final PageMarkupRenderer markupRenderer,
@InjectService(MarkupWriterFactory)
final MarkupWriterFactory markupWriterFactory,
final Object delegate )

which we have to change to @InjectService(myMarkupWriterFactory) then.
Is this the intended way? Is it guaranteed, that T5 does not reference
the MarkupWriterFactory implementation by the id MarkupWriterFactory?

Thanx  cheers,
Martin 


 
 
 g, 
 kris 
 
 
 
 Martin Grotzke
 [EMAIL PROTECTED] 
 
 02.07.2007 10:00 
 Bitte antworten an
  Tapestry users
 users@tapestry.apache.org
 
 
 
 
An
 Tapestry users
 users@tapestry.apache.org 
 Kopie
 
 Thema
 RE: T5 Decoupling
 a Template From
 its Component
 Class
 
 
 
 
 
 
 
 
  Digging through the code I notice there is a PageTemplateLocator
  interface which seems like the appropriate service to override. What
 I
  have tried is to add the following method to my AppModule class
  
  
  public static void bind(ServiceBinder binder) {
ServiceBindingOptions options = 
binder.bind(
 
  PageTemplateLocator.class,
 
  MyPageTemplateLocatorImpl.class
 );
  }
  
  
  ...but I get the following exception at startup.
  
  
  java.lang.RuntimeException: Service id 'PageTemplateLocator' has
 already
  been defined by
 
 Did you solve this issue? I get the same exception with another
 Service
 that's defined in TapestryModule that I want to override in my
 AppModule
 with my custom implementation...
 
 Thx  cheers,
 Martin
 
 
 On Wed, 2007-05-30 at 19:17 -0700, David Kendall wrote:
   From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] 
   Sent: Wednesday, May 30, 2007 5:15 PM
   There are internal services that can be overridden to handle
 those 
   kinds of situations.
   The goal is to create something that works amazingly well for all 
   the more typical cases, then start going after these others.
  Often 
   it will involve moving a private interface out into the public
 space
  ..
  
  
  
  
  Thanks Howard - I appreciate your prompt response.  However - I am
 not
  clear if you are saying it cannot be done currently - or if you mean
  that it can be done - but that I would be treading on somewhat
 unstable
  ground given that the internal interfaces are subject to change.
  
  Digging through the code I notice there is a PageTemplateLocator
  interface which seems like the appropriate service to override. What
 I
  have tried is to add the following method to my AppModule class
  
  
  public static void bind(ServiceBinder binder) {
ServiceBindingOptions options = 
binder.bind(
 
  PageTemplateLocator.class,
 
  MyPageTemplateLocatorImpl.class
 );
  }
  
  
  ...but I get the following exception at startup.
  
  
  java.lang.RuntimeException: Service id 'PageTemplateLocator' has
 already
  been defined by
 
 org.apache.tapestry.internal.services.InternalModule.build(AssetFactory,
  ComponentClassResolver) (at InternalModule.java:231) and may not be
  redefined by
  org.example.myapp.services.AppModule$MyPageTemplateLocatorImpl() (at
  AppModule.java:159). You should rename one of the service builder
  methods.
  
  
  
  
  Am I wasting my time trying this? I can tolerate a certain amount of
  instability when pulling in subsequent revisions of Tap5 - however -
 I
  would like to get a proof of concept up and running if at all
 possible.
  
  Any thoughts on this?
  
  Thanks again.
  
  David Kendall
  
  
  
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional

Re: Antwort: RE: T5 Decoupling a Template From its Component Class

2007-07-02 Thread Martin Grotzke
On Mon, 2007-07-02 at 16:06 +0200, Kristian Marinkovic wrote:
 
 service implementations contributed to the alias service will  
 override the other service implementations. this is also true for 
 implementations originally provided by tapestry 
 
 the additional id is to distinguish multiple implementations of the 
 same interface. in your case you should only need it twice: 
 1) to define your service 
 2) to contribute to the alias service then you can forget it :) 

If I understand you correctly, you say that 

   public static PageResponseRenderer decoratePageResponseRenderer(
   @InjectService(PageMarkupRenderer)
   final PageMarkupRenderer markupRenderer,
   @InjectService(MarkupWriterFactory)
   final MarkupWriterFactory markupWriterFactory,
   final Object delegate )

should provide our custom MarkupWriterFactory?
This is not the fact - with @InjectService(MarkupWriterFactory)
T5 provides its MarkupWriterFactoryImpl and not our custom
MarkupWriterFactory.
Did I understand you wrong, or is this a bug in T5?

Cheers,
Martin



 
 g, 
 kris 
 
 
 
 Martin Grotzke
 [EMAIL PROTECTED] 
 
 02.07.2007 14:10 
 Bitte antworten an
  Tapestry users
 users@tapestry.apache.org
 
 
 
 
An
 Tapestry users
 users@tapestry.apache.org 
 Kopie
 
 Thema
 RE: T5 Decoupling
 a Template From
 its Component
 Class
 
 
 
 
 
 
 
 
 On Mon, 2007-07-02 at 11:03 +0200, Kristian Marinkovic wrote:
  
  hi martin, 
  
  if you use the ServiceBinder to contribute a class that implements
 an
  already 
  contributed interface you have to assign an id for your class by
  invoking withId, 
  because the Interface is no longer sufficient to identifiy the
 service
  
   binder.bind(PageTemplateLocator.class, 
  MyPageTemplateLocatorImpl.class).withId(myLocator); 
  
  furthermore you have to contribute to the aliasOverrides Service 
  to actually replace the old implementation: 
  
  public static void contributeAliasOverrides( 
  @InjectService(myLocator) PageTemplateLocator
 locator, 
  ConfigurationAliasContribution configuration) { 
   
 configuration.add( 
   AliasContribution.create( 
   PageTemplateLocator.class, locator)); 
 
 Great, this works - thanx a lot!
 
 Just for clarification: the specified id has to be used anywhere else,
 right? E.g. for us the service in question is the MarkupWriterFactory,
 and previously we also had this in our AppModule:
 
public static PageResponseRenderer decoratePageResponseRenderer(
@InjectService(PageMarkupRenderer)
final PageMarkupRenderer markupRenderer,
@InjectService(MarkupWriterFactory)
final MarkupWriterFactory markupWriterFactory,
final Object delegate )
 
 which we have to change to @InjectService(myMarkupWriterFactory)
 then.
 Is this the intended way? Is it guaranteed, that T5 does not reference
 the MarkupWriterFactory implementation by the id
 MarkupWriterFactory?
 
 Thanx  cheers,
 Martin 
 
 
  
  
  g, 
  kris 
  
  
  
  Martin Grotzke
  [EMAIL PROTECTED] 
  
  02.07.2007 10:00 
  Bitte antworten an
   Tapestry users
  users@tapestry.apache.org
  
  
  
  
 An
  Tapestry users
  users@tapestry.apache.org 
  Kopie
  
  Thema
  RE: T5 Decoupling
  a Template From
  its Component
  Class
  
  
  
  
  
  
  
  
   Digging through the code I notice there is a PageTemplateLocator
   interface which seems like the appropriate service to override.
 What
  I
   have tried is to add the following method to my AppModule
 class
   
   
   public static void bind(ServiceBinder binder) {
 ServiceBindingOptions options = 
 binder.bind(
  
   PageTemplateLocator.class,
  
   MyPageTemplateLocatorImpl.class
  );
   }
   
   
   ...but I get the following exception at startup.
   
   
   java.lang.RuntimeException: Service id 'PageTemplateLocator' has
  already
   been defined by
  
  Did you solve this issue? I get the same exception with another
  Service
  that's defined in TapestryModule that I want to override in my
  AppModule
  with my custom implementation...
  
  Thx  cheers,
  Martin
  
  
  On Wed, 2007-05-30 at 19:17 -0700, David Kendall wrote:
From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 30, 2007 5:15 PM
There are internal services that can be overridden to handle
  those 
kinds of situations.
The goal is to create something that works amazingly well for
 all 
the more typical cases, then start going after these others.
   Often 
it will involve moving a private interface out into the public
  space
   ..
   
   
   
   
   Thanks Howard - I appreciate your prompt response.  However - I am
  not
   clear if you are saying

Re: T5 XHTML compliant markup

2007-07-01 Thread Martin Grotzke
On Fri, 2007-06-29 at 11:57 -0700, Howard Lewis Ship wrote:
 This is an unimplemented feature; currently Tapestry isn't smart
 enough to output well-formed markup just because the template
 specified an XML doctype. Please check JIRA and add an issue if not
 present.
Ok, I'll do this.

This issue is very crucial for us, so until this feature is implemented
we need to implement some workaround or quick fix that creates valid
xhtml output.

What would be the best way to accomplish this?

Alternatively we would like to help implementing this feature if it's
somehow possible.

Thanx  cheers,
Martin



 
 On 6/19/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  On Mon, 2007-06-18 at 20:21 +0200, Martin Grotzke wrote:
   Our template uses the following DOCTYPE definition:
  
   !DOCTYPE html
PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
  
   What's wrong with this to get well-formed XML?
  Or is the doctype correct and s.th. else might be the reason
  for the not well-formed xml?
 
  Cheers,
  Martin
 
 
  
   Thx  cheers,
   Martin
  
  
  
  
   On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote:
To elaborate; Tapestry uses the !DOCTYPE of the component template
to determine the type of markup it will send; when the !DOCTYPE is
omitted, it is assumed to be legacy HTML as defined by SGML, where
many element are unclosed.  When you provide an explicit !DOCTYPE,
Tapestry switches over to rendering out well-formed XML.
   
On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote:
 On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi,
 
  T5 currently renders markup that is not XHTML compliant.

 Yes and no.

  E.g. the element 'meta http-equiv=Content-Type 
  content=text/html;
  charset=utf-8 /' is rendered as 'meta content=text/html;
  charset=utf-8 http-equiv=Content-Type' - the tag is not closed
  properly.
 
  Is there any way to force T5 to generate XHTML compliant markup?

 If your template uses HTML (SGML) markup, T5 generates HTML markup, if
 your template uses XHTML, T5 generates XHTML. See previous posts on
 this list.

 --
 regards,
 Robin

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


   
   
  --
  Martin Grotzke
  http://www.javakaffee.de/blog/
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 XHTML compliant markup

2007-07-01 Thread Martin Grotzke
On Sun, 2007-07-01 at 20:04 +0200, Martin Grotzke wrote:
 On Fri, 2007-06-29 at 11:57 -0700, Howard Lewis Ship wrote:
 This issue is very crucial for us, so until this feature is implemented
 we need to implement some workaround or quick fix that creates valid
 xhtml output.
 
 What would be the best way to accomplish this?
AFAICS it should be enough to provide our own MarkupWriterFactory that
creates a new MarkupWriterImpl with s.th. like an XHTMLMarkupModel
instead of the DefaultMarkupModel.

How can we do this?

Thx  cheers,
Martin


 
 Alternatively we would like to help implementing this feature if it's
 somehow possible.
 
 Thanx  cheers,
 Martin
 
 
 
  
  On 6/19/07, Martin Grotzke [EMAIL PROTECTED] wrote:
   On Mon, 2007-06-18 at 20:21 +0200, Martin Grotzke wrote:
Our template uses the following DOCTYPE definition:
   
!DOCTYPE html
 PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
   
What's wrong with this to get well-formed XML?
   Or is the doctype correct and s.th. else might be the reason
   for the not well-formed xml?
  
   Cheers,
   Martin
  
  
   
Thx  cheers,
Martin
   
   
   
   
On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote:
 To elaborate; Tapestry uses the !DOCTYPE of the component template
 to determine the type of markup it will send; when the !DOCTYPE is
 omitted, it is assumed to be legacy HTML as defined by SGML, where
 many element are unclosed.  When you provide an explicit !DOCTYPE,
 Tapestry switches over to rendering out well-formed XML.

 On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote:
  On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
   Hi,
  
   T5 currently renders markup that is not XHTML compliant.
 
  Yes and no.
 
   E.g. the element 'meta http-equiv=Content-Type 
   content=text/html;
   charset=utf-8 /' is rendered as 'meta content=text/html;
   charset=utf-8 http-equiv=Content-Type' - the tag is not closed
   properly.
  
   Is there any way to force T5 to generate XHTML compliant markup?
 
  If your template uses HTML (SGML) markup, T5 generates HTML markup, 
  if
  your template uses XHTML, T5 generates XHTML. See previous posts on
  this list.
 
  --
  regards,
  Robin
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


   --
   Martin Grotzke
   http://www.javakaffee.de/blog/
  
  
  
  
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 XHTML compliant markup

2007-06-29 Thread Martin Grotzke
To pick up this topic again...

On Wed, 2007-06-20 at 08:19 +0200, Martin Grotzke wrote:
 On Mon, 2007-06-18 at 20:21 +0200, Martin Grotzke wrote:
  Our template uses the following DOCTYPE definition:
  
  !DOCTYPE html
   PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
  
  What's wrong with this to get well-formed XML?
No answer until now - so it's correct?

 Or is the doctype correct and s.th. else might be the reason
 for the not well-formed xml?

A colleage just create a nearly blank template with the doctype
above and it also created non xhtml markup...

Do you need more information about environment/whatever?

Thanx in advance,
cheers,
Martin



  On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote:
   To elaborate; Tapestry uses the !DOCTYPE of the component template
   to determine the type of markup it will send; when the !DOCTYPE is
   omitted, it is assumed to be legacy HTML as defined by SGML, where
   many element are unclosed.  When you provide an explicit !DOCTYPE,
   Tapestry switches over to rendering out well-formed XML.
   
   On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote:
On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 Hi,

 T5 currently renders markup that is not XHTML compliant.
   
Yes and no.
   
 E.g. the element 'meta http-equiv=Content-Type content=text/html;
 charset=utf-8 /' is rendered as 'meta content=text/html;
 charset=utf-8 http-equiv=Content-Type' - the tag is not closed
 properly.

 Is there any way to force T5 to generate XHTML compliant markup?
   
If your template uses HTML (SGML) markup, T5 generates HTML markup, if
your template uses XHTML, T5 generates XHTML. See previous posts on
this list.
   
--
regards,
Robin
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
   
   
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: AJAX : DOJO vs JQuery

2007-06-27 Thread Martin Grotzke
jquery + T5 would be really great (we're also going to use this
combination)


On Wed, 2007-06-27 at 16:43 -0400, Evan Rawson - Work wrote:
 i dont know how many you know about jquery, i recently discovered it today, 
 and from the demo's and plugins i found from it it look very superior verses 
 dojo, i have used both, but i prefer jquery, do to the fact that its way 
 easier to create new libraries and plugins for it. Almost like how tapestry 
 3rd party components are to other frameworks out there
 
 the one jquery plugin i found, interface, knocks the socks off anything i 
 have used in dojo before. the jquery l;ibrary is also only 19k (light 
 version). The JS code is also way less bulkly. My question is that would it 
 be possible to incorporate jquery into tapestry 5 final release. dojo is 
 create for its SVG capabilty, but as far as interfacing UI jquery is cleaner, 
 as well as more efficent.
 
 thanx in advance
 
 ~evan rawson



signature.asc
Description: This is a digitally signed message part


Re: [T5] Documentation

2007-06-25 Thread Martin Grotzke
On Fri, 2007-06-22 at 22:51 -0500, Robert Sanders wrote:
 http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html
If the links (anchors) on this page would work with firefox (1.5) it
would be really great!

+1 for examples. I also read the api doc but didn't understand what's
written there. After questions on the mailing list and a better
understanding of mentioned concepts it's possible to understand,
otherwise it's very hard sometimes.

Cheers,
Martin


 
 
 Vic Cekvenich wrote:
  Ah... what is the url for the component reference?
 
  .V
 
  Robert Sanders wrote:
  As someone new who's attempting to evaluate tapestry 5 I'd say the 
  first step would be to go through the component-reference doc and add 
  some (simple) example code and/or example values for the various 
  properties.  Most of these items use tapestry specific descriptions, 
  with some examples it would be much easier to understand what's being 
  described.
 
 
  Daniel Gredler wrote:
  Hi all,
 
  In an effort to improve the T5 documentation, I'm going to start going
  through the mailing list, looking at questions that have been asked, 
  and
  trying to identify aspects of the framework that should be, but 
  aren't, well
  documented. If you have any suggestions, feel free to respond here 
  or raise
  a JIRA issue. What morsel of information did you spend 4 hours 
  trying to
  find? What could be documented better? What typo has been getting on 
  your
  nerves for the past month? Fire away!
 
  Take care,
 
  Daniel
 
 
  
 
  -
  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]
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


T5 Encoding issue (repost)

2007-06-21 Thread Martin Grotzke
Hi,

I just want to pickup this topic in a new thread, to make sure
it's noticed - thx to Uli's suggestion in the previous thread :)

At first a short summary again:
- T5 (the PageRenderDispatcher) tries to decode activation context
  arguments (in convertActivationContext).
- The activation context arguments are read from request.getPath()
  (httpServletRequest.getServletPath()).
- The httpServletRequest.getServletPath() provides the _decoded_
  part of the url, according to the servlet specification [1].
  E.g., getServletPath() may return special characters like e.g.
  german umlauts, so the url encoded %C3%BCbel would be returned
  as übel.
- When PageRenderDispatcher.convertActivationContext tries to decode
  the already decoded string (by invoking
  TapestryInternalUtils.urlDecode which itself invokes commons
  URLCodec.decode) and either fails with a
  org.apache.commons.codec.DecoderException: Invalid URL encoding
  (e.g. for tr%b or returns the wrong value (e.g. ?bel for übel).

Our encoding is UTF-8 btw.

My question is: why does PageRenderDispatcher.convertActivationContext
try to decode the already decoded string again? I asume there's *some*
reason for this ;)

Otherwise I'd like to submit an issue with a patch for this.

Thanx  cheers,
Martin


[1] An excerpt from the servlet spec 2.4 p. 243:

getServletPath()
[...]
Returns: a String containing the name or path of the servlet being
called,
as specified in the request URL, decoded, or an empty string if the
servlet
used to process the request is matched using the “/*” pattern.




signature.asc
Description: This is a digitally signed message part


Re: T5 XHTML compliant markup

2007-06-20 Thread Martin Grotzke
On Mon, 2007-06-18 at 20:21 +0200, Martin Grotzke wrote:
 Our template uses the following DOCTYPE definition:
 
 !DOCTYPE html
  PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
 
 What's wrong with this to get well-formed XML?
Or is the doctype correct and s.th. else might be the reason
for the not well-formed xml?

Cheers,
Martin


 
 Thx  cheers,
 Martin
 
 
 
 
 On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote:
  To elaborate; Tapestry uses the !DOCTYPE of the component template
  to determine the type of markup it will send; when the !DOCTYPE is
  omitted, it is assumed to be legacy HTML as defined by SGML, where
  many element are unclosed.  When you provide an explicit !DOCTYPE,
  Tapestry switches over to rendering out well-formed XML.
  
  On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote:
   On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
Hi,
   
T5 currently renders markup that is not XHTML compliant.
  
   Yes and no.
  
E.g. the element 'meta http-equiv=Content-Type content=text/html;
charset=utf-8 /' is rendered as 'meta content=text/html;
charset=utf-8 http-equiv=Content-Type' - the tag is not closed
properly.
   
Is there any way to force T5 to generate XHTML compliant markup?
  
   If your template uses HTML (SGML) markup, T5 generates HTML markup, if
   your template uses XHTML, T5 generates XHTML. See previous posts on
   this list.
  
   --
   regards,
   Robin
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5: change a grid's rowsPerPage property dynamically?

2007-06-20 Thread Martin Grotzke
On Tue, 2007-06-19 at 10:45 +0200, Martin Dietze wrote:
 Hi,
 
  I am using a Grid component for displaying a larger set of
 data. On my page I have form which I use to allow the user to
 set the perferred page size. When the user selects a new
 setting the form submits and changes the page class'es
 _rowsPerPage property which is used by the grid in the template
 to determine its number of rows like this:
 
 |  table t:type=grid
 |   row=partner
 |   source=partners
 |   rowsPerPage=${rowsPerPage}
 |   model=partnersRowModel
 
 My _rowsPerPage property get set to the right value after
 submit, however the grid seems to ignore any changes from the
 default it has been created with. Could it be the rowsPerPage
 setting is cached somehow? How can I get the component to honor
 new settings?
Would it be possible to have the grid component in your page class
so that you can update the rowsPerPage property directly?

Cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5 encoding issue

2007-06-20 Thread Martin Grotzke
Hi,

this is an urgent and important issue for us. Can anybody help
with this? Howard?

As I wrote below: request.getServletPath() (or request.getPath())
already provides the decoded path.
a) Should request.getPath() provide the encoded path, or
b) should the additional decoding (in
   PageRenderDispatcher.convertActivationContext) be skipped?

Is anything else the problem? E.g. might the problem be caused
by commons URLCodec?

Thanx in advance,
cheers,
Martin


On Mon, 2007-06-18 at 12:20 +0200, Martin Grotzke wrote:
 On Sun, 2007-06-17 at 23:24 +0200, Martin Grotzke wrote:
  I just stepped through the sources to see where the URI get's
  decoded to the activation context arguments, and found that the
  o.a.t.internal.services.PageRenderDispatcher.dispatch invokes
  convertActivationContext with the path info to convert it to
  the activation context args.
  
  convertActivationContext uses TapestryInternalUtils.urlDecode
  which invokes URLCodec.decode. It seems that this causes the
  problem, but I cannot say what exactly is the reason.
  
  When I remove the invocation of TapestryInternalUtils.urlDecode
  everything's fine...
 Just to provide more info:
 TapestryInternalUtils.urlDecode is invoked with the already decoded
 context parameter, e.g. trüb for the urlencoded string tr%C3%BCb.
 
 This parameter is read from request.getServletPath(), which is already
 /search/trüb. So it tries to decode the already decoded string, which
 then fails.
 
 What is the problem here? Is it that request.getServletPath() provides
 the already decoded string, or is the problem that the decoding is done
 additionally by T5? Or what else?
 
 Thanx  cheers,
 Martin
 
 
  
  Any help with this issue?
  
  Thanx  cheers,
  Martin
  
  
  On Sun, 2007-06-17 at 23:01 +0200, Martin Grotzke wrote:
   On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote:
In case you are using Tomcat try adding URIEncoding=UTF-8 to your
connector definition in server.xml.
   I just tried that, but it does not solve the problem.
   
   I have added a servlet filter that prints the requested uri to
   the std out, just to see what is the input for T5.
   
   The URIEncoding=UTF-8 does not change what's printed by the
   filter, but the argument that's passed to my page class' onActivate
   is different.
   
   Without URIEncoding=UTF-8:
   
   [INFO ] 2007-06-17 22:52:37,956 http-8080-1 
   org.comp.proj.presentation.util.EncodingFilter.doFilter:
   - uri: /shopping24-shop/search/tr%C3%BCb
   - path: null
   
   [INFO ] 2007-06-17 22:52:51,303 http-8080-1 
   org.comp.proj.presentation.pages.Search.onActivate:
   Got invoked args tr??b
   
   With URIEncoding=UTF-8:
   
   [INFO ] 2007-06-17 22:54:33,398 http-8080-1 
   org.comp.proj.presentation.util.EncodingFilter.doFilter:
   uri: /shopping24-shop/search/tr%C3%BCb
   
   [INFO ] 2007-06-17 22:54:44,620 http-8080-1 
   org.comp.proj.presentation.pages.Search.onActivate:
   Got invoked args tr?b
   
   
   Is there anything else that I could do to get the correct
   decoding of the request parameters / uri?
   
   Thanx  cheers,
   Martin
   
   
   

Uli

On Mo, 11.06.2007, 23:13, Martin Grotzke sagte:
 Hi,

 I have currently an encoding issue, but am not really sure what's
 the reason for this.

 I have an url that contains a url encoded german umlaut (ü) in UTF-8
 and looks like the following:

 http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the 
 ü
 in UTF-8, this url is created by
 componentResources.createPageLink( search, new Object[]{ _query } )
 in the submit method of the search page)

 Now, when I look in the onActivate(string) method, the string is not
 übel but it's ?bel, both printed via logging as when I inspect the
 variable during debugging.

 AFAICS the created url from the page link is correct in terms of utf-8
 encoding, but the parsed query string seems to be wrong, as it 
 contains
 only the ?...

 We have the following in our AppModule:

 public void contributeRequestHandler(
 OrderedConfigurationRequestFilter configuration,
 @InjectService(TimingFilter)
 final RequestFilter filter, @InjectService(Utf8Filter)
 final RequestFilter utf8Filter ) {
 configuration.add( Timing, filter );
 configuration.add( Utf8Filter, utf8Filter ); // handle UTF-8
 }

 public RequestFilter buildUtf8Filter(
 @InjectService(RequestGlobals)
 final RequestGlobals requestGlobals ) {
 return new RequestFilter() {
 public boolean service( Request request, Response 
 response,
 RequestHandler handler ) throws IOException {
 
 requestGlobals.getHTTPServletRequest().setCharacterEncoding(
 UTF-8 );
 return handler.service( request

Re: T5 encoding issue

2007-06-20 Thread Martin Grotzke
On Wed, 2007-06-20 at 22:02 +0200, Martin Grotzke wrote:
 Hi,
 
 this is an urgent and important issue for us. Can anybody help
 with this? Howard?
 
 As I wrote below: request.getServletPath() (or request.getPath())
 already provides the decoded path.
 a) Should request.getPath() provide the encoded path, or
 b) should the additional decoding (in
PageRenderDispatcher.convertActivationContext) be skipped?

An excerpt from the servlet spec 2.4 p. 243:

getServletPath()
[...]
Returns: a String containing the name or path of the servlet being called,
as specified in the request URL, decoded, or an empty string if the servlet
used to process the request is matched using the “/*” pattern.

So why is additional decoding done?

Cheers,
Martin


 
 Is anything else the problem? E.g. might the problem be caused
 by commons URLCodec?
 
 Thanx in advance,
 cheers,
 Martin
 
 
 On Mon, 2007-06-18 at 12:20 +0200, Martin Grotzke wrote:
  On Sun, 2007-06-17 at 23:24 +0200, Martin Grotzke wrote:
   I just stepped through the sources to see where the URI get's
   decoded to the activation context arguments, and found that the
   o.a.t.internal.services.PageRenderDispatcher.dispatch invokes
   convertActivationContext with the path info to convert it to
   the activation context args.
   
   convertActivationContext uses TapestryInternalUtils.urlDecode
   which invokes URLCodec.decode. It seems that this causes the
   problem, but I cannot say what exactly is the reason.
   
   When I remove the invocation of TapestryInternalUtils.urlDecode
   everything's fine...
  Just to provide more info:
  TapestryInternalUtils.urlDecode is invoked with the already decoded
  context parameter, e.g. trüb for the urlencoded string tr%C3%BCb.
  
  This parameter is read from request.getServletPath(), which is already
  /search/trüb. So it tries to decode the already decoded string, which
  then fails.
  
  What is the problem here? Is it that request.getServletPath() provides
  the already decoded string, or is the problem that the decoding is done
  additionally by T5? Or what else?
  
  Thanx  cheers,
  Martin
  
  
   
   Any help with this issue?
   
   Thanx  cheers,
   Martin
   
   
   On Sun, 2007-06-17 at 23:01 +0200, Martin Grotzke wrote:
On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote:
 In case you are using Tomcat try adding URIEncoding=UTF-8 to your
 connector definition in server.xml.
I just tried that, but it does not solve the problem.

I have added a servlet filter that prints the requested uri to
the std out, just to see what is the input for T5.

The URIEncoding=UTF-8 does not change what's printed by the
filter, but the argument that's passed to my page class' onActivate
is different.

Without URIEncoding=UTF-8:

[INFO ] 2007-06-17 22:52:37,956 http-8080-1 
org.comp.proj.presentation.util.EncodingFilter.doFilter:
- uri: /shopping24-shop/search/tr%C3%BCb
- path: null

[INFO ] 2007-06-17 22:52:51,303 http-8080-1 
org.comp.proj.presentation.pages.Search.onActivate:
Got invoked args tr??b

With URIEncoding=UTF-8:

[INFO ] 2007-06-17 22:54:33,398 http-8080-1 
org.comp.proj.presentation.util.EncodingFilter.doFilter:
uri: /shopping24-shop/search/tr%C3%BCb

[INFO ] 2007-06-17 22:54:44,620 http-8080-1 
org.comp.proj.presentation.pages.Search.onActivate:
Got invoked args tr?b


Is there anything else that I could do to get the correct
decoding of the request parameters / uri?

Thanx  cheers,
Martin



 
 Uli
 
 On Mo, 11.06.2007, 23:13, Martin Grotzke sagte:
  Hi,
 
  I have currently an encoding issue, but am not really sure what's
  the reason for this.
 
  I have an url that contains a url encoded german umlaut (ü) in UTF-8
  and looks like the following:
 
  http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents 
  the ü
  in UTF-8, this url is created by
  componentResources.createPageLink( search, new Object[]{ _query } 
  )
  in the submit method of the search page)
 
  Now, when I look in the onActivate(string) method, the string is not
  übel but it's ?bel, both printed via logging as when I inspect 
  the
  variable during debugging.
 
  AFAICS the created url from the page link is correct in terms of 
  utf-8
  encoding, but the parsed query string seems to be wrong, as it 
  contains
  only the ?...
 
  We have the following in our AppModule:
 
  public void contributeRequestHandler(
  OrderedConfigurationRequestFilter configuration,
  @InjectService(TimingFilter)
  final RequestFilter filter, @InjectService(Utf8Filter)
  final RequestFilter utf8Filter ) {
  configuration.add( Timing, filter

RE: T5 validation error images displayed withform.clientValidation=false

2007-06-19 Thread Martin Grotzke
On Tue, 2007-06-19 at 10:53 +0800, ASTI Araza, Ariel D. wrote:
 Oops, I misread the post. Please ignore my previous post.
The subject was misleading indeed ;)

Cheers,
Martin


 
 -Original Message-
 From: ASTI Araza, Ariel D. [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 19, 2007 10:50 AM
 To: Tapestry users
 Subject: RE: T5 validation error images displayed
 withform.clientValidation=false
 
 I was wondering about the presence of that tag myself, until I realized
 that for client-side validation to avoid having to go back to the
 server, the images must already be in the page, but it should remain
 hidden until needed. I just ensured that I had the right CSS (I used
 tapestry.css) and the client side validation performed as expected, the
 error images didn't show until I hit submit and there's a field
 violating the validation rules.
 
 Ariel
 
 -Original Message-
 From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
 Sent: Monday, June 18, 2007 9:28 PM
 To: Tapestry users
 Subject: T5 validation error images displayed
 withform.clientValidation=false
 
 Hi,
 
 even if you set clientValidation=false on a form, T5 renders the
 validation error image for all input components (for validation
 errors that might occur):
 
 img alt=[Error] class=t-error-icon t-invisible id=cancel:icon
 src=/app/assets/tapestry/field-error-marker.png
 
 AFAICS with clientValidation=false this should not be needed and
 markup could be improved + page load time reduced.
 
 Shall we submit an issue for this / would a patch be welcome?
 
 Cheers,
 Martin
 
 
 
 -
 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]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 encoding issue

2007-06-18 Thread Martin Grotzke
On Sun, 2007-06-17 at 23:24 +0200, Martin Grotzke wrote:
 I just stepped through the sources to see where the URI get's
 decoded to the activation context arguments, and found that the
 o.a.t.internal.services.PageRenderDispatcher.dispatch invokes
 convertActivationContext with the path info to convert it to
 the activation context args.
 
 convertActivationContext uses TapestryInternalUtils.urlDecode
 which invokes URLCodec.decode. It seems that this causes the
 problem, but I cannot say what exactly is the reason.
 
 When I remove the invocation of TapestryInternalUtils.urlDecode
 everything's fine...
Just to provide more info:
TapestryInternalUtils.urlDecode is invoked with the already decoded
context parameter, e.g. trüb for the urlencoded string tr%C3%BCb.

This parameter is read from request.getServletPath(), which is already
/search/trüb. So it tries to decode the already decoded string, which
then fails.

What is the problem here? Is it that request.getServletPath() provides
the already decoded string, or is the problem that the decoding is done
additionally by T5? Or what else?

Thanx  cheers,
Martin


 
 Any help with this issue?
 
 Thanx  cheers,
 Martin
 
 
 On Sun, 2007-06-17 at 23:01 +0200, Martin Grotzke wrote:
  On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote:
   In case you are using Tomcat try adding URIEncoding=UTF-8 to your
   connector definition in server.xml.
  I just tried that, but it does not solve the problem.
  
  I have added a servlet filter that prints the requested uri to
  the std out, just to see what is the input for T5.
  
  The URIEncoding=UTF-8 does not change what's printed by the
  filter, but the argument that's passed to my page class' onActivate
  is different.
  
  Without URIEncoding=UTF-8:
  
  [INFO ] 2007-06-17 22:52:37,956 http-8080-1 
  org.comp.proj.presentation.util.EncodingFilter.doFilter:
  - uri: /shopping24-shop/search/tr%C3%BCb
  - path: null
  
  [INFO ] 2007-06-17 22:52:51,303 http-8080-1 
  org.comp.proj.presentation.pages.Search.onActivate:
  Got invoked args tr??b
  
  With URIEncoding=UTF-8:
  
  [INFO ] 2007-06-17 22:54:33,398 http-8080-1 
  org.comp.proj.presentation.util.EncodingFilter.doFilter:
  uri: /shopping24-shop/search/tr%C3%BCb
  
  [INFO ] 2007-06-17 22:54:44,620 http-8080-1 
  org.comp.proj.presentation.pages.Search.onActivate:
  Got invoked args tr?b
  
  
  Is there anything else that I could do to get the correct
  decoding of the request parameters / uri?
  
  Thanx  cheers,
  Martin
  
  
  
   
   Uli
   
   On Mo, 11.06.2007, 23:13, Martin Grotzke sagte:
Hi,
   
I have currently an encoding issue, but am not really sure what's
the reason for this.
   
I have an url that contains a url encoded german umlaut (ü) in UTF-8
and looks like the following:
   
http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü
in UTF-8, this url is created by
componentResources.createPageLink( search, new Object[]{ _query } )
in the submit method of the search page)
   
Now, when I look in the onActivate(string) method, the string is not
übel but it's ?bel, both printed via logging as when I inspect the
variable during debugging.
   
AFAICS the created url from the page link is correct in terms of utf-8
encoding, but the parsed query string seems to be wrong, as it contains
only the ?...
   
We have the following in our AppModule:
   
public void contributeRequestHandler(
OrderedConfigurationRequestFilter configuration,
@InjectService(TimingFilter)
final RequestFilter filter, @InjectService(Utf8Filter)
final RequestFilter utf8Filter ) {
configuration.add( Timing, filter );
configuration.add( Utf8Filter, utf8Filter ); // handle UTF-8
}
   
public RequestFilter buildUtf8Filter(
@InjectService(RequestGlobals)
final RequestGlobals requestGlobals ) {
return new RequestFilter() {
public boolean service( Request request, Response response,
RequestHandler handler ) throws IOException {

requestGlobals.getHTTPServletRequest().setCharacterEncoding(
UTF-8 );
return handler.service( request, response );
}
};
}
   
public static PageResponseRenderer decoratePageResponseRenderer(
@InjectService(PageMarkupRenderer)
final PageMarkupRenderer markupRenderer,
@InjectService(MarkupWriterFactory)
final MarkupWriterFactory markupWriterFactory, final Object
delegate ) {
   
return new PageResponseRenderer() {
public void renderPageResponse( Page page, Response 
response )
throws IOException {
MarkupWriter writer =
markupWriterFactory.newMarkupWriter

T5 XHTML compliant markup

2007-06-18 Thread Martin Grotzke
Hi,

T5 currently renders markup that is not XHTML compliant.

E.g. the element 'meta http-equiv=Content-Type content=text/html;
charset=utf-8 /' is rendered as 'meta content=text/html;
charset=utf-8 http-equiv=Content-Type' - the tag is not closed
properly.

Is there any way to force T5 to generate XHTML compliant markup?

Thx  cheers,
Martin





signature.asc
Description: This is a digitally signed message part


T5 validation error images displayed with form.clientValidation=false

2007-06-18 Thread Martin Grotzke
Hi,

even if you set clientValidation=false on a form, T5 renders the
validation error image for all input components (for validation
errors that might occur):

img alt=[Error] class=t-error-icon t-invisible id=cancel:icon 
src=/app/assets/tapestry/field-error-marker.png

AFAICS with clientValidation=false this should not be needed and
markup could be improved + page load time reduced.

Shall we submit an issue for this / would a patch be welcome?

Cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5 XHTML compliant markup

2007-06-18 Thread Martin Grotzke
Our template uses the following DOCTYPE definition:

!DOCTYPE html
 PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

What's wrong with this to get well-formed XML?

Thx  cheers,
Martin




On Mon, 2007-06-18 at 10:29 -0700, Howard Lewis Ship wrote:
 To elaborate; Tapestry uses the !DOCTYPE of the component template
 to determine the type of markup it will send; when the !DOCTYPE is
 omitted, it is assumed to be legacy HTML as defined by SGML, where
 many element are unclosed.  When you provide an explicit !DOCTYPE,
 Tapestry switches over to rendering out well-formed XML.
 
 On 6/18/07, Robin Ericsson [EMAIL PROTECTED] wrote:
  On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
   Hi,
  
   T5 currently renders markup that is not XHTML compliant.
 
  Yes and no.
 
   E.g. the element 'meta http-equiv=Content-Type content=text/html;
   charset=utf-8 /' is rendered as 'meta content=text/html;
   charset=utf-8 http-equiv=Content-Type' - the tag is not closed
   properly.
  
   Is there any way to force T5 to generate XHTML compliant markup?
 
  If your template uses HTML (SGML) markup, T5 generates HTML markup, if
  your template uses XHTML, T5 generates XHTML. See previous posts on
  this list.
 
  --
  regards,
  Robin
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 validation error images displayed with form.clientValidation=false

2007-06-18 Thread Martin Grotzke
Created https://issues.apache.org/jira/browse/TAPESTRY-1588,
a patch will follow soon hopefully :)

Cheers,
Martin


On Mon, 2007-06-18 at 10:26 -0700, Howard Lewis Ship wrote:
 An issue or a patch will be fine.
 
 On 6/18/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi,
 
  even if you set clientValidation=false on a form, T5 renders the
  validation error image for all input components (for validation
  errors that might occur):
 
  img alt=[Error] class=t-error-icon t-invisible id=cancel:icon 
  src=/app/assets/tapestry/field-error-marker.png
 
  AFAICS with clientValidation=false this should not be needed and
  markup could be improved + page load time reduced.
 
  Shall we submit an issue for this / would a patch be welcome?
 
  Cheers,
  Martin
 
 
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 encoding issue

2007-06-17 Thread Martin Grotzke
On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote:
 In case you are using Tomcat try adding URIEncoding=UTF-8 to your
 connector definition in server.xml.
I just tried that, but it does not solve the problem.

I have added a servlet filter that prints the requested uri to
the std out, just to see what is the input for T5.

The URIEncoding=UTF-8 does not change what's printed by the
filter, but the argument that's passed to my page class' onActivate
is different.

Without URIEncoding=UTF-8:

[INFO ] 2007-06-17 22:52:37,956 http-8080-1 
org.comp.proj.presentation.util.EncodingFilter.doFilter:
- uri: /shopping24-shop/search/tr%C3%BCb
- path: null

[INFO ] 2007-06-17 22:52:51,303 http-8080-1 
org.comp.proj.presentation.pages.Search.onActivate:
Got invoked args tr??b

With URIEncoding=UTF-8:

[INFO ] 2007-06-17 22:54:33,398 http-8080-1 
org.comp.proj.presentation.util.EncodingFilter.doFilter:
uri: /shopping24-shop/search/tr%C3%BCb

[INFO ] 2007-06-17 22:54:44,620 http-8080-1 
org.comp.proj.presentation.pages.Search.onActivate:
Got invoked args tr?b


Is there anything else that I could do to get the correct
decoding of the request parameters / uri?

Thanx  cheers,
Martin



 
 Uli
 
 On Mo, 11.06.2007, 23:13, Martin Grotzke sagte:
  Hi,
 
  I have currently an encoding issue, but am not really sure what's
  the reason for this.
 
  I have an url that contains a url encoded german umlaut (ü) in UTF-8
  and looks like the following:
 
  http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü
  in UTF-8, this url is created by
  componentResources.createPageLink( search, new Object[]{ _query } )
  in the submit method of the search page)
 
  Now, when I look in the onActivate(string) method, the string is not
  übel but it's ?bel, both printed via logging as when I inspect the
  variable during debugging.
 
  AFAICS the created url from the page link is correct in terms of utf-8
  encoding, but the parsed query string seems to be wrong, as it contains
  only the ?...
 
  We have the following in our AppModule:
 
  public void contributeRequestHandler(
  OrderedConfigurationRequestFilter configuration,
  @InjectService(TimingFilter)
  final RequestFilter filter, @InjectService(Utf8Filter)
  final RequestFilter utf8Filter ) {
  configuration.add( Timing, filter );
  configuration.add( Utf8Filter, utf8Filter ); // handle UTF-8
  }
 
  public RequestFilter buildUtf8Filter(
  @InjectService(RequestGlobals)
  final RequestGlobals requestGlobals ) {
  return new RequestFilter() {
  public boolean service( Request request, Response response,
  RequestHandler handler ) throws IOException {
  requestGlobals.getHTTPServletRequest().setCharacterEncoding(
  UTF-8 );
  return handler.service( request, response );
  }
  };
  }
 
  public static PageResponseRenderer decoratePageResponseRenderer(
  @InjectService(PageMarkupRenderer)
  final PageMarkupRenderer markupRenderer,
  @InjectService(MarkupWriterFactory)
  final MarkupWriterFactory markupWriterFactory, final Object
  delegate ) {
 
  return new PageResponseRenderer() {
  public void renderPageResponse( Page page, Response response )
  throws IOException {
  MarkupWriter writer =
  markupWriterFactory.newMarkupWriter();
  markupRenderer.renderPageMarkup( page, writer );
  PrintWriter pw = response
  .getPrintWriter( text/html; charset=UTF-8 );
  writer.toMarkup( pw );
  pw.flush();
  }
  };
  }
 
  Is there anything wrong, or what am I missing?
 
  Thanx  cheers,
  Martin
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 encoding issue

2007-06-17 Thread Martin Grotzke
I just stepped through the sources to see where the URI get's
decoded to the activation context arguments, and found that the
o.a.t.internal.services.PageRenderDispatcher.dispatch invokes
convertActivationContext with the path info to convert it to
the activation context args.

convertActivationContext uses TapestryInternalUtils.urlDecode
which invokes URLCodec.decode. It seems that this causes the
problem, but I cannot say what exactly is the reason.

When I remove the invocation of TapestryInternalUtils.urlDecode
everything's fine...

Any help with this issue?

Thanx  cheers,
Martin


On Sun, 2007-06-17 at 23:01 +0200, Martin Grotzke wrote:
 On Tue, 2007-06-12 at 10:38 +0200, Ulrich Stärk wrote:
  In case you are using Tomcat try adding URIEncoding=UTF-8 to your
  connector definition in server.xml.
 I just tried that, but it does not solve the problem.
 
 I have added a servlet filter that prints the requested uri to
 the std out, just to see what is the input for T5.
 
 The URIEncoding=UTF-8 does not change what's printed by the
 filter, but the argument that's passed to my page class' onActivate
 is different.
 
 Without URIEncoding=UTF-8:
 
 [INFO ] 2007-06-17 22:52:37,956 http-8080-1 
 org.comp.proj.presentation.util.EncodingFilter.doFilter:
 - uri: /shopping24-shop/search/tr%C3%BCb
 - path: null
 
 [INFO ] 2007-06-17 22:52:51,303 http-8080-1 
 org.comp.proj.presentation.pages.Search.onActivate:
 Got invoked args tr??b
 
 With URIEncoding=UTF-8:
 
 [INFO ] 2007-06-17 22:54:33,398 http-8080-1 
 org.comp.proj.presentation.util.EncodingFilter.doFilter:
 uri: /shopping24-shop/search/tr%C3%BCb
 
 [INFO ] 2007-06-17 22:54:44,620 http-8080-1 
 org.comp.proj.presentation.pages.Search.onActivate:
 Got invoked args tr?b
 
 
 Is there anything else that I could do to get the correct
 decoding of the request parameters / uri?
 
 Thanx  cheers,
 Martin
 
 
 
  
  Uli
  
  On Mo, 11.06.2007, 23:13, Martin Grotzke sagte:
   Hi,
  
   I have currently an encoding issue, but am not really sure what's
   the reason for this.
  
   I have an url that contains a url encoded german umlaut (ü) in UTF-8
   and looks like the following:
  
   http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü
   in UTF-8, this url is created by
   componentResources.createPageLink( search, new Object[]{ _query } )
   in the submit method of the search page)
  
   Now, when I look in the onActivate(string) method, the string is not
   übel but it's ?bel, both printed via logging as when I inspect the
   variable during debugging.
  
   AFAICS the created url from the page link is correct in terms of utf-8
   encoding, but the parsed query string seems to be wrong, as it contains
   only the ?...
  
   We have the following in our AppModule:
  
   public void contributeRequestHandler(
   OrderedConfigurationRequestFilter configuration,
   @InjectService(TimingFilter)
   final RequestFilter filter, @InjectService(Utf8Filter)
   final RequestFilter utf8Filter ) {
   configuration.add( Timing, filter );
   configuration.add( Utf8Filter, utf8Filter ); // handle UTF-8
   }
  
   public RequestFilter buildUtf8Filter(
   @InjectService(RequestGlobals)
   final RequestGlobals requestGlobals ) {
   return new RequestFilter() {
   public boolean service( Request request, Response response,
   RequestHandler handler ) throws IOException {
   
   requestGlobals.getHTTPServletRequest().setCharacterEncoding(
   UTF-8 );
   return handler.service( request, response );
   }
   };
   }
  
   public static PageResponseRenderer decoratePageResponseRenderer(
   @InjectService(PageMarkupRenderer)
   final PageMarkupRenderer markupRenderer,
   @InjectService(MarkupWriterFactory)
   final MarkupWriterFactory markupWriterFactory, final Object
   delegate ) {
  
   return new PageResponseRenderer() {
   public void renderPageResponse( Page page, Response response )
   throws IOException {
   MarkupWriter writer =
   markupWriterFactory.newMarkupWriter();
   markupRenderer.renderPageMarkup( page, writer );
   PrintWriter pw = response
   .getPrintWriter( text/html; charset=UTF-8 );
   writer.toMarkup( pw );
   pw.flush();
   }
   };
   }
  
   Is there anything wrong, or what am I missing?
  
   Thanx  cheers,
   Martin
  
  
  
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-14 Thread Martin Grotzke
On Thu, 2007-06-14 at 07:51 +0200, Jiri Mares wrote:
 Okay,
 
 I understand, write test for checking this particular thing and you can be 
 calm.
Yeah, but what to do when the test fails then? Rewrite creation
of dummy fields to whatever, or pull all fields for the whole
application in page classes.

Unit tests help to detect the problem then, but do not solve it
basically ;)

And I'm still interested, why the interface expects a Field,
if only the element name is used - mostly there's some reason... ;)

 
 How are you satisfied with using Hibernate Validator?
Two issues until now:
- the NotNull validator is applied even if you turn off validation,
  however, all other validators are not applied. We wrote our own
  NotNull validator as a workaround - really simple
- integration with spring is not designed if you have your own
  validators - so there's no validatorfactory or anything, so
  that you have to pull other resources like DAOs or services
  from the spring bean factory if you need them

Apart from that it feels really good.

Cheers,
Martin


 
 jirka
 
 Martin Grotzke napsal(a):
  Yes, we already did this, but this works only as long as the internals
  of tapestry do not change. E.g. if another property of Field would be
  used or e.g. the hashCode or equals methods would be used, our
  application would be broken.
  
  That's why I ask for a modification of the interface.
  
  Cheers,
  Martin
  
  
  On Wed, 2007-06-13 at 09:26 +0200, Jiri Mares wrote:
  Hi Martin,
 
  why not to implement your own Field and fill it with the name and pass it 
  into recordError?
 
  Jirka
 
  Martin Grotzke napsal(a):
  Yes, I totally understand and it's of course very important that
  you do not change the API each time a user asks for it.
 
  The question in this case is then: why does the interface require
  a Field? It's only the Field's elementName that is used for the
  recordError functionality, so is it only for convenience, that
  recordError expects a Field, so that users do not have to do
  s.th. like recordError(_field.getElementName(), foo)?
 
  Or is there another reason why recordError asks for a Field?
 
  Cheers,
  Martin
 
 
  On Tue, 2007-06-12 at 10:54 -0700, Howard Lewis Ship wrote:
  There's a long history in Tapestry of any time there's a hint of extra
  API, people find a way to abuse it. So I'm being very, very
  conservative!
 
  On 6/12/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  And what are your concerns with an additional method
  recordError(String,String) on the ValidationTracker (and Form)?
 
  Cheers,
  Martin
 
 
  On Tue, 2007-06-12 at 09:19 -0700, Howard Lewis Ship wrote:
  I'm not familiar enough with Hibernate Validator to say.
 
  On 6/11/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi Howard,
 
  On Sat, 2007-06-09 at 22:44 +0200, Martin Grotzke wrote:
  Does this enable us to use hibernate validator in our business layer
  that is completely independent from tapestry?
  Hibernate validator is right now our favorite option for validation,
  but it might be that we have to use an own implementation - we're 
  still
  evaluating.
 
  What we're sure about is that in the business layer validation is
  performed and that for each validation error details are provided
  that should allow the presentation layer to map this information
  to a specific field/element.
 
  IMHO a good solution for this use case is recording the error with
  the element name, without being forced to have a Field for each
  element.
 
  What do you think?
  Do you have any comments/feedback concerning this?
 
  Thanx  cheers,
  Martin
 
 
  Cheers,
  Martin
 
 
 
  On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
  That's true ... though I expect to make Tapestry smarter about
  recognizing the Hibernate annotations and producing automatic 
  client-
  and server-side validation for them.
 
  On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  We want to do validation in the business layer (with hibernate
  validator) and get back an exception with a list of invalid values,
  where each invalid value provides the property path.
 
  Then we want to have a mapping of the property path to the element
  name and record an error for this on the tapestry form.
 
  The value is to be able to use hibernate validator in our business
  layer and not to be forced to define each Field in the page class,
  which is better in terms of performance and saves unnecessary work.
 
  Cheers,
  Martin
 
 
  On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
  I don't see the value ... how would you obtain the element name
  without getting the field itself; and if you've injected the 
  field (to
  invoke getElementName() ), then why wouldn't you just pass the 
  field
  to the tracker?
 
  Convince me there's something actually missing.
 
  On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hello,
 
  right now there's a recordError(Field,String) method for storing
  errors for elements

Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-14 Thread Martin Grotzke
On Thu, 2007-06-14 at 09:44 +0200, Jiri Mares wrote:
 Hi,
 
  Yeah, but what to do when the test fails then? Rewrite creation
  of dummy fields to whatever, or pull all fields for the whole
  application in page classes.
  
  Unit tests help to detect the problem then, but do not solve it
  basically ;)
  
  And I'm still interested, why the interface expects a Field,
  if only the element name is used - mostly there's some reason... ;)
 
 you have to encapsulate to code into one method to be able to change it 
 easilly, nothing more ...
Sorry, but I don't understand what you want to say with this...

Cheers,
Martin


 
  How are you satisfied with using Hibernate Validator?
  Two issues until now:
  - the NotNull validator is applied even if you turn off validation,
however, all other validators are not applied. We wrote our own
NotNull validator as a workaround - really simple
  - integration with spring is not designed if you have your own
validators - so there's no validatorfactory or anything, so
that you have to pull other resources like DAOs or services
from the spring bean factory if you need them
  
  Apart from that it feels really good.
 
 Thanks for your opinion ...
 
 Jirka
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-14 Thread Martin Grotzke
On Thu, 2007-06-14 at 10:54 +0200, Jiri Mares wrote:
  you have to encapsulate to code into one method to be able to change it 
  easilly, nothing more ...
  Sorry, but I don't understand what you want to say with this...
 
 The code adding the field error have to be on one place, not spread through 
 whole application to be easilly changed when
 the future versions of Tapestry will require.
 
 Eg. method:
 
 void addValidationError(HibernateValidateException ex) {
   Field f = new MyField(getFieldNameFromValidateException(ex));
   recordError(f, getErrorMessageFromValidateException(ex));
 }
 
 This method you would invoke everywhere where the validation exception is 
 catched, so when the change will be necessary,
 anly this method will be changed.
Yes, but as I already said previously, IMHO this is not really solid:
what do you do when T5 starts using the equals method of the Field
in some way? Or it would start to use other informations - ok, there is
not much in the Field - but according to the interface it would be
totally legal... Do you see my point?

I just wanted to ask why the interface is looking like that and if it
would be possible to simplify it.
So if there's absolutely no way in this direction I think we have to
accept it - though it's the first thing that introduces breakability
into our app. Apart from this one issue T5 is really wonderful!

Cheers,
Martin


 
 Jirka
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-14 Thread Martin Grotzke
On Thu, 2007-06-14 at 11:18 +0200, Jiri Mares wrote:
  you have to encapsulate to code into one method to be able to change it 
  easilly, nothing more ...
  Sorry, but I don't understand what you want to say with this...
  The code adding the field error have to be on one place, not spread 
  through whole application to be easilly changed when
  the future versions of Tapestry will require.
 
  Eg. method:
 
  void addValidationError(HibernateValidateException ex) {
Field f = new MyField(getFieldNameFromValidateException(ex));
recordError(f, getErrorMessageFromValidateException(ex));
  }
 
  This method you would invoke everywhere where the validation exception is 
  catched, so when the change will be necessary,
  anly this method will be changed.
  Yes, but as I already said previously, IMHO this is not really solid:
  what do you do when T5 starts using the equals method of the Field
  in some way? Or it would start to use other informations - ok, there is
  not much in the Field - but according to the interface it would be
  totally legal... Do you see my point?
 
 Yes, I understand ... then the addValidationError method would in some way 
 look up the Field instances via Page and the
 name ...
Ok, solution for this case ;)

Cheers,
Martin


 
 Jirka
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-13 Thread Martin Grotzke
Yes, I totally understand and it's of course very important that
you do not change the API each time a user asks for it.

The question in this case is then: why does the interface require
a Field? It's only the Field's elementName that is used for the
recordError functionality, so is it only for convenience, that
recordError expects a Field, so that users do not have to do
s.th. like recordError(_field.getElementName(), foo)?

Or is there another reason why recordError asks for a Field?

Cheers,
Martin


On Tue, 2007-06-12 at 10:54 -0700, Howard Lewis Ship wrote:
 There's a long history in Tapestry of any time there's a hint of extra
 API, people find a way to abuse it. So I'm being very, very
 conservative!
 
 On 6/12/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  And what are your concerns with an additional method
  recordError(String,String) on the ValidationTracker (and Form)?
 
  Cheers,
  Martin
 
 
  On Tue, 2007-06-12 at 09:19 -0700, Howard Lewis Ship wrote:
   I'm not familiar enough with Hibernate Validator to say.
  
   On 6/11/07, Martin Grotzke [EMAIL PROTECTED] wrote:
Hi Howard,
   
On Sat, 2007-06-09 at 22:44 +0200, Martin Grotzke wrote:
 Does this enable us to use hibernate validator in our business layer
 that is completely independent from tapestry?
 Hibernate validator is right now our favorite option for validation,
 but it might be that we have to use an own implementation - we're 
 still
 evaluating.

 What we're sure about is that in the business layer validation is
 performed and that for each validation error details are provided
 that should allow the presentation layer to map this information
 to a specific field/element.

 IMHO a good solution for this use case is recording the error with
 the element name, without being forced to have a Field for each
 element.

 What do you think?
Do you have any comments/feedback concerning this?
   
Thanx  cheers,
Martin
   
   

 Cheers,
 Martin



 On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
  That's true ... though I expect to make Tapestry smarter about
  recognizing the Hibernate annotations and producing automatic 
  client-
  and server-side validation for them.
 
  On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
   We want to do validation in the business layer (with hibernate
   validator) and get back an exception with a list of invalid 
   values,
   where each invalid value provides the property path.
  
   Then we want to have a mapping of the property path to the element
   name and record an error for this on the tapestry form.
  
   The value is to be able to use hibernate validator in our business
   layer and not to be forced to define each Field in the page class,
   which is better in terms of performance and saves unnecessary 
   work.
  
   Cheers,
   Martin
  
  
   On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
I don't see the value ... how would you obtain the element name
without getting the field itself; and if you've injected the 
field (to
invoke getElementName() ), then why wouldn't you just pass the 
field
to the tracker?
   
Convince me there's something actually missing.
   
On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 Hello,

 right now there's a recordError(Field,String) method for 
 storing
 errors for elements of the page.

 We would like to have also a method 
 recordError(String,String) where
 the first parameter is the element name.

 The ValidationTrackerImpl seems to use only the elementName 
 of the
 Field:

 private FieldTracker get(Field field)
 {
 String key = field.getElementName();

 refreshFieldToTracker();

 FieldTracker result = 
 InternalUtils.get(_fieldToTracker, key);

 if (result == null)
 result = new FieldTracker(key);

 return result;
 }

 so an additional method seems to be not a big issue.

 Would this be possible to add to T5? Shall we submit a patch 
 for this
 here in the list or enter an issue?

 Thanx  cheers,
 Martin


 --
 Martin Grotzke
 Dipl.-Inf.

 freiheit.com technologies gmbh
 Straßenbahnring 22 / 20251 Hamburg, Germany
 fon   +49 (0)40 / 890584-0
 fax   +49 (0)40 / 890584-20
 HRB Hamburg 70814

 eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
 Geschäftsführer: Claudia Dietze

Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-13 Thread Martin Grotzke
Yes, we already did this, but this works only as long as the internals
of tapestry do not change. E.g. if another property of Field would be
used or e.g. the hashCode or equals methods would be used, our
application would be broken.

That's why I ask for a modification of the interface.

Cheers,
Martin


On Wed, 2007-06-13 at 09:26 +0200, Jiri Mares wrote:
 Hi Martin,
 
 why not to implement your own Field and fill it with the name and pass it 
 into recordError?
 
 Jirka
 
 Martin Grotzke napsal(a):
  Yes, I totally understand and it's of course very important that
  you do not change the API each time a user asks for it.
  
  The question in this case is then: why does the interface require
  a Field? It's only the Field's elementName that is used for the
  recordError functionality, so is it only for convenience, that
  recordError expects a Field, so that users do not have to do
  s.th. like recordError(_field.getElementName(), foo)?
  
  Or is there another reason why recordError asks for a Field?
  
  Cheers,
  Martin
  
  
  On Tue, 2007-06-12 at 10:54 -0700, Howard Lewis Ship wrote:
  There's a long history in Tapestry of any time there's a hint of extra
  API, people find a way to abuse it. So I'm being very, very
  conservative!
 
  On 6/12/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  And what are your concerns with an additional method
  recordError(String,String) on the ValidationTracker (and Form)?
 
  Cheers,
  Martin
 
 
  On Tue, 2007-06-12 at 09:19 -0700, Howard Lewis Ship wrote:
  I'm not familiar enough with Hibernate Validator to say.
 
  On 6/11/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi Howard,
 
  On Sat, 2007-06-09 at 22:44 +0200, Martin Grotzke wrote:
  Does this enable us to use hibernate validator in our business layer
  that is completely independent from tapestry?
  Hibernate validator is right now our favorite option for validation,
  but it might be that we have to use an own implementation - we're still
  evaluating.
 
  What we're sure about is that in the business layer validation is
  performed and that for each validation error details are provided
  that should allow the presentation layer to map this information
  to a specific field/element.
 
  IMHO a good solution for this use case is recording the error with
  the element name, without being forced to have a Field for each
  element.
 
  What do you think?
  Do you have any comments/feedback concerning this?
 
  Thanx  cheers,
  Martin
 
 
  Cheers,
  Martin
 
 
 
  On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
  That's true ... though I expect to make Tapestry smarter about
  recognizing the Hibernate annotations and producing automatic client-
  and server-side validation for them.
 
  On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  We want to do validation in the business layer (with hibernate
  validator) and get back an exception with a list of invalid values,
  where each invalid value provides the property path.
 
  Then we want to have a mapping of the property path to the element
  name and record an error for this on the tapestry form.
 
  The value is to be able to use hibernate validator in our business
  layer and not to be forced to define each Field in the page class,
  which is better in terms of performance and saves unnecessary work.
 
  Cheers,
  Martin
 
 
  On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
  I don't see the value ... how would you obtain the element name
  without getting the field itself; and if you've injected the field 
  (to
  invoke getElementName() ), then why wouldn't you just pass the field
  to the tracker?
 
  Convince me there's something actually missing.
 
  On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hello,
 
  right now there's a recordError(Field,String) method for storing
  errors for elements of the page.
 
  We would like to have also a method recordError(String,String) 
  where
  the first parameter is the element name.
 
  The ValidationTrackerImpl seems to use only the elementName of the
  Field:
 
  private FieldTracker get(Field field)
  {
  String key = field.getElementName();
 
  refreshFieldToTracker();
 
  FieldTracker result = InternalUtils.get(_fieldToTracker, 
  key);
 
  if (result == null)
  result = new FieldTracker(key);
 
  return result;
  }
 
  so an additional method seems to be not a big issue.
 
  Would this be possible to add to T5? Shall we submit a patch for 
  this
  here in the list or enter an issue?
 
  Thanx  cheers,
  Martin
 
 
  --
  Martin Grotzke
  Dipl.-Inf.
 
  freiheit.com technologies gmbh
  Straßenbahnring 22 / 20251 Hamburg, Germany
  fon   +49 (0)40 / 890584-0
  fax   +49 (0)40 / 890584-20
  HRB Hamburg 70814
 
  eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
  Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
 
 
 
  --
  Martin Grotzke
  http://www.javakaffee.de/blog

Re: T5 included javascript libraries

2007-06-11 Thread Martin Grotzke
Are these js files used at all? I ask as they increase loading time
and I'd like to remove them if they're not used...

However, wait 5 days and I'll ask how to start with ajax in T5 ;)

Cheers,
Martin


On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
 You have some control, via contributions to the ApplicationDefaults
 service configuration, over where the files come from, so you can use
 a different version of prototype  scriptaculous than the ones
 provided with Tapestry.  However, we have yet to take a crack at an
 abstraction layer that would allow you to replace ps with some other
 similar library, such as Dojo.
 
 On 6/10/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi,
 
  T5 adds several js libraries to the body, e.g. prototype.js,
  scriptaculous.js and others.
 
  Are they all required, or is there a possibility to affect
  which libs are added to the body?
 
  Thx  cheers,
  Martin
 
 
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5 included javascript libraries

2007-06-11 Thread Martin Grotzke
Thanx for this explanation, Adam!

I just set clientValidation to false for my form, however, the js files
are added to body. Is it somehow possible to tell T5 not to add
these libraries (or scriptaculous.js) to the body?

Otherwise, as a very ugly hack, it should be possible to replace the
js files by empty ones, as long as we're using none of them...
What do I have to add to the configuration in
contributeApplicationDefaults to specify the
js/empty/scriptaculous.js? Or where do I find documentation concerning
this question?

Thanx a lot,
cheers,
Martin


On Mon, 2007-06-11 at 01:39 -0700, Adam Ayres wrote:
 From what I can tell only the Form component uses prototype and
 scriptaculous when the clientValidation parameter is set to true (which
 is the default).  The tapestry.js that is added as part of the Form
 component uses some of the element and event helper methods from
 prototype and some of the effects from scriptaculous.
 
 The way the scriptaculous library works is that when the base
 scriptaculous.js is included in a page all of the various files for the
 library (builder, controls, dragdrop, etc) are dynamically added as
 additional script tags within the body of the HTML, no matter if the
 individual components are used or not.  This has the negative side
 effect of making the rendered page code ugly (and difficult to
 troubleshoot in firebug) as well as creating 5 additional server
 requests.
 
 I would suggest replacing the default prototype and scriptaculous
 libraries with a minified (and compressed) version:
 
 http://groups.google.com/group/prototype-core/browse_thread/thread/40e58
 15f5bc5fba9
 
 http://protoculous.wikeo.be/
 
 Currently using one of these solutions that combines prototype and
 scriptaculous is not possible with the Form component since it wants to
 add a separate file for both prototype and scriptaculous.  However
 adding compressed versions for each works.
 
 Adam
 
 
 -Original Message-
 From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
 Sent: Monday, June 11, 2007 1:02 AM
 To: Tapestry users
 Subject: Re: T5 included javascript libraries
 
 Are these js files used at all? I ask as they increase loading time
 and I'd like to remove them if they're not used...
 
 However, wait 5 days and I'll ask how to start with ajax in T5 ;)
 
 Cheers,
 Martin
 
 
 On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
  You have some control, via contributions to the ApplicationDefaults
  service configuration, over where the files come from, so you can use
  a different version of prototype  scriptaculous than the ones
  provided with Tapestry.  However, we have yet to take a crack at an
  abstraction layer that would allow you to replace ps with some other
  similar library, such as Dojo.
  
  On 6/10/07, Martin Grotzke [EMAIL PROTECTED] wrote:
   Hi,
  
   T5 adds several js libraries to the body, e.g. prototype.js,
   scriptaculous.js and others.
  
   Are they all required, or is there a possibility to affect
   which libs are added to the body?
  
   Thx  cheers,
   Martin
  
  
  
  
  
  
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-11 Thread Martin Grotzke
Hi Howard,

On Sat, 2007-06-09 at 22:44 +0200, Martin Grotzke wrote:
 Does this enable us to use hibernate validator in our business layer
 that is completely independent from tapestry?
 Hibernate validator is right now our favorite option for validation,
 but it might be that we have to use an own implementation - we're still
 evaluating.
 
 What we're sure about is that in the business layer validation is
 performed and that for each validation error details are provided
 that should allow the presentation layer to map this information
 to a specific field/element.
 
 IMHO a good solution for this use case is recording the error with
 the element name, without being forced to have a Field for each
 element.
 
 What do you think?
Do you have any comments/feedback concerning this?

Thanx  cheers,
Martin


 
 Cheers,
 Martin
 
 
 
 On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
  That's true ... though I expect to make Tapestry smarter about
  recognizing the Hibernate annotations and producing automatic client-
  and server-side validation for them.
  
  On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
   We want to do validation in the business layer (with hibernate
   validator) and get back an exception with a list of invalid values,
   where each invalid value provides the property path.
  
   Then we want to have a mapping of the property path to the element
   name and record an error for this on the tapestry form.
  
   The value is to be able to use hibernate validator in our business
   layer and not to be forced to define each Field in the page class,
   which is better in terms of performance and saves unnecessary work.
  
   Cheers,
   Martin
  
  
   On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
I don't see the value ... how would you obtain the element name
without getting the field itself; and if you've injected the field (to
invoke getElementName() ), then why wouldn't you just pass the field
to the tracker?
   
Convince me there's something actually missing.
   
On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
 Hello,

 right now there's a recordError(Field,String) method for storing
 errors for elements of the page.

 We would like to have also a method recordError(String,String) where
 the first parameter is the element name.

 The ValidationTrackerImpl seems to use only the elementName of the
 Field:

 private FieldTracker get(Field field)
 {
 String key = field.getElementName();

 refreshFieldToTracker();

 FieldTracker result = InternalUtils.get(_fieldToTracker, key);

 if (result == null)
 result = new FieldTracker(key);

 return result;
 }

 so an additional method seems to be not a big issue.

 Would this be possible to add to T5? Shall we submit a patch for this
 here in the list or enter an issue?

 Thanx  cheers,
 Martin


 --
 Martin Grotzke
 Dipl.-Inf.

 freiheit.com technologies gmbh
 Straßenbahnring 22 / 20251 Hamburg, Germany
 fon   +49 (0)40 / 890584-0
 fax   +49 (0)40 / 890584-20
 HRB Hamburg 70814

 eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
 Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


   
   
   --
   Martin Grotzke
   http://www.javakaffee.de/blog/
  
  
  
  
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5 included javascript libraries

2007-06-11 Thread Martin Grotzke
On Mon, 2007-06-11 at 11:25 +0200, Martin Grotzke wrote:
 Thanx for this explanation, Adam!
 
 I just set clientValidation to false for my form, however, the js files
 are added to body. Is it somehow possible to tell T5 not to add
 these libraries (or scriptaculous.js) to the body?
Ouuups, sorry, my fault! There was still another form in our layout
template that didn't have the clientValidation=false - now I've set
this and js libs are added to the body - really cool!

Thanx for your help,
cheers,
Martin


 
 Otherwise, as a very ugly hack, it should be possible to replace the
 js files by empty ones, as long as we're using none of them...
 What do I have to add to the configuration in
 contributeApplicationDefaults to specify the
 js/empty/scriptaculous.js? Or where do I find documentation concerning
 this question?
 
 Thanx a lot,
 cheers,
 Martin
 
 
 On Mon, 2007-06-11 at 01:39 -0700, Adam Ayres wrote:
  From what I can tell only the Form component uses prototype and
  scriptaculous when the clientValidation parameter is set to true (which
  is the default).  The tapestry.js that is added as part of the Form
  component uses some of the element and event helper methods from
  prototype and some of the effects from scriptaculous.
  
  The way the scriptaculous library works is that when the base
  scriptaculous.js is included in a page all of the various files for the
  library (builder, controls, dragdrop, etc) are dynamically added as
  additional script tags within the body of the HTML, no matter if the
  individual components are used or not.  This has the negative side
  effect of making the rendered page code ugly (and difficult to
  troubleshoot in firebug) as well as creating 5 additional server
  requests.
  
  I would suggest replacing the default prototype and scriptaculous
  libraries with a minified (and compressed) version:
  
  http://groups.google.com/group/prototype-core/browse_thread/thread/40e58
  15f5bc5fba9
  
  http://protoculous.wikeo.be/
  
  Currently using one of these solutions that combines prototype and
  scriptaculous is not possible with the Form component since it wants to
  add a separate file for both prototype and scriptaculous.  However
  adding compressed versions for each works.
  
  Adam
  
  
  -Original Message-
  From: Martin Grotzke [mailto:[EMAIL PROTECTED] 
  Sent: Monday, June 11, 2007 1:02 AM
  To: Tapestry users
  Subject: Re: T5 included javascript libraries
  
  Are these js files used at all? I ask as they increase loading time
  and I'd like to remove them if they're not used...
  
  However, wait 5 days and I'll ask how to start with ajax in T5 ;)
  
  Cheers,
  Martin
  
  
  On Sun, 2007-06-10 at 23:50 -0700, Howard Lewis Ship wrote:
   You have some control, via contributions to the ApplicationDefaults
   service configuration, over where the files come from, so you can use
   a different version of prototype  scriptaculous than the ones
   provided with Tapestry.  However, we have yet to take a crack at an
   abstraction layer that would allow you to replace ps with some other
   similar library, such as Dojo.
   
   On 6/10/07, Martin Grotzke [EMAIL PROTECTED] wrote:
Hi,
   
T5 adds several js libraries to the body, e.g. prototype.js,
scriptaculous.js and others.
   
Are they all required, or is there a possibility to affect
which libs are added to the body?
   
Thx  cheers,
Martin
   
   
   
   
   
   
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


T5 encoding issue

2007-06-11 Thread Martin Grotzke
Hi,

I have currently an encoding issue, but am not really sure what's
the reason for this.

I have an url that contains a url encoded german umlaut (ü) in UTF-8
and looks like the following:

http://localhost:8080/app/search/%C3%BCbel (the %C3%BC represents the ü
in UTF-8, this url is created by
componentResources.createPageLink( search, new Object[]{ _query } )
in the submit method of the search page)

Now, when I look in the onActivate(string) method, the string is not
übel but it's ?bel, both printed via logging as when I inspect the
variable during debugging.

AFAICS the created url from the page link is correct in terms of utf-8
encoding, but the parsed query string seems to be wrong, as it contains
only the ?...

We have the following in our AppModule:

public void contributeRequestHandler(
OrderedConfigurationRequestFilter configuration,
@InjectService(TimingFilter)
final RequestFilter filter, @InjectService(Utf8Filter)
final RequestFilter utf8Filter ) {
configuration.add( Timing, filter );
configuration.add( Utf8Filter, utf8Filter ); // handle UTF-8
}

public RequestFilter buildUtf8Filter(
@InjectService(RequestGlobals)
final RequestGlobals requestGlobals ) {
return new RequestFilter() {
public boolean service( Request request, Response response, 
RequestHandler handler ) throws IOException {
requestGlobals.getHTTPServletRequest().setCharacterEncoding( 
UTF-8 );
return handler.service( request, response );
}
};
}

public static PageResponseRenderer decoratePageResponseRenderer(
@InjectService(PageMarkupRenderer)
final PageMarkupRenderer markupRenderer,
@InjectService(MarkupWriterFactory)
final MarkupWriterFactory markupWriterFactory, final Object 
delegate ) {

return new PageResponseRenderer() {
public void renderPageResponse( Page page, Response response )
throws IOException {
MarkupWriter writer = markupWriterFactory.newMarkupWriter();
markupRenderer.renderPageMarkup( page, writer );
PrintWriter pw = response
.getPrintWriter( text/html; charset=UTF-8 );
writer.toMarkup( pw );
pw.flush();
}
};
}

Is there anything wrong, or what am I missing?

Thanx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


T5 included javascript libraries

2007-06-10 Thread Martin Grotzke
Hi,

T5 adds several js libraries to the body, e.g. prototype.js,
scriptaculous.js and others.

Are they all required, or is there a possibility to affect
which libs are added to the body?

Thx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Martin Grotzke
Hello,

right now there's a recordError(Field,String) method for storing
errors for elements of the page.

We would like to have also a method recordError(String,String) where
the first parameter is the element name.

The ValidationTrackerImpl seems to use only the elementName of the
Field:

private FieldTracker get(Field field)
{
String key = field.getElementName();

refreshFieldToTracker();

FieldTracker result = InternalUtils.get(_fieldToTracker, key);

if (result == null)
result = new FieldTracker(key);

return result;
}

so an additional method seems to be not a big issue.

Would this be possible to add to T5? Shall we submit a patch for this
here in the list or enter an issue?

Thanx  cheers,
Martin


-- 
Martin Grotzke
Dipl.-Inf.

freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814

eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof


signature.asc
Description: This is a digitally signed message part


Re: T5 Invoke ValidationTracker recordError with elementName instead of Field

2007-06-09 Thread Martin Grotzke
Does this enable us to use hibernate validator in our business layer
that is completely independent from tapestry?
Hibernate validator is right now our favorite option for validation,
but it might be that we have to use an own implementation - we're still
evaluating.

What we're sure about is that in the business layer validation is
performed and that for each validation error details are provided
that should allow the presentation layer to map this information
to a specific field/element.

IMHO a good solution for this use case is recording the error with
the element name, without being forced to have a Field for each
element.

What do you think?

Cheers,
Martin



On Sat, 2007-06-09 at 12:48 -0700, Howard Lewis Ship wrote:
 That's true ... though I expect to make Tapestry smarter about
 recognizing the Hibernate annotations and producing automatic client-
 and server-side validation for them.
 
 On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  We want to do validation in the business layer (with hibernate
  validator) and get back an exception with a list of invalid values,
  where each invalid value provides the property path.
 
  Then we want to have a mapping of the property path to the element
  name and record an error for this on the tapestry form.
 
  The value is to be able to use hibernate validator in our business
  layer and not to be forced to define each Field in the page class,
  which is better in terms of performance and saves unnecessary work.
 
  Cheers,
  Martin
 
 
  On Sat, 2007-06-09 at 10:07 -0700, Howard Lewis Ship wrote:
   I don't see the value ... how would you obtain the element name
   without getting the field itself; and if you've injected the field (to
   invoke getElementName() ), then why wouldn't you just pass the field
   to the tracker?
  
   Convince me there's something actually missing.
  
   On 6/9/07, Martin Grotzke [EMAIL PROTECTED] wrote:
Hello,
   
right now there's a recordError(Field,String) method for storing
errors for elements of the page.
   
We would like to have also a method recordError(String,String) where
the first parameter is the element name.
   
The ValidationTrackerImpl seems to use only the elementName of the
Field:
   
private FieldTracker get(Field field)
{
String key = field.getElementName();
   
refreshFieldToTracker();
   
FieldTracker result = InternalUtils.get(_fieldToTracker, key);
   
if (result == null)
result = new FieldTracker(key);
   
return result;
}
   
so an additional method seems to be not a big issue.
   
Would this be possible to add to T5? Shall we submit a patch for this
here in the list or enter an issue?
   
Thanx  cheers,
Martin
   
   
--
Martin Grotzke
Dipl.-Inf.
   
freiheit.com technologies gmbh
Straßenbahnring 22 / 20251 Hamburg, Germany
fon   +49 (0)40 / 890584-0
fax   +49 (0)40 / 890584-20
HRB Hamburg 70814
   
eb0e 645c 9730 c8a3 ee2f  1b9a 5de5 21cb c259 fe34
Geschäftsführer: Claudia Dietze, Stefan Richter, Jörg Kirchhof
   
   
  
  
  --
  Martin Grotzke
  http://www.javakaffee.de/blog/
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5: select component with support for attribute multiple

2007-06-07 Thread Martin Grotzke
On Thu, 2007-06-07 at 10:39 +0200, Michael Maier wrote:
 Am 06.06.2007 um 23:00 schrieb Martin Grotzke:
  I didn't change the type of _value to be able to use the component
  with or without multiple=true, but perhaps it's better to have a
  dedicated multiselect component, so the _value could also be a
  collection as in your implementation...
 
 yes that was the goal...I need a multiple selection based on  
 sets...so I can now bind the value to a set and I get a modified set  
 back...
on the other hand, with an additional attribute multiple but the
_value still as an object, it should be possible to integrate that
in the current Select component, which IMHO would be valuable.

cheers,
Martin


 
 cheers
 
 Michael
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5: property lifecycle again

2007-06-07 Thread Martin Grotzke
On Thu, 2007-06-07 at 21:28 +0200, Martin Dietze wrote:
 On Thu, June 07, 2007, Davor Hrg wrote:
 
  It's a guess, but I think that you just need to persist the property.
  @Persist(flash)
 
 That's what I thought, but it does not work. It seems to have
 to do with the way T5 initializes its member variables (my
 guess)... 
Can you post the relevant parts of your code to get a better
idea of what you're doing?

Cheers,
MartinG :)

 
 Cheers,
 
 Martin
 



signature.asc
Description: This is a digitally signed message part


Re: T5: select component with support for attribute multiple

2007-06-06 Thread Martin Grotzke
On Wed, 2007-06-06 at 21:51 +0200, Martin Grotzke wrote:
 Hi,
 
 AFAICS doesn't the select component support the attribute
 multiple, only the first selected option is set on the
 value.
 
 Is there some way to get this to work with support for multiple?

I just extended the current Select component class and added
support for the attribute multiple:
if you specify multiple=true in your template, then the select
component sets a list of converted values on the value property.

There's one issue left: how can I have getters/setters in my page
class that do not work with Object but with a List?

I just tried this, but then tapestry couldn't find the setter for
the value any more...

So I have a setter for an Object now and cast this to List - not
very nice indeed...

Btw: would it be intended to have s.th. like this (support for
multiple) in T5, or is there another approach planned?

Cheers,
Martin



ps. this is the diff:


-public final class Select extends AbstractField
-{
+public class SelectMultiSupport extends AbstractField {
+
 private class Renderer extends SelectModelRenderer
 {

@@ -63,7 +65,19 @@

 private boolean isOptionValueSelected(Object value)
 {
-return value == _value || (value != null  value.equals(_value));
+if (_multiple == null || !_multiple) {
+return value == _value || (value != null  value.equals(_value));
+}
+else {
+if (_value != null) {
+for(Object item : (Iterable)_value) {
+if (value == item || (value != null  
value.equals(item))) {
+return true;
+}
+}
+}
+return false;
+}
 }

 private ValueEncoder getEncoder()
@@ -124,24 +138,55 @@
 @Parameter(required = true, principal = true)
 private Object _value;

+/** The value to read or update. */
+@Parameter(required = false, principal = true)
+private Boolean _multiple;
+
 @Override
 protected void processSubmission(FormSupport formSupport, String 
elementName)
 {
-String primaryKey = _request.getParameter(elementName);
+if (_multiple == null || !_multiple) {

-Object selectedValue = _encoder.toValue(primaryKey);
+String primaryKey = _request.getParameter(elementName);

-try
-{
-_validate.validate(selectedValue);
+Object selectedValue = _encoder.toValue(primaryKey);

-_value = selectedValue;
+try
+{
+_validate.validate(selectedValue);
+
+_value = selectedValue;
+}
+catch (ValidationException ex)
+{
+_tracker.recordError(this, ex.getMessage());
+return;
+}
+
 }
-catch (ValidationException ex)
-{
-_tracker.recordError(this, ex.getMessage());
-return;
+else {
+
+final String[] primaryKeys = _request.getParameters(elementName);
+
+final ListObject selectedValues = new ArrayListObject();
+for(String primaryKey : primaryKeys) {
+final Object selectedValue = _encoder.toValue(primaryKey);
+selectedValues.add( selectedValue );
+}
+
+try
+{
+_validate.validate(selectedValues);
+_value = selectedValues;
+}
+catch (ValidationException ex)
+{
+_tracker.recordError(this, ex.getMessage());
+return;
+}
+
 }
+
 }

 void afterRender(MarkupWriter writer)
@@ -151,7 +196,10 @@

 void beginRender(MarkupWriter writer)
 {
-writer.element(select, name, getElementName(), id, 
getClientId());
+final Object[] attrs = (_multiple == null || !_multiple)
+? new Object[]{name, getElementName(), id, getClientId()}
+: new Object[]{name, getElementName(), id, getClientId(), 
multiple, _multiple};
+writer.element(select, attrs);

 // Disabled, informals via mixins
 }


signature.asc
Description: This is a digitally signed message part


Re: T5: select component with support for attribute multiple

2007-06-06 Thread Martin Grotzke
On Wed, 2007-06-06 at 22:47 +0200, Michael Maier wrote:
 Yes...it seems that multiple selects are not yet supported, but it is  
 very easy to write a component...
You're right, it's really easy to do this - it took about 30 minutes
and some testing :)

 just take the select component from  
 tapestry, look for value and the isOptionValueSelected method. I  
 changed the value to Set type
Do you have getters/setters with a Set then? Does the method signature
depend on the value?

I didn't change the type of _value to be able to use the component
with or without multiple=true, but perhaps it's better to have a
dedicated multiselect component, so the _value could also be a
collection as in your implementation...

Cheers,
Martin


  and changed the
 
  protected void processSubmission(FormSupport formSupport, String  
 elementName) {
 
  String[] primaryKey= _request.getParameters(elementName);
  if( primaryKey != null ) {
  Set selectedValues= new HashSet();
  for( String key : primaryKey ) {
 
  selectedValues.add( _encoder.toValue( key ) );
  } // for
 
  try {
  _validate.validate(selectedValues);
  _value= selectedValues;
 
  } catch (ValidationException ex) {
 
  _tracker.recordError(this, ex.getMessage());
  return;
  }
  } // if
  }
 
 method. Now I have a multiple-select component which takes a value  
 parameter as a set...and it works fine...
 
 cheers
 
 Michael
 
 Am 06.06.2007 um 21:51 schrieb Martin Grotzke:
 
  Hi,
 
  AFAICS doesn't the select component support the attribute
  multiple, only the first selected option is set on the
  value.
 
  Is there some way to get this to work with support for multiple?
 
  Thx  cheers,
  Martin
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5: select component with support for attribute multiple

2007-06-06 Thread Martin Grotzke
On Wed, 2007-06-06 at 16:42 -0400, Daniel Jue wrote:
 I'm not sure how that would work with a combobox/dropdown rendering
 (since one click selects an item)
 
 It would have to render it like a listbox, the way it's done in Palette.
 
 BTW- I think the Palette super component is ready for use in T5.0.5
 SNAPSHOT.  That should at least give you the same functionality for
 now.
Whooo, also very nice :)

Although, after I added an option to the selected items, it didn't
show it in the right box - and T5 didn't tell me anything in the logs
that s.th. isn't right...
However, it's very nice, but I think for now I stick to the
simple MultiSelect version...

Cheers,
Martin


 
 On 6/6/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  Hi,
 
  AFAICS doesn't the select component support the attribute
  multiple, only the first selected option is set on the
  value.
 
  Is there some way to get this to work with support for multiple?
 
  Thx  cheers,
  Martin
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 class reloading

2007-06-05 Thread Martin Grotzke
On Wed, 2007-05-30 at 09:54 +0200, Francois Armand wrote:
 Le mercredi 30 mai 2007 à 07:28 +, Martin Grotzke a écrit :
  For me changed classes are not picked up automatically, when running
  mvn jetty6:run...
 
 Well... I encounter some strange behaviour with mvn jetty:run and class
 reloading. It works perfectly at my work, and jetty fire some exception
 about unimplemented class reloading functionality in fresh install of
 eclipse 3.2 at home.
  
 So, the way that seems to just work is to use jetty 5 + jetty launcher
 plugin, as show in the tutorial
 ( http://tapestry.apache.org/tapestry5/t5-tutorial.pdf ), and let mvn
 apart for that task.
Now I installed JettyLauncher, unfortunately I don't get it to run as it
fails with weird ClassNotFoundException like 

Caused by: java.lang.ClassNotFoundException: 
org.comp.proj.shared.DBEntityEventListener

(find the full exception below)

However, this class definitely exists, and I also tried to add several
jars (e.g. hibernate-annotations) manually to the classpath of
JettyLauncher (as I asumed it would be a problem with the classpath).

 
 If some one has a procedure to have mvn jetty:run + jetty 6 (0 or 1) +
 class/template reloading work, or just can explain what factors make it
 work or not, I will be glad to know them.
Yes, that would be very appreciated.

Thx  cheers,
Martin


This is the full exception when starting JettyLauncher:

08:47:30.278 ERROR! [main] 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:203)
 09 Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 
'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
 Cannot create inner bean '(inner bean)' of type 
[org.springframework.transaction.interceptor.TransactionInterceptor] while 
setting bean property 'transactionInterceptor'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name '(inner bean)': Cannot resolve reference to bean 'transactionManager' 
while setting bean property 'transactionManager'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'transactionManager' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to bean 
'sessionFactory' while setting bean property 'sessionFactory'; nested exception 
is org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'sessionFactory' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to bean 
'entityEventListener' while setting bean property 'eventListeners' with key 
[TypedStringValue: value [pre-insert], target type [null]]; nested exception is 
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find 
class [org.comp.proj.shared.DBEntityEventListener] for bean with name 
'entityEventListener' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]; nested exception is 
java.lang.ClassNotFoundException: org.comp.proj.shared.DBEntityEventListener
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name '(inner bean)': Cannot resolve reference to bean 
'transactionManager' while setting bean property 'transactionManager'; nested 
exception is org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'transactionManager' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to bean 
'sessionFactory' while setting bean property 'sessionFactory'; nested exception 
is org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'sessionFactory' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to bean 
'entityEventListener' while setting bean property 'eventListeners' with key 
[TypedStringValue: value [pre-insert], target type [null]]; nested exception is 
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find 
class [org.comp.proj.shared.DBEntityEventListener] for bean with name 
'entityEventListener' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]; nested exception is 
java.lang.ClassNotFoundException: org.comp.proj.shared.DBEntityEventListener
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'transactionManager' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to bean 
'sessionFactory' while setting bean property 'sessionFactory'; nested exception 
is org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'sessionFactory' defined in ServletContext resource 
[/WEB-INF/applicationContext-dataaccess.xml]: Cannot

Re: T5 class reloading

2007-06-05 Thread Martin Grotzke
On Tue, 2007-06-05 at 09:00 +0200, Martin Grotzke wrote:
 On Wed, 2007-05-30 at 09:54 +0200, Francois Armand wrote:
  Le mercredi 30 mai 2007 à 07:28 +, Martin Grotzke a écrit :
   For me changed classes are not picked up automatically, when running
   mvn jetty6:run...
  
  Well... I encounter some strange behaviour with mvn jetty:run and class
  reloading. It works perfectly at my work, and jetty fire some exception
  about unimplemented class reloading functionality in fresh install of
  eclipse 3.2 at home.
   
  So, the way that seems to just work is to use jetty 5 + jetty launcher
  plugin, as show in the tutorial
  ( http://tapestry.apache.org/tapestry5/t5-tutorial.pdf ), and let mvn
  apart for that task.
 Now I installed JettyLauncher, unfortunately I don't get it to run as it
 fails with weird ClassNotFoundException like 
 
 Caused by: java.lang.ClassNotFoundException: 
 org.comp.proj.shared.DBEntityEventListener
 
 (find the full exception below)
 
 However, this class definitely exists, and I also tried to add several
 jars (e.g. hibernate-annotations) manually to the classpath of
 JettyLauncher (as I asumed it would be a problem with the classpath).

Ha, the exception was misleading, the problem was in front of the
computer: the database was not running - aehem ;)

Now everything's fine with JettyLauncher, really great the class
reloading!!

Cheers,
Martin

 
  
  If some one has a procedure to have mvn jetty:run + jetty 6 (0 or 1) +
  class/template reloading work, or just can explain what factors make it
  work or not, I will be glad to know them.
 Yes, that would be very appreciated.
 
 Thx  cheers,
 Martin
 
 
 This is the full exception when starting JettyLauncher:
 
 08:47:30.278 ERROR! [main] 
 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:203)
  09 Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error creating bean 
 with name 
 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor':
  Cannot create inner bean '(inner bean)' of type 
 [org.springframework.transaction.interceptor.TransactionInterceptor] while 
 setting bean property 'transactionInterceptor'; nested exception is 
 org.springframework.beans.factory.BeanCreationException: Error creating bean 
 with name '(inner bean)': Cannot resolve reference to bean 
 'transactionManager' while setting bean property 'transactionManager'; nested 
 exception is org.springframework.beans.factory.BeanCreationException: Error 
 creating bean with name 'transactionManager' defined in ServletContext 
 resource [/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve 
 reference to bean 'sessionFactory' while setting bean property 
 'sessionFactory'; nested exception is 
 org.springframework.beans.factory.BeanCreationException: Error creating bean 
 with name 'sessionFactory' defined in ServletContext resource 
 [/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to 
 bean 'entityEventListener' while setting bean property 'eventListeners' with 
 key [TypedStringValue: value [pre-insert], target type [null]]; nested 
 exception is org.springframework.beans.factory.CannotLoadBeanClassException: 
 Cannot find class [org.comp.proj.shared.DBEntityEventListener] for bean with 
 name 'entityEventListener' defined in ServletContext resource 
 [/WEB-INF/applicationContext-dataaccess.xml]; nested exception is 
 java.lang.ClassNotFoundException: org.comp.proj.shared.DBEntityEventListener
 Caused by: org.springframework.beans.factory.BeanCreationException: Error 
 creating bean with name '(inner bean)': Cannot resolve reference to bean 
 'transactionManager' while setting bean property 'transactionManager'; nested 
 exception is org.springframework.beans.factory.BeanCreationException: Error 
 creating bean with name 'transactionManager' defined in ServletContext 
 resource [/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve 
 reference to bean 'sessionFactory' while setting bean property 
 'sessionFactory'; nested exception is 
 org.springframework.beans.factory.BeanCreationException: Error creating bean 
 with name 'sessionFactory' defined in ServletContext resource 
 [/WEB-INF/applicationContext-dataaccess.xml]: Cannot resolve reference to 
 bean 'entityEventListener' while setting bean property 'eventListeners' with 
 key [TypedStringValue: value [pre-insert], target type [null]]; nested 
 exception is org.springframework.beans.factory.CannotLoadBeanClassException: 
 Cannot find class [org.comp.proj.shared.DBEntityEventListener] for bean with 
 name 'entityEventListener' defined in ServletContext resource 
 [/WEB-INF/applicationContext-dataaccess.xml]; nested exception is 
 java.lang.ClassNotFoundException: org.comp.proj.shared.DBEntityEventListener
 Caused by: org.springframework.beans.factory.BeanCreationException: Error 
 creating bean with name 'transactionManager' defined in ServletContext 
 resource

Re: T5: How to generate page links from Java code?

2007-06-05 Thread Martin Grotzke
On Mon, 2007-06-04 at 17:21 +0700, Ivan Dubrov wrote:
 Nick Westgate wrote:
  Hi Martin.
 
  A typical way to do this in previous Tapestry versions is to have
  some simple logic functions in your component class to provide a
  boolean result (this link is to the current page) which is used
  for each link's disabled parameter, and to select a string supplied
  to an informal CSS style parameter on each link.
 
  T5 would be the same, except that the core PageLink component needs
  a few tweaks to be fit for your task - so roll your own from that -
  and you will have to create an equivalent of the old getPageName().

 
 BTW, you can use resolver.resolvePageClassNameToPageName(pageClassName)
 to get page name for given page class name, where resolver is
 org.apache.tapestry.services.ComponentClassResolver. Current page class
 name could be retrieved as
 resources.getPage().getComponentResources().getComponentModel().getComponentClassName(),
 where resources is org.apache.tapestry.ComponentResources injected in
 component. That's how my menu is working.

Great, thx for this info!

Cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5: Displaying field error message at specific point in the template - possible?

2007-06-01 Thread Martin Grotzke
On Fri, 2007-06-01 at 12:02 +0200, Katarzyna Marszalek wrote:
  From looking at the component reference for Tapestry 5, I'm a bit 
 puzzled by the presence on the Errors component (which displays all 
 errors in a form as a list - rather exotic case, if you ask me,) but no 
 means of fine-controlling where the error message for a particular field 
 should be displayed. Is it just not implemented yet, or am I missing 
 some other mechanism?
 
 In Tapestry 4 the messages were displayed immediately after fields, 
 which was not perfect (if a design required some additional markup 
 between field and the error {example: form in a table, errors in the 
 right column}, this created a nasty problem,) and I was hoping for some 
 more flexible mechanism for placing errors in Tapestry 5.
 
 If it's not implemented yet, I would propose extending the Errors 
 component, so that it can take a list of components to display errors 
 for (in a special case, only one could be provided, and then the 
 component would not display a list, but just a message {maybe within a 
 SPAN element with an error class}) - do other users think this would be 
 useful?
Yes, we also would like to have such a solution!

Cheers,
Martin


 
 Regards,
 Katarzyna Marszałek
 
 
 
 
 Digital One Sp. z o.o., ul. Dowborczykow 25, 90-019 Lodz, Poland, tel. +48 42 
 677 14 77, fax +48 42 677 14 78, http://www.digitalone.pl/ wpisana do 
 rejestru przedsiebiorcow Krajowego Rejestru Sadowego w Sadzie Rejonowym w 
 Lodzi Wydzial XX Gospodarczy Krajowego Rejestru Sadowego pod numerem KRS 
 088640, o kapitale zakladowym 210.000,00 zl i kapitale wplaconym 
 210.000,00 zl. NIP 725-17-56-437, REGON 472265419 
 
 Ta wiadomosc zawiera poufne informacje przeznaczone tylko dla adresata. 
 Jezeli nie jestescie Panstwo jej adresatem, badz otrzymaliscie ja przez 
 pomylke, prosimy o powiadomienie o tym nadawcy oraz trwale jej usuniecie. 
 Odmienne zachowanie jest niezgodne z interesem Digital One Sp. z o.o. i moze 
 naruszac prawo.
 
 This message contains confidential information intended solely for the 
 addressee. If you are not the addressee or if you have received the message 
 in error, please contact the sender and delete it permanently. Failing to 
 comply is contrary to Digital One Sp. z o.o. interest and may be unlawful.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Re: T5 class reloading

2007-05-30 Thread Martin Grotzke
On Wed, 2007-05-30 at 13:44 +0700, Ted Steen wrote:
 Somewhere in the documentation it says that all pages are components,
 so i guess that all components and pages (that are special kinds of
 components) will automatically reload.
Then the question is what's required to get it to work.

For me changed classes are not picked up automatically, when running
mvn jetty6:run...
If it's working for you, what's your setup, or did you do anything
special to support class reloading? Is it connected with a context
reload of your servlet container (what AFAICS should not be necessary)?

Thx  cheers,
Martin


 
 
 2007/5/29, Martin Grotzke [EMAIL PROTECTED]:
  Hi,
 
  is the class reloading in T5 limited to component classes as
  described at
  http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html:
  However, class reloading only applies to component classes.
 
  Although, at
  http://tapestry.apache.org/tapestry5/tapestry-core/guide/reload.html is
  written that In Tapestry 5, page and component classes will
  automatically reload when changed...
 
  Of course, the latter case would be really, really cool and appreciated,
  but if so: how do I get it to work?
 
  Thx  cheers,
  Martin
 
 
 
 
 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


RE: T5 Script component [WAS: Re: T5 page lifecycle]

2007-05-29 Thread Martin Grotzke
On Tue, 2007-05-29 at 09:36 +0200, Kristian Marinkovic wrote:
 instead of resolving the path to your resource manually you can 
 use the asset service (useful when thinking of portlets) 
What exactly is the advantage of using the AssetSource? Is it e.g.
caching or s.th. else?
In respect to the Request that I used I suppose for a portlet
environment it should only be necessary to provide another (portlet
specific) implementation.

Cheers,
Martin


 
 i wrote a stylesheet component myself that works like your 
 script component :) ... and i enjoyed writing it. 
 
 
 public class Script { 
 
 @Inject 
 private AssetSource assetSource;  
 
 
 @BeginRender
boolean renderMessage( MarkupWriter writer ) { 
 
Asset script = assetSource.findAsset(null, _src, null); 
 
writer.element( script,
type, _type,
src, script.toClientUrl()) 
 } 
 
 @Component(parameters={src=context:js/mainFunction.js}) 
 Script script; 
  
 
 g, 
 kris 
  
 
 
 
 
 
 
 Martin Grotzke
 [EMAIL PROTECTED] 
 
 26.05.2007 14:40 
 Bitte antworten an
  Tapestry users
 users@tapestry.apache.org
 
 
 
 
An
 Tapestry users
 users@tapestry.apache.org 
 Kopie
 
 Thema
 T5 Script
 component [WAS:
 Re: T5 page
 lifecycle]
 
 
 
 
 
 
 
 
 thanx, good to know that.
 
 Although, I prefer having a template that can be further developed by
 page designers, so I wrote a Script component that can be used like
 this:
 
 script type=text/javascript t:type=script
 src=js/main_functions.js/
 
 The script component class:
 
 public class Script {

@Inject
private Request _request;
@Parameter(required = true, defaultPrefix=literal)
private String _type;
@Parameter(required = true, defaultPrefix=literal)
private String _src;
 
@BeginRender
boolean renderMessage( MarkupWriter writer ) {
writer.element( script,
type, _type,
src, _request.getContextPath() + / + _src );
writer.end();
return false;
}

 }
 
 Is there anything that could be improved?
 
 Btw: I really love how easy it is to write a component in T5, you
 just have to do what you want, nothing more - really, really nice!!
 
 Cheers,
 Martin
 
 
 
 On Fri, 2007-05-25 at 10:13 -0700, Howard Lewis Ship wrote:
  Yes, you can.  The AssetSource service is public, so you can ask it
 for a
  dynamically determined service.
  
  In 5.0.5 snapshot, you can do the following:
  
  @Inject
  private Request _request;
  
  public Request getRequest() { return _request; }
  
  public String getLibraryPath() { return ... }
  
  And in the template ...
  
  body
  script type=text/javascript
 src=${request.contextPath}/${libraryPath}/
   ...
  
  
  5.0.5-SNAPSHOT supports expansions inside attributes, even of
 non-component
  elements, and you can do some simple string-assembly inline.  What
 this
  doesn't do is ensure that the library exists, or handle localization
 of the
  library (perhaps more relevant for an image than a JavaScript
 library).
  
  
  
  On 5/25/07, Martin Grotzke [EMAIL PROTECTED] wrote:
  
   On Fri, 2007-05-25 at 07:54 -0700, Howard Lewis Ship wrote:
There isn't a component, but you can in your page or component
 class:
   
@Inject @Path(context:js/main_functions.js)
private Asset _library;
   is it possible to set the js/main_functions.js dynamically
   via java, or retrieve it from a properties file (setting it via
   java would be preferred)?
  
   thx  cheers,
   martin
  
  
   
@Environmental
private PageRenderSupport _renderSupport;
   
void beginRender() {
  _renderSupport.addScriptLink(_library);
}
   
   
... yes this can/should be wrapped up into a more convienient
 component.
I've also added a JIRA suggestion for an annotation to take care
 of this
   as
well.
   
On 5/25/07, Martin Grotzke [EMAIL PROTECTED] wrote:

 On Thu, 2007-05-24 at 16:36 -0700, Howard Lewis Ship wrote:
  Need an ls -lR of src/main/webapp
 
  I suspect you have a link to a .js file that doesn't exist.
  If it
   did
  exist, the request would be passed off to the servlet
 container.
   Since
 it
  doesn't, and it looks like a Tapestry page request, it's
 being
   passed
 into
  Tapestry.
 Howard, that was the case. The url was /myapp/search/ipod
 (page
   Search)
 and the template contained
 script type=text/javascript
 src=js/main_functions.js/script

 Changing this to
 script type=text/javascript
   src=/myapp/js/main_functions.js/script

 fixes the problem.

 Is there a component that can produce this script tag with a
 correctly
 prefixed src attribute?

 Thx  cheers,
 Martin


 
  On 5/24/07, Martin Grotzke [EMAIL PROTECTED]
 wrote:
  
   On Thu, 2007-05-24 at 10:42 -0700, Howard Lewis

T5 class reloading

2007-05-29 Thread Martin Grotzke
Hi,

is the class reloading in T5 limited to component classes as
described at
http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html:
However, class reloading only applies to component classes.

Although, at
http://tapestry.apache.org/tapestry5/tapestry-core/guide/reload.html is
written that In Tapestry 5, page and component classes will
automatically reload when changed...

Of course, the latter case would be really, really cool and appreciated,
but if so: how do I get it to work?

Thx  cheers,
Martin




signature.asc
Description: This is a digitally signed message part


Re: T5 How to have multiple modules with separate packages for pages

2007-05-29 Thread Martin Grotzke
Great, this does the trick!

Thanx a lot,
cheers,
Martin


On Sun, 2007-05-27 at 23:11 +0700, Ivan Dubrov wrote:
 You can contribute to ComponentClassResolver service mappings from
 prefix (e.g, mod1) to package, like the following:
 
 public static void
 contributeComponentClassResolver(ConfigurationLibraryMapping
 configuration) {
 configuration.add(new LibraryMapping(mod1,
 org.comp.app.mod1.presentation));
 configuration.add(new LibraryMapping(mod2,
 org.comp.app.mod2.presentation));
 }
 
 All your pages will be available at paths like mod1/pagename and all
 components in mod1 available as t:mod1.componentname in templates.
 
 Martin Grotzke wrote:
  Hi,
 
  I have a question concerning the configuration of tapestry5
  with the context-param tapestry.app-package and the support
  of multiple modules per application (several root-packages).
 
  We have an application that first has modules and then layers
  for each module, like the following:
 
  org.comp.app.mod1.presentation
  org.comp.app.mod1.business
  org.comp.app.mod1.dao
 
  org.comp.app.mod2.presentation
  org.comp.app.mod2.business
  org.comp.app.mod2.dao
 
  the presentation packages shall contain subpackages
  for services, pages and components, e.g. 
 
  org.comp.app.mod1.presentation.pages
  org.comp.app.mod1.presentation.components
  org.comp.app.mod1.presentation.services
 
 
  The quickstart archetype generated an AppModule class in
  org.comp.app.mod1.presentation.services, but AFAICS
  this is intended to configure the application, and therefore
  should be located in a package like
  org.comp.app.common.presentation.services.
 
  Then I would like to specify org.comp.app as the
  tapestry.app-package, or specify several root packages,
  for each module the presentation package.
 
  I already tried the first approach, but it failed with 404 NOT_FOUND
  if I requested a specific page at /app/mypage (e.g. with
  MyPage.java in org.comp.app.mod1.presentation.pages).
 
  How is such an architecture supported by T5?

  Thanx in advance,
  cheers,
  Martin
 
 

 
 
-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


T5 and shorter logical page name for pages of contributed library mappings

2007-05-29 Thread Martin Grotzke
Hi,

how do I get a url like /app/user/create for a page CreateUser in
the module user?

I have in my AppModule class:

public static void contributeComponentClassResolver( 
ConfigurationLibraryMapping configuration ) {
configuration.add( new LibraryMapping( user, 
org.comp.app.user.presentation ) );
}

and in the specified package I have a pages.CreateUser page class.

This is available at the url /app/user/createuser, what is really nice
so far.
But is it also possible to have an automatic shortening to
/app/user/create, like it is described at
http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html 
Section Sub-Folders / Sub-Packages?

Thx  cheers,
Martin





signature.asc
Description: This is a digitally signed message part


  1   2   >