Re: Accessing Spring context?

2010-11-12 Thread stephanos

Thanks for the response - but sorry for not being totally precise:
I need 'static' access - outside of any Tapestry component, just within the
same JVM.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Accessing-Spring-context-tp3261181p3262576.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



Accessing Spring context?

2010-11-11 Thread stephanos

When I use Tapestry with tapestry-spring the context is automatically created
in 'the background' at startup. But I need to access Spring's
AbstractApplicationContext - how would I do that?

Cheers :)
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Accessing-Spring-context-tp3261181p3261181.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



java.lang.NoSuchMethodError: java/security/PrivateKey

2010-11-09 Thread stephanos

Hi guys,

I have a Tapestry app that comunicates with Google via OAuth by using a
certificate. When I issue the call in the pages onActivate() I receive a
'java.lang.NoSuchMethodError: java/security/PrivateKey' error which is
strange because in unit testing it works fine.

Does anyone know how (if at all) this might be connected to Tapestry? I
couldn't find an explanation for this anywhere...

PS: using Win7 64-Bit, Tapestry 5.2.2, JDK 1.6_22 64 Bit, Tomcat 7.04, Scala
2.8.0

relevant part of the log:
13:19:57.991 [http-80-exec-3] ERROR org.apache.tapestry5.ioc.Registry -
com.example.shared.common.GDataAccess$.loadKey()Ljava/security/PrivateKey;
13:19:57.993 [http-80-exec-3] ERROR org.apache.tapestry5.ioc.Registry -
Operations trace:
13:19:57.994 [http-80-exec-3] ERROR org.apache.tapestry5.ioc.Registry - [ 1]
Triggering event 'activate' on signup/Config
13:19:58.011 [http-80-exec-3] ERROR o.a.t.s.T.RequestExceptionHandler -
Processing of request failed with uncaught exception:
com.example.shared.common.GDataAccess$.loadKey()Ljava/security/PrivateKey;
java.lang.NoSuchMethodError:
com.example.shared.common.GDataAccess$.loadKey()Ljava/security/PrivateKey;
at com.example.web.pages.signup.Config.doOAuthRequest(Config.scala:57)
~[Config.class:na]
at com.example.web.pages.signup.Config.onActivate(Config.scala:36)
~[Config.class:na]
at
com.example.web.pages.signup.Config$MethodAccess_onActivate_12c30c79673.invoke(Config$MethodAccess_onActivate_12c30c79673.java)
~[na:na]
at
org.apache.tapestry5.internal.transform.BaseEventHandlerMethodInvoker.invokeEventHandlerMethod(BaseEventHandlerMethodInvoker.java:52)
~[tapestry-core-5.2.2.jar:5.2.2]
at
org.apache.tapestry5.internal.transform.OnEventWorker$4.invokeEventHandlers(OnEventWorker.java:157)
~[tapestry-core-5.2.2.jar:5.2.2]
at
org.apache.tapestry5.internal.transform.OnEventWorker$4.advise(OnEventWorker.java:136)
~[tapestry-core-5.2.2.jar:5.2.2]
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/java-lang-NoSuchMethodError-java-security-PrivateKey-tp3256802p3256802.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: Problem with Scala's 'lazy val' in Pages

2010-11-03 Thread stephanos

Cool - thanks, will look into it :)
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-Scala-s-lazy-val-in-Pages-tp3248823p3249068.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: Problem with Scala's 'lazy val' in Pages

2010-11-03 Thread stephanos

I know what the message says :)
I'm merely pointing out that there might be a problem for some users - I
meanwhile re-wrote the 'lazy val'-thing.
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-Scala-s-lazy-val-in-Pages-tp3248823p3249059.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



Problem with Scala's 'lazy val' in Pages

2010-11-03 Thread stephanos

Something I just noticed: I have a class 'BasePage' which every page inherits
from, this base class has a Scala 'lazy val' field (private) - yet this
error is issues (seems 
http://scala-programming-language.1934581.n4.nabble.com/Why-is-bitmap-0-public-td2255232.html
Scala creates a public field  for it).

Stacktrace:
Caused by: java.lang.RuntimeException: Class
com.lumberjack.web.pages.base.BasePage contains field(s) (bitmap$0) that are
not private. You should change these fields to private, and add accessor
methods if needed.  
at
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadFields(InternalClassTransformationImpl.java:940)
~[tapestry-core-5.2.2.jar:5.2.2]
at
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadMembers(InternalClassTransformationImpl.java:886)
~[tapestry-core-5.2.2.jar:5.2.2]
at
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.(InternalClassTransformationImpl.java:805)
~[tapestry-core-5.2.2.jar:5.2.2]
at
org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:186)
~[tapestry-core-5.2.2.jar:5.2.2]

Dunno if/how you want to handle this. Just wanted to bring it up :)

Cheers
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-Scala-s-lazy-val-in-Pages-tp3248823p3248823.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: No 404 error is raised

2010-10-16 Thread stephanos

> I think the best approach is to leverage the ignored paths mechanism. 
> That is early in the response processing pipeline, and will have a 
> good chance to ignore what should be ignored. 

Can somebody please explain how I can work around this for the novice here?
:)

Help very appreciated!
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/No-404-error-is-raised-tp3212773p3214941.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: Fetch Prototype library via Google DNS?

2010-10-15 Thread stephanos

> Why do you want this? 

Well the 
http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
advantages  obviously are reduced traffic+CPU for the server, decreased
latency, increased parallelism and better caching. How big an advantage it
really is probably depends on how sophisticated Tapestry's bundling is.

At first I wanted to do it quickly because it seemed to be a quick win - but
the more I struggled with Tapestry to do this, the more it was about just
getting it to do it :)

There was a 
http://tapestry.1045711.n5.nabble.com/Tapestry-Central-Tapestry-5-1-and-IE-8-Customizing-Tapestry-td2436846.html#a2436848
thread  about this topic almost a year ago - with no real solution. The last
entry only says 'U could create a new "URIAssetFactory" to obtain assets
from a 
external resource' - but I wouldn't even know where to start. I assumed this
might interest other people too, hence the post here :)


> You can configure the Tapestry Scriptaculous Path to get prototype library
> in google. 

Isn't that an oxymoron? Setting the 'tapestry.scriptaculous' to fetch
prototype - or am I not seeing something? :)

I already had a look at the 'tapestry.scriptaculous' and
'tapestry.scriptaculous.path' configuration variable and it seems it only
works for resources out of a JAR - when I played with it somewhere in the
stacktrace it said LocalAsset or something similar...
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213334.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: No 404 error is raised

2010-10-15 Thread stephanos

> As the JIRA ticket says, this is expected behavior. In your case, /blabla  
> is considered a request to / (Index) with one activation context parameter  
> 'blabla' as there's no page named 'blabla'.

I was just wondering why the ticket is still 'Open' and has a patch that
apparently was never actually used...

> Hmm... that's true, the Start page is "broken" as well in 5.2 - you 
> can't get it to return 404s anymore using Start page the same way as 
> in 5.1.

So the solution should be renaming it 'Start.tml' (could be documented
somewhere *g*)? I used 5.2 straight away without 5.1 because I needed the
Spring 3 support. Could you open a JIRA issue then? - it might be better if
an experienced tapestry user opens it :)

Cheers!
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/No-404-error-is-raised-tp3212773p3213305.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



No 404 error is raised

2010-10-14 Thread stephanos

Hi guys,

I'm making my first steps with Tapestry 5.2 and find one thing very
peculiar: All requests seem to go to the Index page (Index.tml in 'root') by
default - even if the path does not exist! Example with page Index.tml and
Login.tml:
   
   / -> Index
   /blabla -> Index
   /login -> Login
   /login2 -> Index

I have the right settings in the web.xml as far as I know
(ERROR + 404). I also
already tried naming it 'Start' - same effect.

I only found this  https://issues.apache.org/jira/browse/TAP5-879 1 year old
JIRA  issue but I don't know what to do with it.

What's wrong?

Cheers,
Stephan
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/No-404-error-is-raised-tp3212773p3212773.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



Fetch Prototype library via Google DNS?

2010-10-14 Thread stephanos

How can I configure Tapestry to fetch the Javascript Prototype library from
the  http://code.google.com/apis/libraries/devguide.html#prototype Google
DNS server ? 

Cheers! 
Stephan
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3212754.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



Declaring transient properties in page class

2006-11-14 Thread Stephanos Piperoglou
Noob question:

I've been going over the documentation and trying things out and so far it 
seems that I have to declare abstract getters and setters in my page class 
for every transient page property, including the placeholders and index 
holders for loops, so for instance when I do

...

I need get/setItem and get/setIndex in my class. Being a recent convert 
from Struts where you can define page beans via JSP tags and considering 
most of the time I only need to access these properties from within the 
page itself for the purposes of iteration, I find this rather wasteful. 
Not to mention the fact that larger pages with a lot of @For loops tend to 
accumulate a lot of clutter. Is there no way around this?

---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

Re: Using java 1.5 enums as property selection models

2006-10-31 Thread Stephanos Piperoglou
"Martin Strand" <[EMAIL PROTECTED]> wrote on 30/10/2006 17:33:32:

> On Mon, 30 Oct 2006 18:24:27 +0100, Stephanos Piperoglou  [EMAIL PROTECTED]> wrote:
> 
> > I was kind of expecting to be able to use a generic type (T
> > above) as an instance of java.lang.Class. Unsurprisingly, I can't.
> > Surprisingly, I can't find a way to work around it!
> 
> Afaik, the type info isn't available at runtime for generic classes 
> so it can't be done.

You're absolutely right; I was forgetting that generics in 1.5 are nothing 
but glorified syntactic sugar; the compiler does the type checking and 
then throws it all away. You need the class in the constructor for runtime 
availability.

On the other hand, I'm still miffed that I have to use 
java.lang.Class.getEnumConstants() (which I had to dig through the API to 
find, and seems a bit inelegant even though the generic definition for the 
class guarantees type safety) when all the tutorials mention the 
.values() static method, which is defined for every subtype of 
java.lang.Enum but not Enum itself! Of course it's because you can't have 
abstract static methods in Java anyway... it just looks a bit ugly

Still, why am I complaining? It's a hell of a lot better than public 
static final int CITY_NYC = 1... :)

Thanks for the timely response to the initial query and humoring my aside 
guys!

---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

Re: Using java 1.5 enums as property selection models

2006-10-30 Thread Stephanos Piperoglou
andyhot <[EMAIL PROTECTED]> wrote on 30/10/2006 16:30:08:

> However, Daniel has recently added this in the BeanForm.sourceforge.net
> project.
> See
> http://beanform.sourceforge.net/beanform-
> core/xref/net/sf/beanform/util/EnumPropertySelectionModel.html
> 
> or get the beanform jar and add it in your classpath

Efxaristo :)

Interestingly I had arrived at almost the exact same code by the time you 
answered. This is the first time I've really used Java 1.5 in a production 
environment and I was still struggling to find a way to shorten:

public class EnumPropertySelectionModel> implements 
IPropertySelectionModel {
public EnumPropertySelectionModel(Class type, boolean 
includeEmptyOption, Messages messages)

... so that the constructor doesn't need the class passed explicitly. 
Surely the wonders of generics should allow such repetition to be made 
redundant? I was kind of expecting to be able to use a generic type (T 
above) as an instance of java.lang.Class. Unsurprisingly, I can't. 
Surprisingly, I can't find a way to work around it! I just spent half a 
day worrying about this inelegant solution so seeing that somebody else 
seems to have used it did a lot to help me move on to actually writing 
some code... but anybody have any ideas?

Maybe this is a bit off-topic, so please tell me to fly off to 
comp.lang.java if you must :)

---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.

Using java 1.5 enums as property selection models

2006-10-30 Thread Stephanos Piperoglou
Apparently there was an EnumPropertySelectionModel in Tapestry 3 that was 
dropped in version 4 due to namespace conflicts. Is there any contributed 
or official replacement or should I just roll my own (and possibly submit 
it)? To clarify, I need an implementation of IPropertySelectionModel that 
uses a Java 1.5 enum as a data source and a resource bundle for string 
labels.

---

This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.