Re: FindBugs and the @Inject annotation on global fields

2012-06-08 Thread Martin Strand

I use constructor injection for all services, so Findbugs works as expected 
there.
But I've had to disable Findbugs for page/component classes since there is so 
much magic going on there.

On Fri, 08 Jun 2012 17:32:20 +0200, Ray Nicholus  wrote:


Is anyone using FindBugs in a T5 project?  If so, have you managed to find
a way to suppress the NPE warnings when dereferencing an injected field?
 This doesn't appear to be possible, which makes FB useless in a T5 app,
for the most part.  It's not clear that any other static analysis tools
provide such a filter either, though.  Anyone had luck with anything else?


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



Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Martin Strand

On Thu, 07 Jun 2012 02:24:35 +0200, Cezary Biernacki  
wrote:


"* The semantics of volatile variables have been strengthened to have
acquire and release semantics. In the original specification, accesses to
volatile and non-volatile variables could be
freely ordered.


Aha, so does this mean that "volatile" introduces the same memory semantics 
that a read lock does?
If message is declared volatile, even its non-final fields would be guaranteed 
to be published properly?
But if it's not volatile we have the usual problem with uninitialized fields?

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



Re: Tapestry 5.3.4-rc-5

2012-06-06 Thread Martin Strand

On Wed, 06 Jun 2012 23:29:52 +0200, Kalle Korhonen  
wrote:


On Wed, Jun 6, 2012 at 1:51 PM, Cezary Biernacki  wrote:

On 06 June 2012 21:20:02 +0200 Howard Lewis Ship  wrote:

http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html

I am curious is there a reason to not use 'double-checked locking' pattern?
I know that it was broken in Java 1.4 and earlier, but Java Memory Model was
changed (JSR-133) for Java 5.0 to accommodate that pattern. Of course, you
need to use 'volatile' field, but AFAIK it does not impose any significant
penalty (especially for reads) on most platforms including most x86 and
emt64. Am I missing something?


Same question, and I think there's still more places in T5 code that
could simply return the object if it exists before synchronizing or
obtaining locks if the field was volatile. Specifically, even before
the try block, could you not do:
if (messages != null) return messages;

Or, depending on where it's cleaned up:
Messages messages = this.messages;
if (messages != null) return messages;



If I'm not mistaken, JSR-133 only affects final fields so we still have the 
same problem for non-final fields.
i.e any non-final fields in Messages might still be uninitialized even if the 
*reference* is visible to other threads (messages != null)

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



Re: Showing text with line breaks converted to or

2012-04-18 Thread Martin Strand

On Wed, 18 Apr 2012 20:32:12 +0200, Tim  wrote:


On 18/04/2012 1:25 PM, Martin Strand wrote:
Another option is to leave the code as it is right now and fix this  
with CSS instead:


p.mytext {
white-space: pre;
}


I originally did it this way, but I found that really long lines didn't  
wrap at all--they just went off the page.


Oh yes, that should be "pre-wrap" (won't work in older IEs)
http://www.quirksmode.org/css/whitespace.html



Does anyone know a convenient and secure way to escape HTML?


There's commons-lang:
http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/StringEscapeUtils.html#escapeHtml(java.lang.String)



Btw, a third option is to create a loop over yourString.split("\n") and  
then put a line break after each line:



  ${currentRow} 


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



Re: Showing text with line breaks converted to or

2012-04-18 Thread Martin Strand
On Wed, 18 Apr 2012 19:47:11 +0200, Thiago H. de Paula Figueiredo  
 wrote:



On Wed, 18 Apr 2012 14:06:02 -0300, Tim Koop  wrote:


Is there some way I can convert eol's to  or something?


Like doing this conversion yourself using String.replaceAll() and using  
OutputRaw in the template?


If you do it this way, remember to escape any HTML characters first.
Otherwise you could be introducing an XSS vulnerability since a user can  
type HTML into the textarea.




Another option is to leave the code as it is right now and fix this with  
CSS instead:


p.mytext {
white-space: pre;
}

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



Re: miss key

2011-12-08 Thread Martin Strand

On Fri, 09 Dec 2011 04:15:04 +0100, dick_hu  wrote:


When I move the project from windows to linux,there are some strange problem 
happened.
One of them is not find the App.properties's key.
If I should do some config when I  from windows to linux.



Rename the file to "app.properties" (lower case)

Windows filenames are case insensitive so it doesn't matter there, but that's 
not the case on Linux.

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



Re: pagecatalog still visible in production mode

2011-12-08 Thread Martin Strand

You could configure your servlet container so that it doesn't return the proxy 
IP as request.remoteAddr, but instead uses the X-Forwarded-For header and 
returns the real client IP.

For Jetty, this is just a matter of setting forwarded=true on the connector
http://wiki.eclipse.org/Jetty/Howto/Configure_mod_proxy#Configuring_mod_proxy_as_a_Reverse_Proxy.5D:


On Fri, 09 Dec 2011 03:59:13 +0100, angelochen  
wrote:


I'd prefer this to have the same behavior as servicestatus, I discovered this
when I rolled out a production version:

example.com:8080/pagecatalog   this works
example.com/pagecatalog   this shows everything

because in the server, apache server is used to proxy to tomcat, and t5 sees
it as localhost, that's whitelisted.


Howard Lewis Ship wrote


Try accessing PageCatalog from beyond your localhost  ... localhost is
"white listed", other IP addresses are not on the white list unless
you make a specific contribution.

See:


http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/WhitelistAccessOnly.html

http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/security/ClientWhitelist.html

On Thu, Dec 8, 2011 at 1:24 AM, angelochen 
wrote:

hi,
setting production mode to true in 5.3, servicestatus not show details,
but
pagecatalog still shows everything.
what's the easy way to turn this off? Thanks,
angelo

--
View this message in context:
http://tapestry.1045711.n5.nabble.com/pagecatalog-still-visible-in-production-mode-tp5058173p5058173.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache





--
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/pagecatalog-still-visible-in-production-mode-tp5058173p5060616.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



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



Re: pagecatalog still visible in production mode

2011-12-08 Thread Martin Strand

If I'm not mistaken there is no way to remove a contribution.
So if a proxy or load balancer were to mess up Request.getRemoteAddr(), you 
would have to decorate ClientWhitelist to remove the localhost whitelisting, 
right?

On Thu, 08 Dec 2011 16:29:43 +0100, Howard Lewis Ship  wrote:


Try accessing PageCatalog from beyond your localhost  ... localhost is
"white listed", other IP addresses are not on the white list unless
you make a specific contribution.

See:

  
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/WhitelistAccessOnly.html
  
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/security/ClientWhitelist.html

On Thu, Dec 8, 2011 at 1:24 AM, angelochen  wrote:

hi,
setting production mode to true in 5.3, servicestatus not show details, but
pagecatalog still shows everything.
what's the easy way to turn this off? Thanks,
angelo


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



Re: FileSystem asset source

2011-12-08 Thread Martin Strand

On Thu, 08 Dec 2011 18:10:26 +0100, Dimitris Zenios  
wrote:


Any example of an asset source that loads assets from filesystem?


There is an old Jira issue for this, perhaps you could look at the patch 
provided and see if that helps?
https://issues.apache.org/jira/browse/TAP5-423

The issue is closed as a duplicate of TAP5-1515 though, not sure if that really 
makes sense

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



Re: T5.3: do we still need AssetProtectionDispatcher?

2011-12-07 Thread Martin Strand

What if there is no trailing slash, won't that give you a directory listing 
anyway?


On Wed, 07 Dec 2011 22:29:45 +0100, Lenny Primak  wrote:


Jira created: https://issues.apache.org/jira/browse/TAP5-1779

On Dec 7, 2011, at 2:25 PM, David Rees wrote:


On Wed, Dec 7, 2011 at 10:53 AM, Lenny Primak  wrote:

You can still get a directory listing of assets, but you can't access them 
directly.
I have a fix in the flowlogix library for this, but perhaps I should file a 
JIRA...


Yeah, you should.  That's an information disclosure security bug...


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



Re: Template parsing vulnerable to whims of default charset

2011-12-07 Thread Martin Strand

On Wed, 07 Dec 2011 19:08:19 +0100, Kalle Korhonen  
wrote:


2011/12/6 Robert Coie :

On Tue, Dec 06, 2011 at 04:49:42PM -0800, Kalle Korhonen wrote:

What's your JVM's file.encoding set to? (e.g. -Dfile.encoding=UTF-8).
The default for most JVMs is *not* UTF-8. Tapestry assumes UTF-8
throughout.

I believe it's US-ASCII, as checked by Charset.defaultCharset(),
although I have seen some other reports indicating that that may not be
reliable due to caching. It's not "my" JVM in the sense that I can't
change the settings - it's at the mercy of Google App Engine.


Ah, you are using GAE. Should have said that in the beginning. See
http://gaelyk.appspot.com/tutorial/setup for example and set the JVM
encoding to UTF-8.



The point is still valid - Tapestry should not depend on the default charset.
Robert, since you already found the problem perhaps you could open a jira 
ticket and submit a patch?
https://issues.apache.org/jira/browse/TAP5

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



Re: SimpleRequestWrapper and LinkTransformer

2011-12-03 Thread Martin Strand

Add a static import to the top of your module class and it will compile fine:

import static org.apache.tapestry5.ioc.OrderConstraintBuilder.after;




On Sat, 03 Dec 2011 07:25:44 +0100, angelochen  
wrote:


"after" not accepte, btw, i'm still using 5.2.6


Martin Strand-4 wrote



public void contributeRequestHandler(OrderedConfiguration
configuration)
{
   configuration.add("basicPathRequestFilter", new
BasicPathRequestFilter(...),
after("StoreIntoGlobals").before("EndOfRequest").build());
}


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



Re: SimpleRequestWrapper and LinkTransformer

2011-12-02 Thread Martin Strand

Do you mean it compiles fine, but has no effect at runtime?
This is an "ordered" configuration, you might need to specify where in the list 
of request filters you want yours inserted.
http://tapestry.apache.org/tapestry-ioc-configuration.html#TapestryIoCConfiguration-OrderedList

Here's how I configured our rewrite filter, not sure whether it's "correct" but 
it works:
(using after/before static imports from 
org.apache.tapestry5.ioc.OrderConstraintBuilder)

public void contributeRequestHandler(OrderedConfiguration 
configuration)
{
  configuration.add("basicPathRequestFilter", new BasicPathRequestFilter(...), 
after("StoreIntoGlobals").before("EndOfRequest").build());
}


On Sat, 03 Dec 2011 06:55:13 +0100, angelochen  
wrote:


Thanks, can you give more details on this part? mine does not work:

public void contributeRequestHandler(OrderedConfiguration
configuration) {
configuration.add("basicPathRequestFilter", new 
basicPathRequestFilter(pathServices));
}


Martin Strand-4 wrote



public void contributeRequestHandler(OrderedConfiguration
configuration, ...)
{
   configuration.add("YourRequestFilter", new YourRequestFilter() ...);
}


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



Re: SimpleRequestWrapper and LinkTransformer

2011-12-02 Thread Martin Strand

I'm doing these kind of arbitrary rewrites with a custom RequestFilter, sounds 
like that would suit your needs.
Here's an example:


public class YourRequestFilter
  implements RequestFilter
{
  @Override
  public boolean service(Request request, Response response, RequestHandler 
handler)
throws IOException
  {
String path = request.getPath();
final String newPath = ...;
request = new DelegatingRequest(request)
{
  @Override
  public String getPath()
  {
return newPath;
  }
};
return handler.service(request, response);
  }
}


and add it to the pipeline in your module:

public void contributeRequestHandler(OrderedConfiguration 
configuration, ...)
{
  configuration.add("YourRequestFilter", new YourRequestFilter() ...);
}


On Sat, 03 Dec 2011 05:32:12 +0100, angelochen  
wrote:


Hi,

I have following implementation in T5.2's URLrewrite:

some entries in a property file:

/newpage/123=/view/231
/newpage2/123=/view_more/xyz/abcd

then in URLRewrite I can simply do this:

 public Request process(Request request, URLRewriteContext
urlRewriteContext) {
String path = request.getPath().toLowerCase();
String newPath = pathServices.getRewritePath(path); // this looks up
from the property file containing rewrite entries
if (newPath != null) {
request = new SimpleRequestWrapper(request, newPath);
}
return request;
}

Now I'm trying to use LinkTransformer, it does not work as
PageRenderRequestParameters requires a valid page name, not like
"/view_more/xyz/abcd" which can be passed directly to SimpleRequestWrapper,
any idea how to do something similar to the above?


public PageRenderRequestParameters decodePageRenderRequest(Request request)
{
String newPath = pathServices.getRewritePath(path);
if (newPath != null) {
{
return new PageRenderRequestParameters(
newPath, new EmptyEventContext(),
false);
}
}
return null;
}


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



Re: onValidate in T5.2.6

2011-12-01 Thread Martin Strand

Yes, they work the same. The new "validate" event is fired just before the deprecated 
"validateForm" and is meant to replace the old event.
Having both events in 5.2 is simply a way to rename the event while retaining 
backwards compatibility.

On Fri, 02 Dec 2011 01:17:13 +0100, angelochen  
wrote:


Thanks, does it work the same? what my approach will be, replace all
'onValidateForm' with 'onValidate' first in 5.2.6, and later upgrade to 5.3.


Martin Strand-4 wrote


On Fri, 02 Dec 2011 00:21:09 +0100, angelochen <angelochen960@.com>
wrote:


hi,

to uprade to 5.3, we need to replace all onValidateForm to onValidate,
but
does onValidate works in 5.2.6?


Yes, the "validate" event works in Tapestry 5.2.6:
http://tapestry.apache.org/5.2/apidocs/org/apache/tapestry5/EventConstants.html#VALIDATE

"validateForm" was deprecated in 5.2:
http://tapestry.apache.org/5.2/apidocs/org/apache/tapestry5/EventConstants.html#VALIDATE_FORM


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



Re: onValidate in T5.2.6

2011-12-01 Thread Martin Strand

On Fri, 02 Dec 2011 00:21:09 +0100, angelochen  
wrote:


hi,

to uprade to 5.3, we need to replace all onValidateForm to onValidate, but
does onValidate works in 5.2.6?


Yes, the "validate" event works in Tapestry 5.2.6:
http://tapestry.apache.org/5.2/apidocs/org/apache/tapestry5/EventConstants.html#VALIDATE

"validateForm" was deprecated in 5.2:
http://tapestry.apache.org/5.2/apidocs/org/apache/tapestry5/EventConstants.html#VALIDATE_FORM

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



Re: Gave up on T5.3 for now ...

2011-11-27 Thread Martin Strand

On Sun, 27 Nov 2011 22:46:18 +0100, Gunnar Eketrapp  
wrote:


T5.3 looks promising and it felt quite faster.

The two major concerns where

1) My user types didn't work in forms.
2) Disabled field did not work in forms. (The value was not passed back)

Of course I must have missed something obviously but I decided to
wait with T5.3 until these questions are sorted out.



2) is standard behaviour - the browser is not supposed to submit values of 
disabled fields.
Not sure how your page works, but perhaps you'd want to use "readonly" instead?
http://reference.sitepoint.com/html/input/readonly

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



Re: URL handling ..

2011-11-07 Thread Martin Strand

On Mon, 07 Nov 2011 07:46:47 +0100, Kalle Korhonen  
wrote:


There's not been a T5 project where I haven't needed to override
URLEncoder service. Take a look at T5's URLEncoderImpl, override it
with your version and mark whichever characters you prefer as safe
(i.e. not encoded).

Kalle



I changed the default URLEncoder to assume everything is "safe" except for a 
few characters:

static final String ENCODED_NULL = "$N";
static final String ENCODED_BLANK = "$B";

private final BitSet unsafe = new BitSet(128);
{
  markUnSafe("/+$");
}

Just wondering, can you see any potential problems with this? I'm guessing 
there's a reason Tapestry doesn't do this by default.

We have a number of search result pages in a variety of languages, and we'd 
like Googlebot to see the search query properly encoded in the URL.

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



Re: Insert Stylesheet to the Head top

2011-10-31 Thread Martin Strand

On Mon, 31 Oct 2011 18:58:31 +0100, Thiago H. de Paula Figueiredo 
 wrote:


On Mon, 31 Oct 2011 11:48:04 -0200, Eugene Zhulkov 
wrote:


Dear community!


Hi!


I'm facing a trouble that I can't solve. But I think it's solvable :)
So I need to insert css stylesheet link to the top of the HEAD tag. Even
before Tapestry resources.


Why? I've never read about needing to add CSS files before JavaScript ones.


One reason is to make sure the CSS downloads start before any scripts soak up 
the browser's max connections. Loading CSS fast makes the app feel responsive.
Maxing out browser connections is however not a real problem since Tapestry can 
combine scripts to a single one.

Also, some polyfill scripts (such as selectivizr) require stylesheets to be 
included first.
IMO it would make sense for Tapestry to put CSS first by default.



Supposing you need to do this in all pages, one way of doing that is
writing a mixin that users MarkupWriter to move the 

Re: [T5.3] Using ResourceMinimizer to remove debugging code?

2011-10-31 Thread Martin Strand

On Mon, 31 Oct 2011 15:51:14 +0100, Jochen Kemnade 
 wrote:


Hi,

after playing with the new Tapestry 5.3 features, an idea came to my
mind. I'd like to "abuse" the ResourceMinimizer to remove debug code
when running in production mode, i.e. calls to Tapestry.debug,
T5.console.debug and the like.
...
Yuicompressor does not support features like that, so I wonder if
there's a way to get around having to write horrible regular expressions
or parser code. Any ideas? :-)



Perhaps you could use Google closure compiler and its preprocessor features?
http://stackoverflow.com/questions/2934509/exclude-debug-javascript-code-during-minification

I have no experience with the closure compiler, but it's written in Java so 
should be possible to integrate with a Tapestry app.

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



Re: Tapestry failing to inject a service into a Translator with @Inject?

2011-10-16 Thread Martin Strand

On Sun, 16 Oct 2011 22:09:14 +0200, Julien Martin  wrote:


It might have to do with the way I contribute my Translator i.e.:

@Contribute(TranslatorSource.class)
public static void provideTranslators(MappedConfigurationTranslator> configuration) {

  configuration.add(Postcode.class, new PostcodeTranslator());
}

See how I instanciate the PostcodeTranslator...
I don't know how to get round this...



If PostcodeTranslator is a defined service, you can use addInstance and  
Tapestry will autobuild the service for you:


configuration.addInstance(Postcode.class, PostcodeTranslator.class);



otherwise you can inject its dependencies into the contribution method,  
and pass to a constructor:


@Contribute(TranslatorSource.class)
public static void provideTranslators(MappedConfigurationTranslator> configuration, BignibouService service) {

  configuration.add(Postcode.class, new PostcodeTranslator(service));
}

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



Re: ApplicationDefaults depends on itself

2011-10-10 Thread Martin Strand

On Mon, 10 Oct 2011 22:15:26 +0200, Greg Pagendam-Turner
 wrote:


Hi,

I'm trying to pull some of my config out of AppModule into config files.

The config files are loaded via contributeSymbolSource. Some of these  
symbols are referred to in ApplicationDefaults. For some reason IOC  
thinks there is a circular dependency on ApplicationDefaults but I can't  
figure out what it is.


Any ideas on what might be happening?




 public static void contributeApplicationDefaults(
   MappedConfiguration configuration,
   @Value("${liftyourgame.facebook_clientid}") String clientId,
   @Value("${liftyourgame.facebook_secret}") String secret) {


This is it. contributeApplicationDefaults is where you set default values  
for your symbols, but since the symbols need to be resolved in order to  
pass the proper parameters to that method, the method depends on itself.


ApplicationDefaults is just one of many symbol providers, if you are  
setting this symbol elsewhere (web.xml, system properties, etc) you don't  
need to set it in ApplicationDefaults too.


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



Re: JavascriptStack

2011-10-09 Thread Martin Strand
The User-Agent header is very unreliable (unless this is for an intranet)  
and you would also need to add "Vary: User-Agent" to defeat caching by  
shared proxies.


It's probably better to use two stacks instead, and include the IE stack  
with a conditional comment.
For example, I use this "IERepair" component to add ifixpng for <=IE6 and  
selectivizr/css3pie for <=IE8 :



public class IERepair
{
@Inject
private JavaScriptStackPathConstructor stackPathConstructor;

boolean beginRender(MarkupWriter writer)
{
writer.writeRaw("");

writer.writeRaw("");

return false;
}

private void renderStack(MarkupWriter writer, String stack)
{
		List paths =  
stackPathConstructor.constructPathsForJavaScriptStack(stack);

for (String path : paths)
{
writer.element("script", "type", "text/javascript", 
"src", path);
writer.end();
}
}
}


On Sun, 09 Oct 2011 12:40:52 +0200, François Facon  
 wrote:



Hi Dimitris,

Perphas a perThread service could detect with the useragent header if
the browser used by the client is IE. by injecting this service to
stack, you could use it to verify if you have to  add the js when the
method getJavaScriptLibraries get called .

Regards
François

2011/10/9 Dimitris Zenios :

Hi guys.I have a javascript stack which includes two javascript files.
One should be always added and the other only when internet explorer.
Is there a possibility to append the internet explorer javascript file
only when needed or it should be always added?

Dimitris Zenios


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



Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Martin Strand
On Wed, 21 Sep 2011 13:19:51 +0200, nquirynen  
 wrote:



if I do
 registry.getService(PolicyValueProviderSource.class)
and pass this as a parameter to my DocumentGenerator's constructor it  
does work.

Is this the way to go then? (my knowledge of Tapestry IoC is very small)



Yes, that is the correct way to retrieve a service.
You could also define a DocumentGenerator service in your AppModule, and  
use "registry.getService(DocumentGenerator.class)" instead of "new  
DocumentGenerator(...)"
Normally, you should not use "new" to instantiate a service; Tapestry  
should instantiate it for you and automatically inject dependencies.

But in your case this should work just fine.

Martin

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



Re: Problem pushing application to production

2011-09-19 Thread Martin Strand

Indeed, your BaseURLSource solution should have worked fine.
I see you accidentally typed an extra "s" at the end of  
"contributeServiceOverrides" but it should have worked anyway since you  
used a @Contribute annotation... try removing the extra "s" ?



On Mon, 19 Sep 2011 20:44:13 +0200, Michael Molloy  
 wrote:


I will look into this because I'm getting desperate. If I can't get this  
to work, I'm going to have to rewrite the app using JSPs over the next  
week. Obviously, I don't want to do that.


I understand that this comes at it from the apache/tomcat side, and as I  
said, I will look into it. However, we have several otherJSP apps  
already in production, and I'm hesitant to start changing configuration  
parameters for fear of breaking something that is currently working.


But isn't BaseURLSource for this exact situation? It seems like it would  
work perfectly to fix my problem. It just doesn't seem to be called.


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



Re: Problem pushing application to production

2011-09-19 Thread Martin Strand

This applies to any situation involving a proxy, regardless of SSL.
As I understand your problem, Tomcat does not know its own publicly  
exposed protocol/hostname/port, and therefore produces erroneous  
links/redirects.
The cause of this is that Tomcat only sees the request sent by the Apache  
proxy, which uses some internal protocol/hostname/port. Tomcat has no way  
of knowing what protocol/hostname/port values the client is expecting.



The fix is to add some extra headers to the proxy request. These headers  
will give Tomcat a clue as to what the "real" protocol/hostname/port  
values are.


mod_proxy automatically adds these headers to the backend request:
X-Forwarded-For (original IP)
X-Forwarded-Host(original Host header)
X-Forwarded-Server  (proxy IP)

but to communicate the protocol (http/https) to the backend you need to  
add that manually in httpd.conf: (using mod_headers)

RequestHeader set X-Forwarded-Proto https env=HTTPS
RequestHeader set X-Forwarded-Proto http env=!HTTPS



The next step is to make sure Tomcat reads these new headers and overrides  
its default values for request.serverName, request.secure, request.scheme,  
etc
Again, I have never done this myself on Tomcat (with Jetty you simply set  
"forwarded"=true) but Tomcat's documentation mentions a filter that  
supposedly does this for you:


 
   RemoteIpFilter
   org.apache.catalina.filters.RemoteIpFilter
   
 remoteIpHeader
 x-forwarded-for
   
   
 remoteIpProxiesHeader
 x-forwarded-by
   
   
 protocolHeader
 x-forwarded-proto
   
 

RemoteIpFilter does not mention any support for "X-Forwarded-Host", but if  
that's not supported you can instead set the "Host" header on the backend  
request by setting "ProxyPreserveHost On" in httpd.conf. With that  
setting, Apache will use the "Host" header from the original request when  
communicating with the backend.


Also, if you happen to use an earlier version of Tomcat, with no  
RemoteIpFilter, you can use XForwardedFilter instead; it does the same  
thing:

http://code.google.com/p/xebia-france/wiki/XForwardedFilter

Martin

On Mon, 19 Sep 2011 17:08:50 +0200, Michael Molloy  
 wrote:


Unless I'm misunderstanding, I don't think this would apply since all  
SSL is being handled at the load balancer, correct? I apologize, I think  
I introduced that confusion at the beginning.


--Michael

On Sep 19, 2011, at 9:52 AM, Martin Strand wrote:

Typically, when SSL is offloaded to an Apache proxy, that proxy should  
add a number of X-Forwarded-* headers to any requests sent to the  
backend.
The servlet container then uses those headers to set up request.scheme,  
request.secure, request.remotAddr, etc so that they match the original  
request sent to the proxy.


With Jetty, all you have to do to support this is set forwarded=true on  
the connector in question.
I haven't used Tomcat for a long time, but this page seems to have the  
info you need:

http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Basic_configuration_to_handle_'x-forwarded-for'_and_'x-forwarded-proto'


On the Apache side, mod_proxy automatically adds these headers:
X-Forwarded-For (original IP)
X-Forwarded-Host(original Host header)
X-Forwarded-Server  (proxy IP)
( see http://httpd.apache.org/docs/current/mod/mod_proxy.html#x-headers  
)


But you need to add X-Forwarded-Proto manually, using mod_headers:
RequestHeader set X-Forwarded-Proto https env=HTTPS
RequestHeader set X-Forwarded-Proto http env=!HTTPS


Once this is done, and Tomcat is configured to take these headers into  
account, you won't need to fiddle around with any BaseURLSource since  
the webapp will be able to get all the info it needs directly from the  
Request object.


If you happen to be using an old version of Jetty or Tomcat, where  
there is no support for X-Forwarded-* headers, you can use this servlet  
filter instead:

http://code.google.com/p/xebia-france/wiki/XForwardedFilter

Martin


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



Re: Problem pushing application to production

2011-09-19 Thread Martin Strand
Typically, when SSL is offloaded to an Apache proxy, that proxy should add  
a number of X-Forwarded-* headers to any requests sent to the backend.
The servlet container then uses those headers to set up request.scheme,  
request.secure, request.remotAddr, etc so that they match the original  
request sent to the proxy.


With Jetty, all you have to do to support this is set forwarded=true on  
the connector in question.
I haven't used Tomcat for a long time, but this page seems to have the  
info you need:

http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Basic_configuration_to_handle_'x-forwarded-for'_and_'x-forwarded-proto'


On the Apache side, mod_proxy automatically adds these headers:
X-Forwarded-For (original IP)
X-Forwarded-Host(original Host header)
X-Forwarded-Server  (proxy IP)
( see http://httpd.apache.org/docs/current/mod/mod_proxy.html#x-headers )

But you need to add X-Forwarded-Proto manually, using mod_headers:
RequestHeader set X-Forwarded-Proto https env=HTTPS
RequestHeader set X-Forwarded-Proto http env=!HTTPS


Once this is done, and Tomcat is configured to take these headers into  
account, you won't need to fiddle around with any BaseURLSource since the  
webapp will be able to get all the info it needs directly from the Request  
object.


If you happen to be using an old version of Jetty or Tomcat, where there  
is no support for X-Forwarded-* headers, you can use this servlet filter  
instead:

http://code.google.com/p/xebia-france/wiki/XForwardedFilter

Martin

On Mon, 19 Sep 2011 16:29:17 +0200, Michael Molloy  
 wrote:


Unfortunately, the Apache expert is no longer here. Does the following  
code from my tomcat server.xml file answer your question? I don't think  
we're using AJP or anything else. It looks to me like the Apache server  
is just sending it to Tomcat over port 8080.


enableLookups="false" redirectPort="8443"  
acceptCount="100"

   connectionTimeout="2" disableUploadTimeout="true" >

 




The corresponding line from the apache httpd.conf file is

BalancerMember http://xxx.xxx.xxx.xxx:8080 loadfactor=50 route=APP01  
timeout=60


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



Re: [T5.3-beta-6] Not Ready For Production!

2011-09-15 Thread Martin Strand
On Wed, 14 Sep 2011 15:57:11 +0200, Steve Eynon  
 wrote:



Yep, looks like you can't inject SymbolSource into your
ApplicationDefaults contribution method when ProdMode is set to true;
bit of a pain because I was using it to extract my webapp version for
setting as the tapestry.app-version.



As a side note, an easy way to automatically set the version number is to  
read it from the jar's manifest:


contributeApplicationDefaults(...)
{

  String version =  
YourModule.class.getPackage().getImplementationVersion();

  if (version != null)
  {
configuration.add(SymbolConstants.APPLICATION_VERSION, version);
  }



With Maven, use addDefaultImplementationEntries to add version info to the  
manifest:



  org.apache.maven.plugins
  maven-jar-plugin
  
true

  
true

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



Re: missing css files in jetty

2011-09-10 Thread Martin Strand

Definitely sounds like tmpwatch.
You can also create a "work" directory in ${jetty.home} and Jetty will use  
that for unpacked apps. Read more here:

http://wiki.eclipse.org/Jetty/Reference/Temporary_Directories


On Sat, 10 Sep 2011 23:25:20 +0200, Cezary Biernacki   
wrote:



Hi,
if you are running on Linux, maybe 'tmpwatch' removed the file.

By default Jetty unpacks WARs to /tmp, and on many Linux distributions
'tmpwatch' is executed from a cron job to remove files from /tmp that  
were
not accessed for some time. In such case, you can disable either  
tmpwatch or

change 'java.io.tmpdir' settings for JVM that is used by Jetty.

Best regards,
Cezary




On Thu, Sep 8, 2011 at 10:34 AM, angelochen  
wrote:



Hi,

I have this:
@Import(stylesheet = {"context:/css/sample.css"})
and it runs quite well, but a few days later, we got:
/assets/1.0-SNAPSHOT/ctx/css/sample.css. Reason: file not found.  
however,

this one still accessible:
/assets/1.0-SNAPSHOT/tapestry/default.css

difference is /ctx/css and /tapestry

this happens in jetty, i do not try tomcat, why? fix? Thanks,

Angelo


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



Re: redirect-after-post messes with my StreamResponse

2011-09-05 Thread Martin Strand
In the log you posted, messages are being logged from an "onSubmit"  
method, but the code you posted has an "onSuccess" method with no logging  
statements.
Are you sure the code you posted is ever reached? Can you put a breakpoint  
in your onSuccess method and see if it is being invoked?



On Mon, 05 Sep 2011 14:01:02 +0200, hese <1024h...@gmail.com> wrote:



nope, i moved the class to another package, (util) and tried and that  
didn't
work too.  Same error.  I guess I'll just go with returning the file  
during

the reload.

Thank you all for your help!!  Really appreciate it.


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



Re: redirect-after-post messes with my StreamResponse

2011-09-03 Thread Martin Strand
The class name of that StreamResponse suggests it is in the "components"  
package, where it will be transformed by Tapestry's classloading magic and  
treated as a "component".
You need to move that class to another package to be able to use it as  
anything else (avoid packages named "pages", "components", "base" and  
"mixins")



On Sat, 03 Sep 2011 02:25:20 +0200, hese <1024h...@gmail.com> wrote:



I upgraded to Tap 5.2.6 and now I see an interesting error message...

Notice that just before the exception, I print the contents of the
StreamResponse and it does print my test lines.  Any idea?

DEBUG [http-8080-6] UrlAnalysis._$advised$onSubmit(122) | Streaming back  
the results.
DEBUG [http-8080-6] UrlAnalysis._$advised$onSubmit(123) | something to  
testAnother line to test
DEBUG [http-8080-6] UrlAnalysis.exit(153) | [ EXIT] onSubmit  
[com.adsafe.fcc.webapp.components.CsvStreamResponse@5143dd30]


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



Re: redirect-after-post messes with my StreamResponse

2011-09-02 Thread Martin Strand
I am doing something similar for a reporting form and it works as expected  
(in tap 5.2)

1. user fills out a few fields
2. user submits the form
3. onSuccess() returns a StreamResponse with a text file
4. a download dialog pops up in the browser

Although I haven't looked closely into the matter, it sounds like your  
solution ought to work just fine, so there might be something else going  
on.

Is the form perhaps submitted through AJAX?
Are there perhaps other event listeners involved?
What if you create a minimal example to demonstrate the problem?


On Fri, 02 Sep 2011 21:51:05 +0200, hese <1024h...@gmail.com> wrote:



I've started a new thread because my older post regarding this issue  
lead me

to think on different lines, than my subject line and i didnt want to
re-edit it and mess with all the following threads.
(http://tapestry.1045711.n5.nabble.com/StreamResponse-onSuccess-does-not-stream-back-data-td4759347.html)

So here i go,

I have a form using which a user can upload a file.  The problem is -  
due to

redirect-after-post (thanks to cqasker) instead of my response file being
streamed back, the page is getting redirected to reload my page once  
again.
So when the user clicks submit, instead of receiving the file, the page  
just
reloads.  I checked all other form submits in my application and this  
seems
to the default form submit behavior (a 302 redirect), which isnt a  
problem
in the other pages, because the page reloads with the new data.  But in  
this

case I want it to just stream back my file.

There is no problem with my streaming code.  I confirmed this by doing a  
GET
on that url (in onActivate I am just streaming back the file) and the  
file

downloads.

Any idea how to make the streaming work with a POST operation?


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



Re: 100% CPU load after hot deploy of Tapestry 5 Application on Tomcat 6

2011-07-20 Thread Martin Strand
We've only got 5.2 apps runing on Jetty, but hot redeploy works great  
there and is even without the PermGen leak that was present in Tapestry 4.



Anyway, here's how I would try to diagnose the problem:

1. Trigger the problem so that you have something consuming 100% CPU

2. Find the native ID of the thread that is eating all your CPU power:
$ top -H -u tomcat  (or whatever user is running Tomcat)
-H will show individual *threads* and you should be able to find the  
offending thread. Remember its ID.

(Hit 'P' to sort by CPU usage)

3. Find Tomcat's PID:
$ sudo jps

4. Get a thread dump from Tomcat:
$ sudo kill -QUIT 
The thread dump will be written to Tomcat's stderr, wherever that is  
redirected


5. Inspect the thread dump
Convert the thread ID from step 2 to hexadecimal and look for it in the  
thread dump from step 4. The thread you're looking for will say "nid=xxx",  
where xxx is the offending thread's native ID written in hexadecimal. The  
thread's stacktrace should give you a clue as to what's going on,  
especially if you get more samples to see where the thread is spending  
most of its time.



You can also hook up VisualVM to Tomcat and inspect threads from there.
There's a thread inspector plugin in the plugin repository.


Hope that helps!

Martin


On Wed, 20 Jul 2011 11:16:24 +0200,  wrote:


Hi All,

This is a tricky question one since I do realize there are several  
possibilities to explain the problem, not all of which are Tapestry  
related. We have battled to understand what is going on in production  
for the past year or so, and have tried to pinpoint where the problem  
lies and come up short. If anyone has experienced anything similar  
*please share.


Our environment is:

Ubuntu Server
Tapestry 5.1
JDK 6
Tomcat 6
Apache in front (reverse proxy)

We are deploying our Tapestry apps to Tomcat 6, and they do run great  
even with load, and it remains very stable as the session count  
increases; this is when a server restart is done after a deployment.


The problem appears to be specific to 'Tapestry applications' and hot  
deployment. We run several apps, both small and large and they all react  
the same way... If we stop then undeploy any of these Tapestry apps, and  
afterwards do a hot deploy with a newer version (without the restart),  
the CPU usage shoots to 100% and stays there. JSP based apps pure  
Servlets don't appear to react in the same way.


Has anybody experienced something similar?

Kind regards,
Peter


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



Re: T5: upload file, css styling

2011-07-19 Thread Martin Strand
That text is part of Chrome's user interface, I don't believe there's  
anything you can do to change it.

Other browsers will display empty file inputs in a different manner.

Martin

On Tue, 19 Jul 2011 22:58:53 +0200, fante  wrote:


Hey all,

I was using the T5 tapestry-upload for uploading files, but I would need
some help to style it,
or at least get read of the default "No File Chosen" text that is  
displayed.



Cheers
fante


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



Re: Remove CSS & JS stacks in v5.3

2011-07-12 Thread Martin Strand
On Tue, 12 Jul 2011 17:13:52 +0200, stephanos2k  
 wrote:


It seems AssetStack was removed in v5.3. But I modified it to this  
(using Scala):
def contributeJavaScriptStackSource(configuration:  
MappedConfiguration[String, JavaScriptStack]) {

configuration.`override`("core", new JavaScriptStack {
def getInitialization = ""
def getStylesheets = Collections.emptyList()
def getJavaScriptLibraries = Collections.emptyList()
def getStacks = Collections.emptyList()
});
}



Oops, sorry! AssetStack is one of our own classes :)

But yeah, that code looks right.

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



Re: Remove CSS & JS stacks in v5.3

2011-07-12 Thread Martin Strand
I'm doing something like this in 5.2, I suppose it ought to work in 5.3  
too:


public void contributeJavaScriptStackSource(MappedConfigurationJavaScriptStack> configuration)

{
List scripts = Collections.emptyList();
List stylesheets = Collections.emptyList();
configuration.override("core", new AssetStack(stylesheets, scripts));
}

On Tue, 12 Jul 2011 15:17:13 +0200, stephanos2k  
 wrote:


I recently upgraded to v5.3 and noticed that my previous method of  
removing
the default Tapestry stylesheet and javascript stacks didn't work  
anymore (I

decorated JavaScriptSupport and disabled importStack() etc.).

What's the best way to get rid of the two stacks completely?


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



Re: T5: @Secure and https with subdomain

2011-06-27 Thread Martin Strand
On Tue, 28 Jun 2011 08:24:25 +0200, Angelo C.   
wrote:



I have tried the @Secure, it will automatically direct to
https:/sample.com/pay, now I have a special requirement, it should direct
to:

https://safe.sample.com/pay,  any idea how to accomplish this?


You can override the default implementation of BaseURLSource and force a  
different hostname for secure URLs. Check the second half of this page for  
an example:

http://tapestry.apache.org/https.html

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



Re: Method arguments in template expansions

2011-06-25 Thread Martin Strand
Just remember that method names are not "shortened" in the same way  
property names are.


i.e. invoking this method:
public String getClass(String link)

would look like:
${getClass('link1')}

On Sun, 26 Jun 2011 01:33:39 +0200, Robert Zeigler  
 wrote:



Have you tried? :)
${} is using the property expression language under the hood, which  
/does/ support method evaluation/method arguments, so I would expect  
${class('link1')} to work... but i haven't tried it, either. :)


Robert

On Jun 25, 2011, at 6/256:31 PM , Joel Halbert wrote:


I'm pretty sure the answer's NO, but just incase I'll ask anyway.

Is it possible to include method arguments in template expansions?

I would die to be able to just do this:

link1
link2
link3


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



Re: T5 Reference page attributes from a component

2011-06-23 Thread Martin Strand

On Thu, 23 Jun 2011 23:18:39 +0200, Tony Nelson 
wrote:


In our T4 app we made a lot of use of this type of construct:

default-value="ognl:page.selectedColumn" />


This particular component is embedded 4 layers deep and was able to  
reach back all the way to Page class to get values.  Is there a similar  
construct in T5 or am I going to have to pass these values explicitly  
down the components?


Perhaps the page could store this data in the Environment and let the  
component access it from there?
Check out the documentation here to see whether it's a suitable option in  
your case:

http://tapestry.apache.org/environmental-services.html

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



Re: T5: How to use context-param or init-param from web.xml in contributeApplicationDefaults?

2011-06-16 Thread Martin Strand
ApplicationDefaults is only one of many SymbolProviders, you don't need to  
configure that specific SymbolProvider to set the supported locales.
There are other options, including support for .properties files or system  
properties.



I prefer context parameters myself, everything should "just work" if you  
add it to web.xml like so:



  tapestry.supported-locales
  en,de


The ServletContextSymbolProvider will handle the rest for you.
I'm sure you're already doing this for other symbols, at least  
"tapestry.app-package" :)



On Fri, 17 Jun 2011 00:28:17 +0200, Nillehammer  
 wrote:



Hi List,

I would like to replace the constant Strings in the method  
"contributeApplicationDefaults" in my AppModule. E.g. replace the  
following line:


configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,de"); // don't  
like the "en,de" here. Would like to replace it.


with something configurable in  a text file. I thought providing the  
values in web.xml either as context-param or as init-param for the  
TapestryFilter was a good idea.


My first try was to inject the Context service as additional parameter  
to the contribution method to get access to the context-params. That did  
not work. The parameter is null and Tapestry throws an exception. Same  
with ApplicationGlobals.


I then browsed through Tapestry's source code and found out that I could  
implement my own filter inheriting from  
org.apache.tapestry5.TapestryFilter. So my next try was to do that and  
override the method "protected void init(Registry registry )". My hope  
was to be able to do something sensible with the  
javax.servlet.FilterConfig that is returned by getFilter(). But I have  
no clue, what to do.


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



Re: T5: property expression language intelligence

2011-05-25 Thread Martin Strand

I agree with Robert.

Also, the purpose of page-name stripping (as I understand it) was never to  
save a few characters when typing.
It was to let page classes have unique and explicit names but still give  
them "pretty" URLs (where words are not repeated)


/edit/user--> pages.edit.EditUser
/edit/group   --> pages.edit.EditGroup
/edit/entity  --> pages.edit.EditEntity

or perhaps:

/user/create  --> pages.user.CreateUser
/user/edit--> pages.user.EditUser
/user/delete  --> pages.user.DeleteUser


On Wed, 25 May 2011 23:09:37 +0200, Robert Zeigler  
 wrote:



And if you can't modify the bean to resolve the ambiguity? :)

It's an interesting idea, but I think it has too much potential for  
confusion + backwards-compatibility issues.  Frankly, I'm not super keen  
on the page-name stripping, but I can tolerate that because they are  
tapestry pages behaving in tapestry ways.  "Property" has a very  
specific definition in the java language and spec, and I think it's a  
bad idea for Tapestry to change that definition for the sake of a few  
characters.


Robert

On May 25, 2011, at 5/253:46 PM , Lenny Primak wrote:

I think in this particular case the bean should fail as being ambiguous  
ie multiply defined property.




On May 25, 2011, at 4:35 PM, Josh Canfield   
wrote:


This is such an extreme example and can be easily caught - I.e.  
Tapestry can say ambiguous/duplicate property' or some such.


:) I'm all about the edge cases. In this case the OP doesn't get to
define his beans so he's going to have to fall back to some other
method of accessing that field. You can do ${order.getDescription()}
or define  a component property for instance. An error is required
though, ${order.description} needs to fail if
${order.orderDescription} is valid.

Josh

On Wed, May 25, 2011 at 12:54 PM, Lenny Primak  
 wrote:
This is such an extreme example and can be easily caught - I.e.  
Tapestry can say ambiguous/duplicate property' or some such.




On May 25, 2011, at 2:27 PM, Josh Canfield   
wrote:



class Order {
public String getOrderDescription();
public String getDescription();
}

Tapestry could simply work as it does today and not apply property
prefix stripping.


This example is exactly why you would not want tapestry to do this.  
If

someone changes your bean definition now all of your templates are
broken, but not broken in a way that tapestry can tell you about but
in a way where the template is now getting data from the wrong
field...

I suppose you have the same problem if you have an
app.pages.order.OrderPage and an app.pages.order.Page, but that seems
less scary to me.

Josh

On Wed, May 25, 2011 at 10:29 AM, Adam Zimowski  
 wrote:
In the project I'm working on, I don't have control over Bean  
design,

so this would be nice to have.

Also, for beans like this one:

class Order {
public String getOrderDescription();
public String getDescription();
}

Tapestry could simply work as it does today and not apply property
prefix stripping.

Adam



On Wed, May 25, 2011 at 12:20 PM, Lenny Primak  
 wrote:

At first glance, seems like a fantastic idea!

On May 25, 2011, at 1:19 PM, Adam Zimowski wrote:

Since Tapestry already does tricks to clean up URL naming  
redundancy,
it would be nice if it did the same with the expression language.  
For

example:

// Bean
class Order {
public String getOrderDescription() {...}
}

// Page
public Order getOrder() {
//...
}

// TML
Instead of having to say this: ${order.orderDescription}

Perhaps this: ${order.description}

Yes? No?

Adam


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



Re: Versioned assets

2011-03-23 Thread Martin Strand

On Thu, 24 Mar 2011 00:45:56 +0100, Thiago H. de Paula Figueiredo
 wrote:


On Wed, 23 Mar 2011 20:26:35 -0300, raulmt  wrote:



Cezary Biernacki wrote:


On Thu, Mar 24, 2011 at 12:04 AM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Why don't you set the application version symbol of your  
application

to a
> given value and never change it?


Really? It will cause all caching problems that version numbers are
supposed
to solve, will not it?


It would. I thought they wanted fixed URLs. Maybe I'm just not  
understanding what the people in this thread want. Some refer to  
"current asset". It implies that the previous asset is available, and it  
isn't.  Maybe they're talking about "current versioned asset *URL*". How  
would Tapestry know for sure and in an efficient way that the request  
was for an old version asset URL?

Any non-matching version would be redirected?



No, not fixed URLs. We want to take advantage of Tapestry's versioned
assets but still let the application respond to requests for "old" asset
URLs that have been published by previous versions of the application.



Any non-matching version would be redirected?


Yes, that is what I suggested and what Cezary apparently already did.
I believe this should work as long as the redirect is not permanent
or cachable.

If we were to deliver cachable assets (or cachable/permanent redirects)
for a future version that has not existed yet, we could run into problems
once that future version is deployed. Some intermediate proxy could then
have mistakenly cached the 'future' asset.

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



Re: Versioned assets

2011-03-23 Thread Martin Strand
Because that would defeat the purpose of automatic version management for  
/assets/ and we would have to rename every asset that changed between  
versions


On Thu, 24 Mar 2011 00:04:29 +0100, Thiago H. de Paula Figueiredo  
 wrote:


Why don't you set the application version symbol of your application to  
a given value and never change it?


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



Re: Versioned assets

2011-03-23 Thread Martin Strand

On Wed, 23 Mar 2011 22:43:55 +0100, raulmt  wrote:

I wanted to know if there is a reason why Tapestry couldn't just answer  
the
requests for assets independently of the requested version. I believe  
that

it is better to answer with a newer version than to just not answering at
all… In AssetDispatcher, this could be done by just processing the   
request

when its path starts with RequestConstants.ASSET_PATH_PREFIX and then to
generate the virtualPath by stripping from this constant to the next "/"
(assuming there is a version in the middle, which will be true for all  
the

URLs generated by Tapestry).

Could this cause problems in some way?



This sounds like a very good idea. I can think of a few scenarios where it  
would be helpful:


- cached or saved html documents from your application, with old asset URLs

- external pages referencing assets on your site

- google image search - the search engine might have indexed an old asset  
URL that no longer works


A version upgrade resulting in 404 for all old asset URLs just feels  
wrong. Cool URIs don't change :)

http://www.w3.org/Provider/Style/URI


There is however one potential problem I can think of:
An application running v1.2 gets a request for a newer version  
/assets/1.3/ctx/script.js and delivers its own copy of that script.
That script will then get cached by clients and proxies (maybe even your  
own Squid server) so when you later upgrade your app to v1.3, clients will  
use the cached copy and your app won't even get a chance to deliver the  
upgraded script.


Perhaps the AssetDispatcher could check the requested version number and  
if it doesn't match the app version, send a 302 redirect to the "correct"  
URL?

/assets/1.3/ctx/script.js --> /assets/1.2/ctx/script.js

Or perhaps it should only deliver the asset if the requested version os  
older than or equal to the app version?
Determining "older" and "newer" would however assume people name their  
application versions in a certain way.


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



Re: [ANN] Tapestry 5 in Action MEAP started

2011-03-23 Thread Martin Strand
On Wed, 23 Mar 2011 20:10:28 +0100, Igor Drobiazko  
 wrote:



Dear all,

I'm pleased to announce that the long awaited Tapestry 5 in Action book  
is

available through MEAP now.

For more details read here:

http://blog.tapestry5.de/index.php/2011/03/23/tapestry-5-in-action-meap-started/



Great news, I just ordered a copy!

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



Re: Tapestry 5 - cache issue when accessed via proxy

2011-03-18 Thread Martin Strand
On Fri, 18 Mar 2011 12:39:03 +0100, Thiago H. de Paula Figueiredo  
 wrote:


On Fri, 18 Mar 2011 01:25:43 -0300, sunmoor007   
wrote:



Added the below method to AppModule.java

public LinkCreationListener buildLinkCreationListener(
LinkCreationHub hub) {


Make the method static and try again please.


Builder methods do not need to be static.


Either way, this thread is based on a false premise:

I believe the only way to prevent the proxy server caching links is to  
have
a dynamic parameter in url so that everytime proxy server identifies it  
as a

new request and hence it wont cache.


That is simply not true. Any working proxy server would never cache a  
response which has appropriate headers such as Cache-Control: no-cache or  
no-store.
If this really isn't working you should dig deeper and find out why, e.g.  
are you sure the headers were really added to the response?

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

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



Re: How to specify a multi-parameter literal context?

2011-02-25 Thread Martin Strand
On Fri, 25 Feb 2011 15:48:57 +0100, Everton Agner   
wrote:



You could instead use the prop: binding to create a list, like so:


'context2']">link

is there any need to create any getter in the page class? since 'prop' is
usually bound to a property/getter. I didn't know this approach..


No need for getters in this particular case.
'prop' is a slightly misleading name, since it is able to do more than  
simple properties. Check the bottom of this page for some examples:

http://tapestry.apache.org/property-expressions.html

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



Re: How to specify a multi-parameter literal context?

2011-02-25 Thread Martin Strand
On Fri, 25 Feb 2011 14:01:21 +0100, Richard Hill   
wrote:




Hi,

If I missed this in the docs, mailing list apologies. I am trying to
render a page link with 2 context parameters:

link

This renders as "mypage/context1$002fcontext2", ie the "/" has been tap
encoded. As such as opposed to:

public void onActivate(context1, context2)

being called, this is:

public void onActivate(context1)

where context1 is passed as "context1/context2"

How can i specify multiple contexts with literal: ?



The literal: prefix always results in a single string, what you're looking  
for is an array with two strings.


You could instead use the prop: binding to create a list, like so:

link


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



Re: Tapestry 5 - cache issue when accessed via proxy

2011-02-20 Thread Martin Strand
If you want to use the exact same URL to serve different content, you'll  
need to make sure the response is never cached by the client.

Add appropriate HTTP headers to the response:

@Inject
private Response response;

void onActivate(...)
{
  response.setHeader("Cache-Control", "no-cache");
  response.setDateHeader("Expires", 0);
}




On Mon, 21 Feb 2011 05:11:43 +0100, sunmoor007  wrote:



Hi Josh

Thanks for your response. You're right. We dont have the search  
parameter in

the URL but wondering how does it work in a scenario where there no proxy
server. I have seen an option disableCaching. If i enable that, will it
work.

Considering the option you mentioned, am guessing if we can add some  
dynamic

parameter in url which changes for each request which should resolve the
problem.

I will anyway check the proxy logs.

Thanks
Sundar


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



Re: t5: @Secure and jetty

2011-01-22 Thread Martin Strand
If you want Jetty to listen on port 8080 too, you will need to add a  
connector for that:





  implementation="org.mortbay.jetty.security.SslSocketConnector">

...
  

  
 8080
  




http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin

On Sat, 22 Jan 2011 10:36:00 +0100, Angelo C.   
wrote:




Hi,

i can access pages annotated with @Secure like:
https://localhost:8443/login
but I can't access plain connection in the same app:  
http://localhost:8080
if I set tapestry.secure-page to true and access https://localhost:8443  
and

all other pages it works.
anything I need to adjust? following is my pom's jetty part:

implementation="org.mortbay.jetty.security.SslSocketConnector">

8443
3
/etc/keystore
pwd123
pwd123
 /etc/keystore
pwd123

thanks.


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



Re: utf-8 (swedish) characters in the URL

2011-01-13 Thread Martin Strand

Hi Mats.
I believe you need to URLEncode those characters before returning them  
from your custom URLEncoder.
This is what I'm doing and it works fine in our app - Unicode characters  
show up "pretty" in the address field.


/searchresult/övrigt
/searchresult/日本


PrettyURLEncoder.java:

public String encode(String input)
{
  String output = customEncoding(input);
  ...
  // Encode characters before giving the URL to the client...
  return java.net.URLEncoder.encode(output, "UTF-8");
}

public String decode(String input)
{
  ...
  // ...and decode them on their way back
  input = java.net.URLDecoder.decode(input, "UTF-8");
  ...
}


We are however using 5.2 and Jetty, not sure whether that makes a  
difference.



Martin


On Thu, 13 Jan 2011 12:20:38 +0100, Mats Andersson  
 wrote:




I have tried hard to get this working in Tapestry 5.1, but can't get it  
to work 100%.


My intention is to have search parameters in the activation context to  
support RESTful URL:s for my search results page. This works out of the  
box in Tapestry, but since the Tapestry specific encoding of non-ascii  
characters ($) is not very user friendly, or search engine friendly,  
I have replaced the URLEncoder with my own implementation. Currently it  
accepts the swedish characters to be sent as is, just as the normal  
ascii characters. This also requires that Tomcat is set up correctly:




This way the user can enter swedish characters in the URL, which are  
handled correctly on the server. So far so good.




The problem is when returning utf-8 strings from onPassivate(). When the  
value arrives in onActivate() the swedish characters are all replaced by  
the replacement character U+FFFD, or 65533 (diamond with question mark),  
making it impossible to know what character it was from the beginning.  
It seems like it is HttpServletRequest.getServletPath() called from  
RequestImpl.java that causes this.


 From the service method of a contributed HttpServletRequestHandler you  
can see the results from calling the HttpServletRequest methods:


 request.getServletPath: /searchresults/?vrigt
 request.getRequestURI: /searchresults/%F6vrigt
 service: request.getRequestURL:  
http://192.168.0.100:8080/searchresults/%F6vrigt


Have anyone solved this, or am I doing something that is not supposed to  
work in Tapestry 5.



Regards,
Mats


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



Re: @SessionState Bug?

2011-01-06 Thread Martin Strand
Tapestry will treat the two as the exact same SessionState since they both  
are java.util.List - the Boolean/String type parameters will not help  
differentiate between the two.
It is possible to get around this by changing one of them to  
Collection/Iterable/ArrayList/etc so that they use two distinct types:



@SessionState(create=false)
private List booleans;

@SessionState(create=false)
private Collection strings;


but I wouldn't recommend that since it's easy to mix them up and have them  
reversed in some other page class.




I believe Josh Canfield has been working on better generics support for  
Tapestry 5.3, it's possible that his improvements cover this particular  
case so that it works as you expect.




On Thu, 06 Jan 2011 15:38:21 +0100, Michael Gentry   
wrote:



Hi everyone,

Given the following page class:


public class Bug
{
@Inject
private Logger log;

@SessionState(create=false)
private List booleans;

@SessionState(create=false)
private List strings;

void onActivate()
{
log.debug("booleans = " + booleans);
log.debug("strings = " + strings);

if (booleans == null)
booleans = new ArrayList();

booleans.add(Boolean.TRUE);

log.debug("booleans: " + booleans);
log.debug("strings: " + strings);
log.debug("equal? " + booleans.equals(strings));
}
}

I get this output:

DEBUG 2011-01-06 09:35:24,014 booleans = null
DEBUG 2011-01-06 09:35:24,014 strings = null
DEBUG 2011-01-06 09:35:24,014 booleans: [true]
DEBUG 2011-01-06 09:35:24,014 strings: [true]
DEBUG 2011-01-06 09:35:24,015 equal? true


Even though I don't add anything to the strings list or even allocate
the strings list, it seems to be pointing to the booleans list, which
is, of course, incorrect.  This seems to be happening on both 5.1 and
5.2.  Am I missing something?

Thanks,

mrg


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



Re: T5: archiving a page

2010-12-30 Thread Martin Strand

If Java is not required, you could use CutyCapt to render the page:
http://cutycapt.sourceforge.net/

It supports jpeg, pdf and more.

On Thu, 30 Dec 2010 16:23:15 +0100, Angelo C.   
wrote:




Hi,

Is there a way to archive a page? say render it into a jpeg or a pdf ?

Angelo


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



Re: Should Tapestry phone home?

2010-10-11 Thread Martin Strand
I don't like this idea. Perhaps I'm one of those privacy-minded people  
since we use Tapestry in a security sensitive context (credit cards).



I remember some time ago when we looked at upgrading Quartz and were  
surprised to see the new version trying to dial home in a similar manner  
(by default)


Update checker, added in 1.7.2
http://jira.opensymphony.com/browse/QUARTZ-842

An option to turn it off, added in 1.8:
http://jira.terracotta.org/jira/browse/QTZ-29

Not so funny when this unnecessary feature introduces new bugs:
http://jira.terracotta.org/jira/browse/QTZ-28


To me, adding a feature like this communicates to users that the  
library/framework in question is not meant to be used in an "enterprise"  
environment since nothing like this would get past QA (at least not where  
I work)


On Mon, 11 Oct 2010 18:49:13 +0200, Howard Lewis Ship   
wrote:



What would be the repercussions if Tapestry included a start-up filter
that "reported" the application startup back to some central location,
so that we could get some idea of where and how Tapestry is being
used?  Obviously, this would be documented, in such a way that it
would be easy to turn off for the privacy-minded.


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



Re: Is there any way to render the "get" method of form?

2010-09-28 Thread Martin Strand
On Tue, 28 Sep 2010 18:47:17 +0200, Manuel Sugawara  
 wrote:



On Tue, Sep 28, 2010 at 11:24 AM, Martin Strand <
do.not.eat.yellow.s...@gmail.com> wrote:


Of course is a matter of taste but I rather have

http://localhost/?q=c%E1lculo+diferencial<
http://localhost/?q=c%C3%A1lculo+diferencial>than

http://localhost:8080/C$00e1lculo$0020diferencial



I happen to prefer the second URL so I am doing this with an activation
context, just as you describe:

POST /search.form
redirects to
GET /search/my-search-query



Which requires an extra round trip to the server that is not needed at  
all.

See
http://royal.pingdom.com/2010/09/22/is-the-web-heading-toward-redirect-hell/

Regards,
Manuel.


Indeed, but this is just what I wanted in my particular case.
I'm using a custom Form component where the POST request is validated and  
any error messages are immediately displayed in an uncachable response,  
without any redirection.
If the form validates, a redirect sends the client to a new URL that is  
cachable for a very long time.



It's not impossible to use GET method for forms, it's just that the  
built-in form component doesn't support this so you would have to roll  
your own.
As far as I can tell from how Tapestry uses client side form data to  
replay events on the server, the GET URL you suggest would not be able to  
trigger all the validate/submit/success/etc events that the built-in form  
component does.
If you don't need functionality like that from the Form component, I  
suppose you could create a very simple GetForm component and use that  
instead.
I'm guessing you would also have to provide your own FormSupport in order  
to use built-in components such as TextField etc


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



Re: Is there any way to render the "get" method of form?

2010-09-28 Thread Martin Strand
On Tue, 28 Sep 2010 17:58:35 +0200, Manuel Sugawara  
 wrote:


On Tue, Sep 28, 2010 at 7:08 AM, Thiago H. de Paula Figueiredo  
 wrote:


On Tue, 28 Sep 2010 05:41:50 -0300, Lutz Hühnken  
 wrote:



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



Use Form and leave it using POST. If you want a bookmarkable URL, use  
the
page activation context instead. Tapestry and the form field components  
do

all the value handling for you.


Of course is a matter of taste but I rather have
http://localhost/?q=c%E1lculo+diferencialthan
http://localhost:8080/C$00e1lculo$0020diferencial


I happen to prefer the second URL so I am doing this with an activation  
context, just as you describe:


POST /search.form
redirects to
GET /search/my-search-query

If you're concerned about the peculiar characters showing up in the  
activation context ($0020 etc) you could ovverride the default URL encoder  
and provide your own version to get prettier URLs:

http://localhost:8080/Cálculo+diferencial

Here's an example to get you started:
http://www.mail-archive.com/users@tapestry.apache.org/msg44973.html

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



Re: throw new PageRedirectException

2010-09-23 Thread Martin Strand
On Thu, 23 Sep 2010 04:43:28 +0200, asianCoolz   
wrote:



IEngineService pageService = getPageService();

   String pageName = "NextTapestryPage";
   ILink link = pageService.getLink(false, pageName);
   throw new RedirectException(link.getAbsoluteURL());



if page is IPage, and i set parameter to the page.setExtraParameter(abc);
how to get absoluteurl for this IPage? rathan than "string" that you  
suggested

for pageName.


I haven't used Tapestry 4 for a while, but I'm pretty sure that you can  
pass all the parameters to getLink(...) in an array, starting with the  
page name:


IPage page = ...;
Object abc = ...;
String pageName = page.getName();
ILink link = pageService.getLink(false, new Object[] {pageName, abc,  
moreParameters(), etc} );

throw new RedirectException(link.getAbsoluteURL());

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



Re: throw new PageRedirectException

2010-09-22 Thread Martin Strand

This is in Tapestry 4, right?
To send the client to a different URL you can throw a RedirectException  
instead:


void redirectToNextPage()
{
  IEngineService pageService = getPageService();
  String pageName = "NextTapestryPage";
  ILink link = pageService.getLink(false, pageName);
  throw new RedirectException(link.getAbsoluteURL());
}

You also need to inject the page service in your page/component class:

@InjectObject("engine-service:page")
public abstract IEngineService getPageService();


On Wed, 22 Sep 2010 12:00:10 +0200, asianCoolz   
wrote:


with throw new PageRedirectException("NextTapestryPage"); , i was  
redicectd to
another page, but the url on the browser address bar is not change.   is  
there

any method i can call "forward", so that use 'forward' to another page


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



Re: Versioned assets

2010-09-07 Thread Martin Strand

On Tue, 07 Sep 2010 13:14:02 +0200, LLTYK  wrote:



What it should do is instead insert some sort of hash of the file's  
contents

in the url. Then whenever your file changes the browser won't pick up the
previous cached version, but if your app version changes and the file
doesn't, the url remains the same.



That would probably break relative URLs in stylesheets.

I suppose the best option would be to accept all asset reqs with an  
invalid version number, but redirect them to a URL with the correct  
version number.

Cool URIs don't change!  http://www.w3.org/Provider/Style/URI.html

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



Re: OT: Web Services

2010-08-29 Thread Martin Strand

On Sun, 29 Aug 2010 19:35:11 +0200, Jim O'Callaghan
 wrote:

I'm aware this is off topic, but since there are so many people on the  
list

with a broad skill set am hoping I can learn from their experiences /
heartbreak.  I am evaluating various WS stacks for interfacing with a  
system

- currently I am using XFire as it requires very little configuration and
performs quite efficiently.  XFire appears to qualify every xml element  
with
a namespace, bloating the payload considerably, or, if using the patch  
from

http://jira.codehaus.org/browse/XFIRE-687 appears to have unreliable /
inconsistent namespace qualifiers.  Can anyone recommend a good WS stack
they have positive experience of?  My constraints are quite liberal -  
java
1.5 up, currently jetty as an AS, spring 3.0.2.RELEASE.  Is CXF any  
good?  I
want to find something with good performance obviously, minimal config,  
and
hopefully something that consistently defines package level namespaces  
at an

envelope level and reuses them.


Many thanks,

Jim.


I've been using axis2 for several years to generate clients for a few 3rd  
party web services (I presume you're talking about client code)


Can't really say I would *recommend* it because it was a pain to get it  
working with Maven and I haven't even bothered to go through that again  
with 1.4.x or 1.5.x so I'm still using 1.3.
But, it's very simple once you set up the build - Maven will generate  
POJOs in target/generated-sources/... and when you invoke methods on those  
POJOs everything "just works".
The axis2 1.3 POMs are a mess though so there are lots of excludes here to  
get rid of unnecessary dependencies:










org.apache.axis2
axis2-wsdl2code-maven-plugin


some-service

wsdl2code



${basedir}/src/main/wsdl/some-service.wsdl
com.example.service

com.example.service=com.example.service
sync



some-other-service

wsdl2code



${basedir}/src/main/wsdl/some-other-service.wsdl
com.example.other

com.example.other=com.example.other
sync






...



org.apache.axis2
axis2-kernel
1.3


avalon-framework
avalon-framework


backport-util-concurrent
backport-util-concurrent


javax.mail
mail


javax.activation
activation


javax.servlet
servlet-api


commons-fileupload
commons-fileupload


junit
junit


org.apache.woden
woden


org.apache.geronimo.specs
geronimo-jms_1.1_spec


xml-apis
xml-apis


org.codehaus.woodstox
wstx-asl


annogen
annogen


xalan
xalan


stax
stax-api


jaxen
jaxen


commons-io
commons-io


org.apache.httpcomponents
httpcore-niossl


org.apache.httpcomponents
httpcore


org.apache.httpcomponents
httpcore-nio


xerces
xercesImpl


org.apache.ws.commons.axiom
 

Re: [T5.2] Javassist 3.12.1.GA checksum error

2010-08-25 Thread Martin Strand
Yes, I came acoss this too but "solved" it by temporarily turning off  
checksum validation in nexus... :\



On Mon, 23 Aug 2010 13:26:13 +0200, Blower, Andy  
 wrote:


I'm trying to migrate our application to T5.2, but I'm getting a  
checksum error with Javassist 3.12.1.GA


C:\tmp>fciv -sha1 javassist-3.12.1.GA.jar
526633327faa61aee448a519e8a4d53ec3057885   
javassist-3.12.1.ga.jar


http://repository.jboss.org/nexus/content/groups/public-jboss/javassist/javassist/3.12.1.GA/javassist-3.12.1.GA.jar.sha1

5e1f0b5574efb7b16be9b1b47195a5be0b65a365


Anyone else had this problem? I'll try and figure out where to report  
this to JBoss, but I would have thought I wasn't the only Tapestry user  
to run into this issue. I looked at 3.9.0.GA as used by Tap5.1.0.5 and  
that is fine from the same repository.


Thanks,

Andy.


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



Re: [ANNOUNCEMENT] tapestry-watchdog 0.0.1 released!

2010-05-31 Thread Martin Strand

There's still the usual


List-Id: users.tapestry.apache.org


so filtering should work as normal

On Mon, 31 May 2010 05:51:28 +0200, Paul Stanton   
wrote:



not offended, just distracted .. since the email isn't addressed
'to:users@tapestry.apache.org' it misses my current mail filter and
popped into my main mailbox .. i didn't mean get anyone's back up.

p.

Kalle Korhonen wrote:

My apologies if announcing Tynamo modules on Tapestry users list
offend anybody - if community feels that way, we have no problem
keeping the announcements only on Tynamo lists and site. However, as
an open source project completely based on Tapestry, I would have
thought Tapestry users would generally be interested in our releases.
In any case, "solicitation" feels pretty degrading. It's not like
anybody's making any money out of this. Suppose a vote is on order if
there are others who feel Tynamo or other related Tapestry projects
shouldn't be announcing on Tapestry Users list.

Kalle


On Sun, May 30, 2010 at 5:43 PM, Paul Stanton   
wrote:


How do I unsubscribe from tynamo's solicitation without leaving the  
tapestry

users list?

Kalle Korhonen wrote:


Hey all, it's the Tynamo project here again. Just to keep up with
releasing something new every month, we are announcing
tapestry-watchdog, version 0.0.1! This module got released sometime
ago but as a multi-process application that most of the time doesn't
do much but needs to deliver when the time comes, we took a bit longer
to test it out. tapestry-watchdog is an "embedded watchdog" that sends
an email to you right away if something happens to your parent process
(we've all seen an OutOfMemoryError right?) Configuring
tapestry-watchdog couldn't be any simpler to configure, but read more
about it from our tapestry-watchdog guide
(http://tynamo.org/tapestry-watchdog+guide).

Enjoy,
Tynamo Team

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





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





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






--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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



Re: RenderSupport Scope

2010-05-30 Thread Martin Strand

If you want to declare a global function from within Tapestry.onDOMLoaded, you 
can simply add it to the windows object:

window.myGlobalFunction = function() {
  doCoolStuff();
}

You can then access that function from anywhere if you prefer to do things this 
way:




Martin

On Sun, 30 May 2010 04:59:44 +0200, Pablo dos Reis  
wrote:


Hi Thiago,

When the Tapestry creates the script.
It puts the script inside a other method.
Tapestry.onDOMLoaded() in this case.

So when I try call it method using a js the method created by RenderSupport
is not visible for js.



I resolved the following
  writer.element("script", "language", "JavaScript");
writer.write(script);
writer.end();

Then ran!!

But maybe is not the better way.

I had to use RenderSupport because in js I don't know the element's id for
implements a method that return the component value.

2010/5/29 Thiago H. de Paula Figueiredo 


On Sat, 29 May 2010 23:18:28 -0300, Pablo dos Reis 
wrote:

 When I inject javaScript using renderSupport not is possible access the

methods created in the class through a js file.



Hi, Pablo!

I'm not sure what you're talking about, but remember that any JavaScript
code added through RenderSupport.addScript() ends up in a 

Re: Using / Injecting Tapestry 5 services in objects that are *not* components / pages / services

2010-05-25 Thread Martin Strand

On Tue, 25 May 2010 12:07:05 +0200, Andreas Berg  wrote:


The only way I
see so far is to pass the service as parameters or by constructor to my
domains objects, which is not very nice.


What's bad with constructor injection?
I would personally even prefer to have constructor injection in component  
classes too.


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



Re: Tapestry5 template name simplification

2010-05-10 Thread Martin Strand

In my experience, this strategy automatically gives prettier URLs in most cases 
but still allows you to have unique class names that make sense:

.details.CustomerDetails --> /details/customer/123
.details.PaymentDetails  --> /details/payment/123
.list.CustomerList   --> /list/customer
.list.PaymentList--> /list/payment
.support.SupportIndex--> /support
.signup.SignupIndex  --> /signup

Leaving the package name would make the URLs slightly "uglier".
This is merely a "nice to have" feature.

On Mon, 10 May 2010 13:53:54 +0200, sandeepraj singh 
 wrote:



Thanks For the reply Kris,

But thats very subjective.I can easily overrule this by having
address/EmployeeAddressList and customer/HighlyPaidCustomerList

So i was just thinking why this special take care when there is some
redundancy due to my pages being named somewhat same to my
package(address-->addresslist).

I dont want to sound too panicky, but i find it hard to explain the strategy
to people when i am training them.

People from JSP / Servlet background(like me and thousands here) find the
strategy very hard to understand.

Thanks
Sandeep


kristian.marinkovic wrote:


hi sandeep,

the reason to do so is to have prettier URLs.

When developing an application you tend to
group your pages into logical packages. lets
assume your application is able to change
Customer and Address objects. So you'll have
a bunch of pages in the respective packages.
Its very common to have a CustomerList and a
AddressList page that diplays the result of a search.
not altering the URL would result in following page
URLs:
address/addresslist/
customer/customerlist/
(funny note: i really had a customer that considered
above urls as invalid or faulty, because of the
duplication; he expected something like addresslist/)

T5 will recognize this pattern and change these URLs
to:
address/list
customer/list

What are the alternatives? You could rename your pages
to List, but then you'll end up with multiple List classes in
different packages. Or you  could add an own UrlRewriteRule
for every list page.


i hope this helps
g,
kris



Von:sandeepraj singh 
An: users@tapestry.apache.org
Datum:  10.05.2010 08:35
Betreff:Tapestry5 template name simplification




hi,

As per the tapestry5 documentation
"
In certain cases, Tapestry will simplify the the logical name of a page.
For
example, the page class org.example.pages.address.Create Address will be
given a logical name of "address/Create" (the redundant "Address" is
removed
as a suffix) "



I wanted to understand, why does tapestry5 take extra pains to do it. Is
there a huge advantage for doing this?
Any explanation would help because, otherwise it looks confusing to see an
altered URL.

Thanks
Sandeep
--
View this message in context:
http://old.nabble.com/Tapestry5-template-name-simplification-tp28508162p28508162.html

Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: How to load tml files from the filesystem instead of classpath?

2010-05-05 Thread Martin Strand

Decorating will probably work, but you can also construct the service from 
within your contributing method:

public static void contributeServiceOverride(MappedConfiguration 
configuration, @ContextProvider AssetFactory contextAssetFactory, 
ComponentClassResolver componentClassResolver)
{
configuration.add(PageTemplateLocator.class, new 
PageTemplateLocatorFileSystemImpl(contextAssetFactory.getRootResource(), 
componentClassResolver));
}



On Thu, 06 May 2010 00:11:51 +0200, MauricioF  wrote:



M, overriding makes T5 throw an exception

Caused by: org.apache.tapestry5.ioc.internal.OperationException: Service
interface org.apache.tapestry5.internal.services.PageTemplateLocator is
matched by 2 services: PageTemplateLocator, PageTemplateLocatorFileBased.
Automatic dependency resolution requires that exactly one service implement
the interface.

What I´ve done:
In my module

@ServiceId("TemplateFileSystem")
public static PageTemplateLocator
buildPageTemplateLocatorFileBased(@ContextProvider
AssetFactory contextAssetFactory,

ComponentClassResolver componentClassResolver)
{
  return new
PageTemplateLocatorFileSystemImpl(contextAssetFactory.getRootResource(),
componentClassResolver);
}

public ComponentTemplateSource
buildComponentTemplateSource(TemplateParser parser,
@InjectService("TemplateFileSystem") PageTemplateLocator locator,
ClasspathURLConverter classpathURLConverter)
{
ComponentTemplateSourceImpl service = new
ComponentTemplateSourceImpl(parser, locator, classpathURLConverter);
return service;
}


As you can see it doe not matter if I add the serviceId and then inject the
service by name!
The problem is that the one which is throwing the exception is in
org.apache.tapestry5.internal.services.InternalModule (which I cannot
modify)

So in this case I cannot override?

An alternative can be decorate the service (ignoring whatever it does and my
small bits of logic
to return a resouce based in the FileSystem) but I´d rather do it using
overriding.

Thanks!


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



Re: How to load tml files from the filesystem instead of classpath?

2010-05-05 Thread Martin Strand

On Wed, 05 May 2010 22:50:00 +0200, MauricioF  wrote:


Ideally I´d like to register in my module a new implementation of 
PageTemplateLocator
Any other idea how can I do this? (If you think override PageTemplateLocator
is not the right thing..)

Thanks


Yes, that's what you need to do. You can override built-in services by adding a 
contribution to ServiceOverride:

http://tapestry.apache.org/tapestry5.1/tapestry-ioc/cookbook/override.html


In your case I believe it would look something like this:

public static void contributeServiceOverride(MappedConfiguration 
configuration)
{
  configuration.add(PageTemplateLocator.class, new MyOwnImplementation(...));
}

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



Re: t5: properties files

2010-03-19 Thread Martin Strand

Don't know if I understand your question, but if you want to read .properties 
in UTF-8 format you can do this with JDK 6:

new Properties().load(new InputStreamReader(yourInputStream, 
Charset.forName("UTF-8")));


On Fri, 19 Mar 2010 07:31:12 +0100, Angelo Chen  
wrote:



Hi,

As I understand, Tapestry treats app_?.properties files as UTF-8 encoded and
converts them to ISO-8850-1 with unicode escapes. however, this does not
apply to the properties files accessed by Properties class, any idea how to
do the same thing as what t5 is doing to those app.properties files? Thanks,

Angelo



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



Re: Replicating t:id into component html id

2010-02-20 Thread Martin Strand

Tapestry will generate an id automatically and render it as an 'id' attribute 
if you invoke getClientId() on the PageLink in question.
This is the typical use case where you would run a short script to manipulate 
the element, something like this:


Hello

document.getElementById("${myPageLink.clientId}").doStuff();





If the 'id' attribute would be equal to your t:id at all times (as you propose) 
loops would create duplicated ids:



  
  ${currentPage}





It is good practice get the generated id by invoking getClientId() instead of 
explicitly setting your own value for 'id'.

Martin

On Sat, 20 Feb 2010 15:32:36 +0100, Lionel Touati  wrote:


Hi List,

I may have missed something, but it seems that t:Id is not transformed into a 
html ID at least for the pagelink component. It seems quite odd to me, as you 
then need to add the id field manually in the TML file. Also it does not seem 
to be consistent with the form fields for example


I've done a patch org.apache.tapestry5.corelib.base.AbstractLink to support 
this in all links


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



Re: integrating a web services stack

2010-02-17 Thread Martin Strand

Same here - would have preferred #1 but implemented #2 because it was much 
simpler

On Wed, 17 Feb 2010 13:09:25 +0100, Peter Stavrinides 
 wrote:


Hi Uli,

I opted out of 3, since I don't use Spring, so thought it would be overkill 
bringing too much baggage. I would love to see an actual example of 1, it could 
be interesting... but I settled for a version of 2, from what I understood this 
was the simplest approach to get working.

Cheers,
Peter


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



Re: T5: Testing service scope

2010-02-17 Thread Martin Strand

Hmm, why different instances? Wouldn't every thread see the same proxy instance?

Martin

On Wed, 17 Feb 2010 12:17:35 +0100, Ulrich Stärk  wrote:


Querying the registry for the same service from different threads should yield 
different instances
when using the perthread scope. Just test that. No need for a request if your 
service doesn't
require one.

Uli

On 17.02.2010 11:42 schrieb Inge Solvoll:

Hi!

I recently encountered a bug in one of my services, where it had the wrong
scope because I put the scope annotation on the interface rather than on the
implementing class. I got the idea that I could manually create a T5 IOC
registry to do integration testing on my services. But how can I test
"perthread" scope on services in the test registry when there are no real
requests? I'm assuming this requires mocking the Request object in some way?

Inge


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



Re: Problem: T 5.1.0.5 renders JavaScript comment tag as regular html comment tag

2010-02-12 Thread Martin Strand

Tapestry will remove all HTML comments from the output.
If you don't put the  in there it will work fine:


document.write("Hello World!");



On Fri, 12 Feb 2010 18:22:44 +0100, DavidWei  wrote:



Thanks for reply.

I understand the browser executes javascript codes.

The problem I have is if I just simply execute a html file which includes
javascript codes with comment tag directly using the browser, I can see the
javascript codes are executed. But if I put the same javascript codes inside
of a tml file in Tapestry app, the codes are not executed.

by the way, the simple javascript codes listed in my email is simply used to
be an example, is not something I am using in my app.

So What caused the difference?

David



Thiago H. de Paula Figueiredo wrote:


On Fri, 12 Feb 2010 14:31:09 -0200, DavidWei  wrote:


I am working to upgrade to T 5.1.0.5 and found this problem.

When I include javascript codes with comment tag in tml
file, Tapastry treats it as html comment tag and never run the javasript
codes.


Tapestry doesn't execute JavaScript, the browser does.
By the way, any browser released in the last 8 or 9 years doesn't need you
to put JavaScript code inside HTML comments.
By the way (2), why do you need to write HTML through JavaScript when
you're using a Web framework?

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br


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



Re: T4: forward browser to an external web site

2010-02-07 Thread Martin Strand

This has nothing to do with Tapestry, it's how the HTTP protocol works.
There's just no response you can send which tells the client to POST data to 
another URL. Instead you send a short program which performs the POST and hope 
your client executes that program - that's the script solution.

On Sun, 07 Feb 2010 18:37:15 +0100, Ivano Luberti  wrote:


Yes I had already tought of a solution like taht but I was hoping for a
clean tapestry solution like the you suggested me with the link.
Thanks anyway.
Would instead be possible with T5?

Martin Strand ha scritto:

For POST requests, your initial idea is the way to go:


Of course I can return to the new user a new page with a form that
has
an action that points to the web site, but it would be far better to
have my page class.



So you'll render a form (no need to use the Form component for this)

http://www.example.com/"; id="myForm" method="post">




If you want to submit the form automatically without having your user
click anything, hide the form with CSS and use a script similar to
this at the bottom of your page:

...
...
 
  document.getElementById("myForm").submit();
 






On Sat, 06 Feb 2010 19:30:21 +0100, Ivano Luberti
 wrote:


Thanks Martin: it worked.
But what I could do in case I had to submit a form accepting only POST
method in the form?

Ivano Luberti ha scritto:

I will try that: for whatever reason I was convinced that I had to
submit a form and not simply a link.
But checking twice the docs of the web site I have to forward to, I see
I can use a link.
Thanks for now


Martin Strand ha scritto:


If you just want to redirect the client to another URL, return an
ILink from your form listener:

public ILink formSubmitListener()
{
  // Do work
  // ...

  return new StaticLink("http://www.example.com/";);
}


Martin

On Wed, 03 Feb 2010 10:39:23 +0100, Ivano Luberti
 wrote:



Hello, I'm trying to solve the following problem using T4.1.6.
I want to have the user submit a form , perform some operation in the
page class and then forward the user to an external web site.
Of course I can return to the new user a new page with a form that
has
an action that points to the web site, but it would be far better to
have my page class.
I have tried using a service and HttpClient package but it return and
HttpResponse and I'm not able to convert it to a WebResponse.

Any suggestion?


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



Re: T4: forward browser to an external web site

2010-02-06 Thread Martin Strand

For POST requests, your initial idea is the way to go:


Of course I can return to the new user a new page with a form that has
an action that points to the web site, but it would be far better to
have my page class.



So you'll render a form (no need to use the Form component for this)

http://www.example.com/"; id="myForm" method="post">




If you want to submit the form automatically without having your user click 
anything, hide the form with CSS and use a script similar to this at the bottom 
of your page:

...
...
 
  document.getElementById("myForm").submit();
 






On Sat, 06 Feb 2010 19:30:21 +0100, Ivano Luberti  wrote:


Thanks Martin: it worked.
But what I could do in case I had to submit a form accepting only POST
method in the form?

Ivano Luberti ha scritto:

I will try that: for whatever reason I was convinced that I had to
submit a form and not simply a link.
But checking twice the docs of the web site I have to forward to, I see
I can use a link.
Thanks for now


Martin Strand ha scritto:


If you just want to redirect the client to another URL, return an
ILink from your form listener:

public ILink formSubmitListener()
{
  // Do work
  // ...

  return new StaticLink("http://www.example.com/";);
}


Martin

On Wed, 03 Feb 2010 10:39:23 +0100, Ivano Luberti
 wrote:



Hello, I'm trying to solve the following problem using T4.1.6.
I want to have the user submit a form , perform some operation in the
page class and then forward the user to an external web site.
Of course I can return to the new user a new page with a form that has
an action that points to the web site, but it would be far better to
have my page class.
I have tried using a service and HttpClient package but it return and
HttpResponse and I'm not able to convert it to a WebResponse.

Any suggestion?


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



Re: T4: forward browser to an external web site

2010-02-03 Thread Martin Strand

If you just want to redirect the client to another URL, return an ILink from 
your form listener:

public ILink formSubmitListener()
{
  // Do work
  // ...

  return new StaticLink("http://www.example.com/";);
}


Martin

On Wed, 03 Feb 2010 10:39:23 +0100, Ivano Luberti  wrote:


Hello, I'm trying to solve the following problem using T4.1.6.
I want to have the user submit a form , perform some operation in the
page class and then forward the user to an external web site.
Of course I can return to the new user a new page with a form that has
an action that points to the web site, but it would be far better to
have my page class.
I have tried using a service and HttpClient package but it return and
HttpResponse and I'm not able to convert it to a WebResponse.

Any suggestion?


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



Re: [ANNOUNCEMENT] New Tapestry 5 book

2009-11-12 Thread Martin Strand

Same here, but I came to my senses when my friend reminded me that my German is limited 
to high school level - "Herr Ober, zahlen bitte" :D

On Thu, 12 Nov 2009 12:07:40 +0100, Inge Solvoll  
wrote:


I'm even considering buying it in german, even though my german isn't too
good :)

On Thu, Nov 12, 2009 at 12:00 PM, Nikolaos Konstantinou wrote:


Same here, I would gladly buy a book about Tapestry in English.

On Thu, Nov 12, 2009 at 12:47 PM, Blower, Andy
wrote:

> +3 (at least)
>
> > -Original Message-
> > From: Peter Stavrinides [mailto:p.stavrini...@albourne.com]
> > Sent: 12 November 2009 09:15
> > To: Tapestry users
> > Subject: Re: [ANNOUNCEMENT] New Tapestry 5 book
> >
> > +1
> >
> >
> > - Original Message -
> > From: "Ivano Luberti" 
> > To: "Tapestry users" 
> > Sent: Thursday, 12 November, 2009 10:21:35 GMT +02:00 Athens, Beirut,
> > Bucharest, Istanbul
> > Subject: Re: [ANNOUNCEMENT] New Tapestry 5 book
> >
> > +1
> > If you need something signed with blood, drop me a copy of the document
> > :-D
> >
> >
> > Igor Drobiazko ha scritto:
> > > Good news. My publisher made the first step towards the translation.
> > They
> > > contacted several publishers outside Germany to find one that is
> > interested
> > > in translation. If some of them is interested then we will have the
> > english
> > > version of the book.
> > >
> > > If you want to help me to make the translation possible make some
> > noise
> > > here. The more comments here the more likely we will have a
> > translation.
> > > I'll keep you informed about the progress.
> > >
> > > On Wed, Sep 16, 2009 at 7:28 PM, Igor Drobiazko
> > wrote:
> > >
> > >
> > >> Hello folks,
> > >>
> > >> I am pleased to announce a new Tapestry 5 book. The book is written
> > in
> > >> German and is available as eBook on publisher's website:
> > >>
> > >>
> > >> http://www.addison-
> > wesley.de/main/main.asp?page=home/bookdetails&ProductID=174975
> > >>
> > >>
> > >> The hardcover version of the book will be available starting from
> > Sep 28
> > >> 2009.
> > >> I'll make another announcement when the hardcover version is
> > released.
> > >>
> > >> Among other things the book covers :
> > >>* Getting Started with Tapestry 5
> > >>* Concepts of the framework
> > >>* Localization/internationalization
> > >>* Creating Forms
> > >>* Generation of user interfaces for JavaBeans
> > >>* Writing own components and mixins
> > >>* Ajax
> > >>* Writing tests for Tapestry applications
> > >>* Hibernate and Spring integration
> > >>* Dependency Injection and Tapestry IoC
> > >>* AOP and bytecode manipuation
> > >>
> > >> Special thanks go to Howard and Ulrich Stärk. Howard gave me some
> > hints on
> > >> how to write a better book and wrote a foreword.
> > >> Ulrich was responsible for the technical review of the book and
> > helped me
> > >> to improve the quality.
> > >>
> > >> Enjoy
> > >>
> > >> --
> > >> Best regards,
> > >>
> > >> Igor Drobiazko
> > >>
> > >>
> > >
> > >
> > >
> > >
> >
> > --
> > ==
> > dott. Ivano Mario Luberti
> > Archimede Informatica societa' cooperativa a r. l.
> > Sede Operativa
> > Via Gereschi 36 - 56126- Pisa
> > tel.: +39-050- 580959
> > tel/fax: +39-050-9711344
> > web: www.archicoop.it
> > ==
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
>






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



Re: how can i construct external url with querystring???

2009-10-28 Thread Martin Strand

Maybe you want String.format instead?

String.format("http://somesite.com/ath/?param1=%s¶m2=%s";, param1, param2)

On Wed, 28 Oct 2009 11:11:37 +0100, sameerkhare  wrote:



That's right...
createPageRender() is to create internal link, Thats why i am not able to
create external link by this method.
Currently i am constructing the link with following approach. But i am not
sure, that is it good way to create an exteranl link./

public String getFwdLink(){
StringBuilder fwdLink= new StringBuilder();
fwdLink.append(messages.get("siteURL"));
fwdLink.append("?");
fwdLink.append(RET_URL);
fwdLink.append(messages.get("mysite"));
fwdLink.append("&");
fwdLink.append(AUTH_DPID);
fwdLink.append(messages.get("dsp_ID"));
fwdLink.append("&");
fwdLink.append(AUTH_ACTION);
fwdLink.append(messages.get("actionToken"));
return fwdLink.toString();
}



Please conferm that is above method to create exteranl link is good with
tapestry.

Sameer



DH-14 wrote:


But what you want is external link, createPageRender() is to create
internal link, you need provide your app internal page name.

DH
http://www.gaonline.com.cn

- Original Message -
From: "sameerkhare"
To: 
Sent: Wednesday, October 28, 2009 5:29 PM
Subject: Re: how can i construct external url with querystring???




Is it the good way to construct the url by this way. I think it is not.
I am trying to use Link tapestry class with createPageRender() method.
but
no luck..





DH-14 wrote:


I think there isn't any difference between Tapestry and other framewords
here. Or did I misunderstand?

You have defined the 'getFwdLink' in your java class, then just
construct
the url and assign this property in tml:

public String getFwdLink() {
return  String.format(http://www.mysite.com?userId=%s&pass=%s,
userId,
ab);  // you can use any way you like
 }

In tml,  ${fwdLink} login .

DH
http://www.gaonline.com.cn

- Original Message -
From: "sameerkhare"
To: 
Sent: Wednesday, October 28, 2009 2:08 PM
Subject: Re: how can i construct external url with querystring???




Then how can i construct the external URL with query string in
tapestry.

My Problem is that, I have a link on my tml page. and i need to
construct
URL with querystring and assign it to the link in tml page.

Please suggest me, that how can i implement it.

sameer



DH-14 wrote:


Don't understand your problem well.

Doesn't [ ${fwdLink} login ] fit your need?

DH
http://www.gaonline.com.cn

- Original Message -
From: "sameerkhare"
To: 
Sent: Wednesday, October 28, 2009 12:47 PM
Subject: how can i construct external url with querystring???




I want to construct a URL as below and forward to that external URL
through
tapestry 5.
My tml file contains link as below

${fwdLink} login

and correspoinding java file contains getter method for it.

public String getFwdLink() {
return fwdLink= "Http://www.mysite.com?userId=abc&pass=ab";
}

My problem is that how can i construct url with querystring???

Please let me know if any one has any idea on it.

Thanks
Sameer




--
View this message in context:
http://www.nabble.com/how-can-i-construct-external-url-with-querystringtp26089334p26091675.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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









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



Re: UTF-8 vs ISO-8859

2009-10-21 Thread Martin Strand

Also, JDK 6 added another load() method, so you can use properties.load(new 
InputStreamReader(in, utf8)) to load utf8 files.

On Wed, 21 Oct 2009 10:35:22 +0200, Ulrich Stärk  wrote:


A bit of explanation:

Normally, property files are expected to be ISO-8559-1 encoded [1]. When there 
are characters that
can't be represented using that character encoding, unicode escapes must be 
used. The native2ascii
tool can convert property files from UTF-8 to ISO-8859-1.
Tapestry does the same reencoding transparently, i.e. it treats all property 
files as UTF-8 encoded
and automaticalle converts them to ISO-8850-1 with unicode escapes.

Uli

[1] http://java.sun.com/javase/6/docs/api/java/util/Properties.html

Am 21.10.2009 10:02 schrieb Stephan Windmüller:

Gunnar Eketrapp wrote:


What is the recommended encoding for text files within a T5 project.


UTF-8


I just read  ...

Properties files are ISO-8859-1 by definition - see the docs for the
Properties 
class.


Where do you read that? This is from the tapestry home page:

"Tapestry uses the UTF-8 charset when reading the properties files in a
message catalog."

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


How do you folks do?


Using UTF-8 for the property files.


Note: The issues I have is that eclipse keeps insisting that my .properties
files are ISO-8859 and I have to manually switch encoding
for each new property file i create or copy. Besides that's everyting works
fine 


Same here. It is a bit annoying, but it works.

HTH
 Stephan


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



Re: UTF-8 vs ISO-8859

2009-10-21 Thread Martin Strand

ISO-8859 is only the default for java.util.Properties, not for Tapestry.
http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)

You can configure Eclipse to use UTF-8 for *.properties if you go to Preferences 
--> General --> Content Types
That way you don't have to change it for each file.

On Wed, 21 Oct 2009 09:56:15 +0200, Gunnar Eketrapp  
wrote:


Hi !

What is the recommended encoding for text files within a T5 project.

When I started the move to T5 i decided upon UTF-8 for all my text (*.java,
*.tml, *.properties, *.xml)  files but perhaps that was not too smart when
it comes to java property files.

I just read  ...

Properties files are ISO-8859-1 by definition - see the docs for the
Properties 
class.


How do you folks do?

Note: The issues I have is that eclipse keeps insisting that my .properties
files are ISO-8859 and I have to manually switch encoding
for each new property file i create or copy. Besides that's everyting works
fine 


Thanks in advance!
Gunnar Eketrapp


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



Re: tapestry 5.1.0.5 versus 5.0.14, ckeditor, javarebel

2009-10-18 Thread Martin Strand

On Sun, 18 Oct 2009 08:32:43 +0200, Argo Vilberg  wrote:


2009/10/18 Martin Strand 


Are you using renderSupport.addScript(...) in example #1?




In example #1 i use

@IncludeJavaScriptLibrary({"js/ckeditor/ckeditor.js","js/ckeditorconfig.js"})



What I meant was: how are you adding the height-setting script you posted?
Or is that the contents of ckeditorconfig.js?



yes it is contents of ckeditorconfi.js


But why then are you including that script in the html template if it's already 
in ckeditorconfig.js?


Your problem is probably what I mentioned in my first message:

5.0:



...




This works fine since the textarea exists when your ckeditorconfig.js script is 
run.


5.1:






...



In this case, your ckeditorconfig.js script is run before the textarea even 
exists. You should not run initialization scripts like that until the document 
has been fully loaded.




Here's a bad solution that could work:

window.onload = function () {
CKEDITOR.replace( 'editor1', {
skin: 'kama',
height: 250
});
};


Another bad solution would be to include  in the template right after your textarea.


The best solution is to get rid of ckeditorconfig.js and add your 
initialization script with renderSupport.addScript(...) instead.

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



Re: tapestry 5.1.0.5 versus 5.0.14, ckeditor, javarebel

2009-10-17 Thread Martin Strand

Are you using renderSupport.addScript(...) in example #1?



In example #1 i use
@IncludeJavaScriptLibrary({"js/ckeditor/ckeditor.js","js/ckeditorconfig.js"})


What I meant was: how are you adding the height-setting script you posted? Or 
is that the contents of ckeditorconfig.js?


CKEDITOR.replace( 'editor1',
{
skin: 'kama',
height: 250,
});


I don't see any "height: 400" in your 5.0 version so how did you set the height 
in that version?


On Sun, 18 Oct 2009 00:38:13 +0200, Argo Vilberg  wrote:


2009/10/17 Martin Strand 


Are you using renderSupport.addScript(...) in example #1?



In example #1 i use
@IncludeJavaScriptLibrary({"js/ckeditor/ckeditor.js","js/ckeditorconfig.js"})




I think 5.0 --> 5.1 changed where included  includes are placed.

5.0 placed them at the end of your <body> tag so referencing CKEDITOR in
the template (example #2) would not work since that script would be rendered
before including ckeditor.js.

5.1 places includes in <head> so both ways should work fine. What kind of
error do you see in Firebug? How does the html look?

</pre></blockquote><pre style="margin: 0em;">


</pre><blockquote style="border-left: #EE solid 0.2em; margin: 0em; padding-left: 0.85em"><pre style="margin: 0em;">

Both your examples also have a syntax error - there shouldn't be any comma
after "height: 250". Could that be the problem?
</pre></blockquote><pre style="margin: 0em;">

Plain html works with or without comma.



5.1.0.5 html -  javascript is directly writter after ckeditor textare in tml
file.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
<a  rel="nofollow" href="http://www.w3.org/TR/html4/strict.dtd"">http://www.w3.org/TR/html4/strict.dtd"</a>;><html xmlns="
<a  rel="nofollow" href="http://www.w3.org/1999/xhtml"">http://www.w3.org/1999/xhtml"</a>;><head><meta content="text/html; charset=utf-8"
http-equiv="Content-Type"></meta><style> .t-beaneditor-submit {margin-top:
5px;background-color: #efefef;border: 1px lightblue solid;}
.t-beaneditor-submit:hover
{background-color: lightgreen;color: white;border: 1px darkgreen solid;}
</style><title>Pealeht | Digileping</title><link type="text/css" rel="
stylesheet" 
href="/digileping/assets/tapestry/5.1.0.5/default.css<<a  rel="nofollow" href="https://localhost/digileping/assets/tapestry/5.1.0.5/default.css">https://localhost/digileping/assets/tapestry/5.1.0.5/default.css</a>>
"></link><link type="text/css" rel="stylesheet" href="
/digileping/assets/blackbird/5.1.0.5/blackbird.css<<a  rel="nofollow" href="https://localhost/digileping/assets/blackbird/5.1.0.5/blackbird.css">https://localhost/digileping/assets/blackbird/5.1.0.5/blackbird.css</a>>
"></link><link 
href="/digileping/assets/ctx/efd5bca695846f8e/css/main.css<<a  rel="nofollow" href="https://localhost/digileping/assets/ctx/efd5bca695846f8e/css/main.css">https://localhost/digileping/assets/ctx/efd5bca695846f8e/css/main.css</a>>"
media="screen, projection" rel="stylesheet"></link><!--[if IE 7]><link
href="/digileping/assets/ctx/efd5bca695846f8e/css/ie7.css" media="screen,
projection" rel="stylesheet"></link><![endif]--><!--[if lte IE 6]><link
href="/digileping/assets/ctx/efd5bca695846f8e/css/ie6.css" media="screen,
projection" rel="stylesheet"></link><![endif]--><meta content="Apache
Tapestry Framework (version 5.1.0.5)" name="generator"></meta><script src="
/digileping/assets/scriptaculous/5.1.0.5/prototype.js<<a  rel="nofollow" href="https://localhost/digileping/assets/scriptaculous/5.1.0.5/prototype.js">https://localhost/digileping/assets/scriptaculous/5.1.0.5/prototype.js</a>>"
type="text/javascript">https://localhost/digileping/assets/scriptaculous/5.1.0.5/scriptaculous.js</a>>"
type="text/javascript">https://localhost/digileping/assets/scriptaculous/5.1.0.5/effects.js</a>>"
type="text/javascript">https://localhost/digileping/assets/tapestry/5.1.0.5/tapestry.js</a>>"
type="text/javascript">https://localhost/digileping/assets/blackbird/5.1.0.5/blackbird.js</a>>"
type="text/javascript">https://localhost/digileping/assets/tapestry/5.1.0.5/tapestry-messages.js<

Re: tapestry 5.1.0.5 versus 5.0.14, ckeditor, javarebel

2009-10-17 Thread Martin Strand

Are you using renderSupport.addScript(...) in example #1?
I think 5.0 --> 5.1 changed where included  includes are placed.

5.0 placed them at the end of your  tag so referencing CKEDITOR in the 
template (example #2) would not work since that script would be rendered before 
including ckeditor.js.

5.1 places includes in  so both ways should work fine. What kind of error 
do you see in Firebug? How does the html look?

Both your examples also have a syntax error - there shouldn't be any comma after 
"height: 250". Could that be the problem?

On Sat, 17 Oct 2009 19:08:01 +0200, Argo Vilberg  wrote:

hi
In tapetsry 5.0.14 works this way to set editor height

1.
@IncludeJavaScriptLibrary({"js/ckeditor/ckeditor.js","js/ckeditorconfig.js"})

CKEDITOR.replace( 'editor1',
{
skin: 'kama',
height: 250,
});

2. and not work in tml file