Re: How to get HttpServletResponse Object in Tapestry.

2008-01-08 Thread buckofive

I belive this is covered here:

http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest

and then take a look at api docs:

http://tapestry.apache.org/tapestry5/tapestry-core/apidocs/org/apache/tapestry/services/RequestGlobals.html

cheers,
B



swapnilpatil wrote:
> 
> How to get HttpServletResponse Object in Tapestry?
> 
> Can anyone show me the actual code which is creating an
> HttpServletResponse & HttpServletRequest Objects in Tapestry.
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-HttpServletResponse-Object-in-Tapestry.-tp14705483p14706094.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread buckofive

Hi all,
Thank you for the responses.

I'm a little better but still not there.  As you can see my log starts off
good but once tapestry is initialized there are no more logs generated from
hibernate or spring.   At the very end you can see where my DAO
(SubjectDAO.java) fetches some records from the db, and then only logs from
my DAO are generated.  Any ideas?

Here is my start up log:

launching Jetty webapp: /jpa on address: 0.0.0.0:8080 using dir:
[S:\Java\workspaces_eclipse6\companies\jpa-test\src\main\webapp] 
22:15:32.312 INFO   [main] org.mortbay.log.LogImpl.add(LogImpl.java:109)
>16> added [EMAIL PROTECTED]
22:15:32.265 INFO   [main] org.mortbay.log.LogImpl.reset(LogImpl.java:228)
>11> reset
22:15:32.312 INFO   [main] org.mortbay.log.LogImpl.add(LogImpl.java:109)
>11> added [EMAIL PROTECTED]
22:15:32.968 INFO   [main]
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:178)
>09> Root WebApplicationContext: initialization started
22:15:33.046 INFO   [main]
org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:378)
>12> Refreshing
[EMAIL PROTECTED]:
display name [Root WebApplicationContext]; startup date [Tue Jan 08 22:15:33
PST 2008]; root of context hierarchy
22:15:33.234 INFO   [main]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
>19> Loading XML bean definitions from class path resource
[applicationContext.xml]
22:15:34.109 INFO   [main]
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:393)
>12> Bean factory for application context
[EMAIL PROTECTED]:
[EMAIL PROTECTED]
22:15:34.359 INFO   [main]
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker.postProcessAfterInitialization(AbstractApplicationContext.java:1006)
>21> Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not
eligible for getting processed by all BeanPostProcessors (for example: not
eligible for auto-proxying)
22:15:34.390 INFO   [main]
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:276)
>12> Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans
[entityManagerFactory,transactionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,SubjectDAO,StudentDAO];
root of factory hierarchy
22:15:34.437 INFO   [main]
org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:76)
>21> Building JPA EntityManagerFactory for persistence unit 'jpaTestPU'
22:15:34.562 INFO   [main]
org.hibernate.cfg.annotations.Version.(Version.java:15) >26>
Hibernate Annotations 3.3.0.GA
22:15:34.625 INFO   [main]
org.hibernate.cfg.Environment.(Environment.java:514) >30> Hibernate
3.2.5
22:15:34.656 INFO   [main]
org.hibernate.cfg.Environment.(Environment.java:547) >30>
hibernate.properties not found
22:15:34.656 INFO   [main]
org.hibernate.cfg.Environment.buildBytecodeProvider(Environment.java:681)
>31> Bytecode provider name : cglib
22:15:34.671 INFO   [main]
org.hibernate.cfg.Environment.(Environment.java:598) >30> using JDK
1.4 java.sql.Timestamp handling
22:15:34.906 INFO   [main]
org.hibernate.ejb.Version.(Version.java:15) >25> Hibernate
EntityManager 3.3.1.GA
22:15:35.515 INFO   [main]
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:398) >32>
Binding entity from annotated class: com.jpa.db.Subject
22:15:35.656 INFO   [main]
org.hibernate.cfg.annotations.EntityBinder.bindTable(EntityBinder.java:420)
>33> Bind entity com.jpa.db.Subject on table subject
22:15:35.937 INFO   [main]
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:398) >32>
Binding entity from annotated class: com.jpa.db.Student
22:15:35.937 INFO   [main]
org.hibernate.cfg.annotations.EntityBinder.bindTable(EntityBinder.java:420)
>33> Bind entity com.jpa.db.Student on table student
22:15:36.203 INFO   [main]
org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:627)
>35> Mapping collection: com.jpa.db.Subject.students -> student
22:15:36.234 INFO   [main]
org.hibernate.validator.Version.(Version.java:17) >36> Hibernate
Validator 3.0.0.GA
22:15:36.406 INFO   [main]
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:41)
>31> Using Hibernate built-in connection pool (not for production use!)
22:15:36.406 INFO   [main]
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:42)
>31> Hibernate connection pool size: 20
22:15:36.406 INFO   [main]
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:45)
>31> autocommit mode: true
22:15:36.421 INFO   [main]
org.

How to get the ID of the Contrib Table in the Java Code?(Pls its Urgent).

2008-01-08 Thread swapnilpatil

I have one Tapestry Page which contains one Tapestry's Contrib Table(Data is
generating dynamically in the table from DB). Now i want to get the ID of
the table in the java code. I have referred the HTML Code(View --> Source of
my IE Browser) here i am getting the id as "TableElement ". So my question
is "Is there any way to get the ID of the Contrib Table in the Java Code?".

Pls Help me its very very urgent
-- 
View this message in context: 
http://www.nabble.com/How-to-get-the-ID-of-the-Contrib-Table-in-the-Java-Code-%28Pls-its-Urgent%29.-tp14705741p14705741.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


How to get HttpServletResponse Object in Tapestry.

2008-01-08 Thread swapnilpatil

How to get HttpServletResponse Object in Tapestry?

Can anyone show me the actual code which is creating an HttpServletResponse
& HttpServletRequest Objects in Tapestry.
-- 
View this message in context: 
http://www.nabble.com/How-to-get-HttpServletResponse-Object-in-Tapestry.-tp14705483p14705483.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: beaneditform component error message

2008-01-08 Thread Howard Lewis Ship
@Component defines a component, it does not inject an existing
component.  You've ended up with two BeanEditForm components, one
named "beaneditform" (from the Java code) and one anonymous (from the
template).  Change the  to, say  ... or (better, for your example),
remove the beaneditform variable.

On Jan 8, 2008 2:38 PM, Franz Amador <[EMAIL PROTECTED]> wrote:
> I'm getting this error in the console:
>
> [ERROR] FormPage Embedded component(s) beaneditform are defined within 
> component class com.[...].pages.FormPage, but are not present in the 
> component template.
>
> when I have this template:
>
>
>   
> Form
>   
>   
> Form
> 
>   
> 
>
> and this page class:
>
> public class FormPage {
> @Persist
> private Bean bean;
> @Component
> private BeanEditForm beaneditform;
>
> which I presume is coming from the @Component.  The question is: why can't it 
> find the beaneditform component?  It sure looks like it's there to me.  Does 
> it have some other name?
>
> thanks,
> Franz
>
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: T5: multiple beaneditors inside a beaneditform

2008-01-08 Thread Howard Lewis Ship
Absolutely, you want to use two BeanEditor components inside your own
Form.  Don't forget an Errors component and a Submit.




On Jan 8, 2008 3:39 PM, mammal <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> what is the best practice for doing the following registration form...
>
> let's assume we have a domain object User which contains several properties
> and an Address object (which also contains several properties). I want to
> create a registration form for such an object. So I create a page
> RegisterUser that contains the User object
> and beaneditform for the object.
>
> The Address bean is not included in the model though. I can try to insert
> beaneditor for user.address manually into the template, but it's not
> apparent how (except for appending it to some existing property editor using
>  which causes problems with markup)
>
> Another question is if I can insert an extra field like password2 (Retype
> password) which I don't want to keep in User object.
>
> Also it would be nice if we can insert extra markup between property editors
> at defined places.
>
> Maybe the best solution is not to use  but just plain
>  containing several s?
> --
> View this message in context: 
> http://www.nabble.com/T5%3A-multiple-beaneditors-inside-a-beaneditform-tp14701908p14701908.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: T5: Editing a list of values

2008-01-08 Thread yuan gogo
Your example solved my problem also, thank you :-)

2008/1/9, Shing Hing Man <[EMAIL PROTECTED]>:
>
> I have a micky mouse example that does something
> similar. The live example and source code is at
>
>
> http://lombok.demon.co.uk/tapestry5Demo/test/sum
>
> Shing
>
>
> --- Kevin Menard <[EMAIL PROTECTED]> wrote:
>
> > You could keep track of an index variable and use
> > that to index a List in
> > your page class.  Something like the following:
> >
> > public String getValue()
> > {
> > return values.get(index);
> > }
> >
> > public void setValue(final String value)
> > {
> > values.set(index, value);
> > }
> >
> > Then the trick is updating the index value, but that
> > may be simpler for you.
> > I've used that trick to avoid serializing Cayenne
> > objects in a Loop.  Of
> > course, in that case, the semantics of the index
> > value are very well-defined
> > so YMMV.
> >
> > --
> > Kevin
> >
> >
> > On 1/8/08 1:50 PM, in article
> > [EMAIL PROTECTED], "Hugo Palma"
> > <[EMAIL PROTECTED]> wrote:
> >
> > > My use case is this,
> > >
> > > i would like to let the user to enter an undefined
> > number of values. I
> > > have the UI implemented with a loop component
> > getting the number of
> > > cycles from a page property and in each cycle it
> > places a new textfield
> > > component.
> > >
> > > The problem is, what property do i put in each of
> > the textfield value
> > > paramters ? I'm holding the values in a List
> > property in my page.
> > > I can't do  > value="myList.0"/>.
> > >
> > > Any ideas ?
> > > I'm thinking that i may be complicating something
> > that probably is much
> > > simpler.
> > >
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
> Home page : http://www.lombok.demon.co.uk/
>
>
>
>   ___
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: T5: Multiple clicks causing NPE

2008-01-08 Thread Howard Lewis Ship
I'll have to look into whether there is a workaround for that
ThreadLocal bug, and figure out a way to test this.

On Jan 8, 2008 2:08 PM, jason lea <[EMAIL PROTECTED]> wrote:
> Hi,
>
> We get this error quite often with Java 1.5, we asked about it in the
> mailing list back in August.  We found the error doesn't occur in Java 1.6.
> We usually see a stack trace with a NPE when doing getSession() or
> getCookies().
>
> Here is what I wrote last time:
>
> We are getting an intermittent NullPointerException in Tapestry 5.0.5.  We
> are running on Java 1.5.
> It seems that the RequestGlobals has a null Request when the call to
> getCookies is made (or that RequestGlobals is null).  We cannot get the
> error to occur every time so testing is tricky, sometimes it occurs on the
> first request after the webapp starts with subsequent requests good for a
> few minutes before it occurs again.  Other times it starts fine and pressing
> F5 100 times might make it occur.
>
> Our thought at the moment is that a ThreadLocal bug (
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6550283 ) might be
> causing the RequestGlobals to initially be correctly initialised and stored
> in ThreadLocal but later on with more items being added this bug means
> further down the track, a new RequestGlobals is added with null values.
>
>
>
> --
> Jason Lea
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



Re: [Announcement] t5components - now mavenized

2008-01-08 Thread Christian Edward Gruber

Hey.  Do you need help getting it into the repo1 main repository?

christian

On 8-Jan-08, at 19:06 , Sven Homburg wrote:



Hi there,

the t5components library is now mavenized
and implements two more components.

project page with demo  http://213.160.23.119:8080/t5components/  
click here


-
---
best regards
Sven
--
View this message in context: 
http://www.nabble.com/-Announcement--t5components---now-mavenized-tp14702271p14702271.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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




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



[Announcement] t5components - now mavenized

2008-01-08 Thread Sven Homburg

Hi there,

the t5components library is now mavenized 
and implements two more components.

project page with demo  http://213.160.23.119:8080/t5components/ click here 

-
---
best regards
Sven
-- 
View this message in context: 
http://www.nabble.com/-Announcement--t5components---now-mavenized-tp14702271p14702271.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Acegi table name too long for Oracle 9i

2008-01-08 Thread Franz Amador
Actually, it's not my table.  I presume it's being defined by tapestry5-acegi, 
which is why I posted it here.

- Original Message 
From: Daniel Jue <[EMAIL PROTECTED]>
To: Tapestry users 
Sent: Tuesday, January 8, 2008 3:03:11 PM
Subject: Re: T5: Acegi table name too long for Oracle 9i


This seems more like Hibernate's problem.  I'm not defending 9i's
failboating in
character limits. (What is this, 1994?)
I haven't played with this module, but perhaps you can specify the
name of the table in an annotation (if you are using Hibernate
Annotations) or in an XML file?  Just specify a shorter name instead
of the auto-created name.  Expect this to happen with field names too,
so you may need to override field names using whatever hibernate
mapping method you are using.

On Jan 8, 2008 5:23 PM, Franz Amador <[EMAIL PROTECTED]> wrote:
> I'm using the tapestry5-acegi module (v 1.0.2, Tapestry v 5.0.7), and
 I get an error when Hibernate tries to create tables in Oracle 9i:
>
> 14:09:42.234 ERROR! [main]
 org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155) >55> 
Unsuccessful: create table
 UserDetailsBean_GrantedAuthorityBean (UserDetailsBean_id number(19,0) not null,
 grantedAuthorities_id number(19,0) not null, unique
 (grantedAuthorities_id))
> 14:09:42.234 ERROR! [main]
 org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156) >55> 
ORA-00972: identifier is too long
>
> Am I out of luck?  Surely people have run Acegi on Oracle 9i before,
 so I presume this error relates to tapestry5-acegi, not Acegi in
 general.
>
>
>

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






T5: multiple beaneditors inside a beaneditform

2008-01-08 Thread mammal

Hi,

what is the best practice for doing the following registration form...

let's assume we have a domain object User which contains several properties
and an Address object (which also contains several properties). I want to
create a registration form for such an object. So I create a page
RegisterUser that contains the User object 
and beaneditform for the object. 

The Address bean is not included in the model though. I can try to insert
beaneditor for user.address manually into the template, but it's not
apparent how (except for appending it to some existing property editor using
 which causes problems with markup)

Another question is if I can insert an extra field like password2 (Retype
password) which I don't want to keep in User object.

Also it would be nice if we can insert extra markup between property editors
at defined places.

Maybe the best solution is not to use  but just plain
 containing several s?
-- 
View this message in context: 
http://www.nabble.com/T5%3A-multiple-beaneditors-inside-a-beaneditform-tp14701908p14701908.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: Delegating or Redirecting from PageA to PageB in Tapestry 4.1.3 throws Exception

2008-01-08 Thread Senthil Sadasivam
Thanks Andreou,

If I cannot use finishLoad can you please tell me which method should I
override to modify my values.

Senthil

On Jan 8, 2008 3:48 PM, Andreas Andreou <[EMAIL PROTECTED]> wrote:

> finishLoad is not suitable for what you're doing
>
> Also, do cycle.activate(page) if you want the values you've set for
> the new page to be used - PageRedirectException will just forward
> without them
>
> On Jan 8, 2008 9:39 PM, senthil-sadasivam <[EMAIL PROTECTED]>
> wrote:
> >
> > Hi,
> >
> > I need to reset certaing elements in a page while navigating in to it
> > from another page.
> >
> > But doing so I am getting a EmptyStackException. Can someone help me
> > with this.
> >
> > Looks like its trying to remove PageA from memory and failed to find it
> > in the stack.
> >
> > Following is the code script inside PageA from where I am calling PageB.
> >
> >   @Override
> >   public void finishLoad(IRequestCycle pCycle, IPageLoader pLoader,
> > IComponentSpecification pSpecification)
> >   {
> > PageB page = (PageB)pCycle.getPage("pageB");
> > page.setClaim(null);
> > page.setInitialized(false);
> > throw new PageRedirectException(page);
> >   }
> >
> > and the stack trace shows
> >
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.page.PageLoader] Establishing inherited bindings
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.page.PageLoader] Loaded page $PageB_68  3c1[pageB] with
> 145
> > components (maximum depth 5)
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.PageClientPropertyPersistenceStrategy] Constructing
> > core service implementation for service
> > tapestry.persist.PageClientPropertyPersistenceStrategy
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
> > request to  > tapestry.globals.WebRequest(org.apache.tapestry.web.WebRequest)>
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
> > scope to  > tapestry.persist.PageClientPropertyPersistenceScope(org.apache.tapestry.
> > record.ClientPropertyPersistenceScope)>
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
> > encoder to  > tapestry.persist.PersistentPropertyDataEncoder(org.apache.tapestry.recor
> > d.PersistentPropertyDataEncoder)>
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.AppClientPropertyPersistenceStrategy] Constructing
> > core service implementation for service
> > tapestry.persist.AppClientPropertyPersistenceStrategy
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
> > request to  > tapestry.globals.WebRequest(org.apache.tapestry.web.WebRequest)>
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
> > scope to  > tapestry.persist.AppClientPropertyPersistenceScope(org.apache.tapestry.r
> > ecord.ClientPropertyPersistenceScope)>
> > 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> > [tapestry.persist.AppClientPropertyPersistenceStrategy] Autowired
> > service property encoder to  > tapestry.persist.PersistentPropertyDataEncoder(org.apache.tapestry.recor
> > d.PersistentPropertyDataEncoder)>
> > 2008-01-03 16:47:33,887 DEBUG (http-0.0.0.0-8080-5)
> > [org.apache.tapestry.engine.AbstractEngine] Uncaught exception
> > java.util.EmptyStackException
> >  at java.util.Stack.peek(Stack.java:79)
> >  at java.util.Stack.pop(Stack.java:61)
> >  at
> > org.apache.tapestry.pageload.PageLoader.endConstructComponent(PageLoader
> > .java:469)
> >  at
> > org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.ja
> > va:424)
> >  at
> > org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639)
> >  at $IPageLoader_1174202977e.loadPage($IPageLoader_1174202977e.java)
> >  at $IPageLoader_1174202977f.loadPage($IPageLoader_1174202977f.java)
> >  at
> > org.apache.tapestry.pageload.PageSource.makeObject(PageSource.java:153)
> >  at
> > org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic
> > KeyedObjectPool.java:797)
> >  at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:177)
> >  at $IPageSource_117420296de.getPage($IPageSource_117420296de.java)
> >  at
> > org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:239)
> >  at
> > org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:226)
> >  at
> > org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:559)
> >  at org.apache.tapestry.engine.PageService.service(PageService.java:66)
> >  at
> > $IEngineService_11742029767.service($IEngineService_11742029767.java)
> >  at
> > org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(Engine
> > ServiceOuterProxy.java:72)
> >  at
> > 

Re: T5: Acegi table name too long for Oracle 9i

2008-01-08 Thread Daniel Jue
This seems more like Hibernate's problem.  I'm not defending 9i's
failboating in
character limits. (What is this, 1994?)
I haven't played with this module, but perhaps you can specify the
name of the table in an annotation (if you are using Hibernate
Annotations) or in an XML file?  Just specify a shorter name instead
of the auto-created name.  Expect this to happen with field names too,
so you may need to override field names using whatever hibernate
mapping method you are using.

On Jan 8, 2008 5:23 PM, Franz Amador <[EMAIL PROTECTED]> wrote:
> I'm using the tapestry5-acegi module (v 1.0.2, Tapestry v 5.0.7), and I get 
> an error when Hibernate tries to create tables in Oracle 9i:
>
> 14:09:42.234 ERROR! [main] 
> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155) >55> 
> Unsuccessful: create table UserDetailsBean_GrantedAuthorityBean 
> (UserDetailsBean_id number(19,0) not null, grantedAuthorities_id number(19,0) 
> not null, unique (grantedAuthorities_id))
> 14:09:42.234 ERROR! [main] 
> org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156) >55> 
> ORA-00972: identifier is too long
>
> Am I out of luck?  Surely people have run Acegi on Oracle 9i before, so I 
> presume this error relates to tapestry5-acegi, not Acegi in general.
>
>
>

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



Re: Delegating or Redirecting from PageA to PageB in Tapestry 4.1.3 throws Exception

2008-01-08 Thread Andreas Andreou
finishLoad is not suitable for what you're doing

Also, do cycle.activate(page) if you want the values you've set for
the new page to be used - PageRedirectException will just forward
without them

On Jan 8, 2008 9:39 PM, senthil-sadasivam <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I need to reset certaing elements in a page while navigating in to it
> from another page.
>
> But doing so I am getting a EmptyStackException. Can someone help me
> with this.
>
> Looks like its trying to remove PageA from memory and failed to find it
> in the stack.
>
> Following is the code script inside PageA from where I am calling PageB.
>
>   @Override
>   public void finishLoad(IRequestCycle pCycle, IPageLoader pLoader,
> IComponentSpecification pSpecification)
>   {
> PageB page = (PageB)pCycle.getPage("pageB");
> page.setClaim(null);
> page.setInitialized(false);
> throw new PageRedirectException(page);
>   }
>
> and the stack trace shows
>
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.page.PageLoader] Establishing inherited bindings
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.page.PageLoader] Loaded page $PageB_68  3c1[pageB] with 145
> components (maximum depth 5)
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.PageClientPropertyPersistenceStrategy] Constructing
> core service implementation for service
> tapestry.persist.PageClientPropertyPersistenceStrategy
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
> request to  tapestry.globals.WebRequest(org.apache.tapestry.web.WebRequest)>
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
> scope to  tapestry.persist.PageClientPropertyPersistenceScope(org.apache.tapestry.
> record.ClientPropertyPersistenceScope)>
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
> encoder to  tapestry.persist.PersistentPropertyDataEncoder(org.apache.tapestry.recor
> d.PersistentPropertyDataEncoder)>
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.AppClientPropertyPersistenceStrategy] Constructing
> core service implementation for service
> tapestry.persist.AppClientPropertyPersistenceStrategy
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
> request to  tapestry.globals.WebRequest(org.apache.tapestry.web.WebRequest)>
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
> scope to  tapestry.persist.AppClientPropertyPersistenceScope(org.apache.tapestry.r
> ecord.ClientPropertyPersistenceScope)>
> 2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
> [tapestry.persist.AppClientPropertyPersistenceStrategy] Autowired
> service property encoder to  tapestry.persist.PersistentPropertyDataEncoder(org.apache.tapestry.recor
> d.PersistentPropertyDataEncoder)>
> 2008-01-03 16:47:33,887 DEBUG (http-0.0.0.0-8080-5)
> [org.apache.tapestry.engine.AbstractEngine] Uncaught exception
> java.util.EmptyStackException
>  at java.util.Stack.peek(Stack.java:79)
>  at java.util.Stack.pop(Stack.java:61)
>  at
> org.apache.tapestry.pageload.PageLoader.endConstructComponent(PageLoader
> .java:469)
>  at
> org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.ja
> va:424)
>  at
> org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639)
>  at $IPageLoader_1174202977e.loadPage($IPageLoader_1174202977e.java)
>  at $IPageLoader_1174202977f.loadPage($IPageLoader_1174202977f.java)
>  at
> org.apache.tapestry.pageload.PageSource.makeObject(PageSource.java:153)
>  at
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic
> KeyedObjectPool.java:797)
>  at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:177)
>  at $IPageSource_117420296de.getPage($IPageSource_117420296de.java)
>  at
> org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:239)
>  at
> org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:226)
>  at
> org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:559)
>  at org.apache.tapestry.engine.PageService.service(PageService.java:66)
>  at
> $IEngineService_11742029767.service($IEngineService_11742029767.java)
>  at
> org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(Engine
> ServiceOuterProxy.java:72)
>  at
> org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:24
> 1)
>  at
> org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeE
> ngineTerminator.java:54)
>  at
> $WebRequestServicer_11742029744.service($WebRequestServicer_11742029744.
> java)
>  at
> org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCa
> chingFilter.java:54)
>  at
> $WebRequestServicerFilter_117420

T5: beaneditform component error message

2008-01-08 Thread Franz Amador
I'm getting this error in the console:

[ERROR] FormPage Embedded component(s) beaneditform are defined within 
component class com.[...].pages.FormPage, but are not present in the component 
template.

when I have this template:


  
Form
  
  
Form

  


and this page class:

public class FormPage {
@Persist
private Bean bean;
@Component
private BeanEditForm beaneditform;

which I presume is coming from the @Component.  The question is: why can't it 
find the beaneditform component?  It sure looks like it's there to me.  Does it 
have some other name?

thanks,
Franz




T5: Acegi table name too long for Oracle 9i

2008-01-08 Thread Franz Amador
I'm using the tapestry5-acegi module (v 1.0.2, Tapestry v 5.0.7), and I get an 
error when Hibernate tries to create tables in Oracle 9i:

14:09:42.234 ERROR! [main] 
org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:155) >55> 
Unsuccessful: create table UserDetailsBean_GrantedAuthorityBean 
(UserDetailsBean_id number(19,0) not null, grantedAuthorities_id number(19,0) 
not null, unique (grantedAuthorities_id))
14:09:42.234 ERROR! [main] 
org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:156) >55> 
ORA-00972: identifier is too long

Am I out of luck?  Surely people have run Acegi on Oracle 9i before, so I 
presume this error relates to tapestry5-acegi, not Acegi in general.




Re: T5 : declaration of pages and components packages from a library

2008-01-08 Thread Daniel Jue
I have a few components and pages that I extend, and I put them in a
directory called "base", at the same level as the pages and components
packages.

For instance I have an AbstractReportPage that references Tapestry
ASOs, Injects things and Persists things.  Then I have a few report
page classes that implement different flavors of very similar things.

It could be done differently for sure--This is just one way that works for me.

I also use the base directory for concrete Tapestry related classes
that don't belong in pages, components, services or mixins.  One
example is a class than has the injected paths to all my css files and
some images that are used across several border classes.
Then I can do

public class Border extends AssetContainer{
}



On Jan 8, 2008 5:03 PM, Shing Hing Man <[EMAIL PROTECTED]> wrote:
> Have you tried the following ?
>
> Suppose org.man.tapestry5.components will hold the new
> components.
>
> 1) add the following to AppModule
>
>
> public static void
> contributeComponentClassResolver(Configuration
> configuration)
> {
> // Creates a virtual root pacakge for
> pages,components.
> configuration.add(new LibraryMapping("man",
> "org.man.tapestry5"));
> }
>
> 2) Suppose in  org.man.tapestry5.components, we have
> component PageLinkPopup.java.
>
> Usage :
>
> windowName="literal:my windown" features="literal:
> 'resizable,scrollbars,top=100,left=200,height=300,width=500'"
> >Home
>
> or
>
>
> windowName="literal:sum" features="literal:
> 'resizable,scrollbars,top=100,left=200,height=300,width=500'"
> >Sum
>
> Shing
>
>
>
> --- Steph <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >
> > I need to import in my tap5 project a library which
> > includes tap5 pages
> > and components.
> > But when i try to extend a page from the library in
> > my project, i get
> > the following exception :
> >
> > java.lang.RuntimeException: Base class
> > com.mylibrary.pages.FramePage
> > (super class of com.myproject.pages.Start) is not in
> > a controlled
> > package and is therefore not valid. You should try
> > moving the class to
> > package com.myproject.base.
> >
> > Should i declare the 'pages' and 'components'
> > directories of my library
> > in the tapestry.app-package context of my web.xml ?
> > If yes, what is the
> > syntax to do such a declaration ?
> >
> > Thanks in advance.
> >
> > Stephane
> >
> >
> >
> -
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
> >
>
>
> Home page : http://www.lombok.demon.co.uk/
>
>
>
>   ___
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
> now.
> http://uk.answers.yahoo.com/
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: T5: Multiple clicks causing NPE

2008-01-08 Thread jason lea
Hi,

We get this error quite often with Java 1.5, we asked about it in the
mailing list back in August.  We found the error doesn't occur in Java 1.6.
We usually see a stack trace with a NPE when doing getSession() or
getCookies().

Here is what I wrote last time:

We are getting an intermittent NullPointerException in Tapestry 5.0.5.  We
are running on Java 1.5.
It seems that the RequestGlobals has a null Request when the call to
getCookies is made (or that RequestGlobals is null).  We cannot get the
error to occur every time so testing is tricky, sometimes it occurs on the
first request after the webapp starts with subsequent requests good for a
few minutes before it occurs again.  Other times it starts fine and pressing
F5 100 times might make it occur.

Our thought at the moment is that a ThreadLocal bug (
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6550283 ) might be
causing the RequestGlobals to initially be correctly initialised and stored
in ThreadLocal but later on with more items being added this bug means
further down the track, a new RequestGlobals is added with null values.



-- 
Jason Lea


Re: T5 : declaration of pages and components packages from a library

2008-01-08 Thread Shing Hing Man
Have you tried the following ?

Suppose org.man.tapestry5.components will hold the new
components.

1) add the following to AppModule


public static void
contributeComponentClassResolver(Configuration
configuration)
{
// Creates a virtual root pacakge for
pages,components.
configuration.add(new LibraryMapping("man",
"org.man.tapestry5"));
}

2) Suppose in  org.man.tapestry5.components, we have
component PageLinkPopup.java.

Usage :

Home

or


Sum

Shing


--- Steph <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> I need to import in my tap5 project a library which
> includes tap5 pages
> and components.
> But when i try to extend a page from the library in
> my project, i get
> the following exception :
> 
> java.lang.RuntimeException: Base class
> com.mylibrary.pages.FramePage
> (super class of com.myproject.pages.Start) is not in
> a controlled
> package and is therefore not valid. You should try
> moving the class to
> package com.myproject.base.
> 
> Should i declare the 'pages' and 'components'
> directories of my library
> in the tapestry.app-package context of my web.xml ?
> If yes, what is the
> syntax to do such a declaration ?
> 
> Thanks in advance.
> 
> Stephane
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


Home page : http://www.lombok.demon.co.uk/



  ___
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

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



Re: T5 : declaration of pages and components packages from a library

2008-01-08 Thread Chris Lewis

Hi Steph,

The problem is probably that you are trying to extend a class that 
exists in your pages package. As documented here 
(http://tapestry.apache.org/tapestry5/tapestry-core/guide/component-classes.html), 
you must put such base classes in a 'base' package. I'm not sure if the 
package must be named 'base', but I know that you cannot have base 
classes in 'pages', 'components', and probably not in 'mixins.' This is 
because T5 does some magic on these classes at runtime, and extending 
them would apparently cause failures.
On a personal note, I if you find yourself extending pages you may want 
to reexamine your design. This is just my opinion, but I'm a firm 
believer in shallow class hierarchies, and being that T5 provides such a 
rich environment for composite behavior without subclassing (via 
services and mixins especially), I avoid page extention.


sincerely,
chris

Steph wrote:

Hi all,

I need to import in my tap5 project a library which includes tap5 pages
and components.
But when i try to extend a page from the library in my project, i get
the following exception :

java.lang.RuntimeException: Base class com.mylibrary.pages.FramePage
(super class of com.myproject.pages.Start) is not in a controlled
package and is therefore not valid. You should try moving the class to
package com.myproject.base.

Should i declare the 'pages' and 'components' directories of my library
in the tapestry.app-package context of my web.xml ? If yes, what is the
syntax to do such a declaration ?

Thanks in advance.

Stephane


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


  



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



T5 : declaration of pages and components packages from a library

2008-01-08 Thread Steph
Hi all,

I need to import in my tap5 project a library which includes tap5 pages
and components.
But when i try to extend a page from the library in my project, i get
the following exception :

java.lang.RuntimeException: Base class com.mylibrary.pages.FramePage
(super class of com.myproject.pages.Start) is not in a controlled
package and is therefore not valid. You should try moving the class to
package com.myproject.base.

Should i declare the 'pages' and 'components' directories of my library
in the tapestry.app-package context of my web.xml ? If yes, what is the
syntax to do such a declaration ?

Thanks in advance.

Stephane


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



Re: T5: Editing a list of values

2008-01-08 Thread Shing Hing Man
I have a micky mouse example that does something
similar. The live example and source code is at


http://lombok.demon.co.uk/tapestry5Demo/test/sum

Shing 


--- Kevin Menard <[EMAIL PROTECTED]> wrote:

> You could keep track of an index variable and use
> that to index a List in
> your page class.  Something like the following:
> 
> public String getValue()
> {
> return values.get(index);
> }
> 
> public void setValue(final String value)
> {
> values.set(index, value);
> }
> 
> Then the trick is updating the index value, but that
> may be simpler for you.
> I've used that trick to avoid serializing Cayenne
> objects in a Loop.  Of
> course, in that case, the semantics of the index
> value are very well-defined
> so YMMV.
> 
> -- 
> Kevin
> 
> 
> On 1/8/08 1:50 PM, in article
> [EMAIL PROTECTED], "Hugo Palma"
> <[EMAIL PROTECTED]> wrote:
> 
> > My use case is this,
> > 
> > i would like to let the user to enter an undefined
> number of values. I
> > have the UI implemented with a loop component
> getting the number of
> > cycles from a page property and in each cycle it
> places a new textfield
> > component.
> > 
> > The problem is, what property do i put in each of
> the textfield value
> > paramters ? I'm holding the values in a List
> property in my page.
> > I can't do  value="myList.0"/>.
> > 
> > Any ideas ?
> > I'm thinking that i may be complicating something
> that probably is much
> > simpler.
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 


Home page : http://www.lombok.demon.co.uk/



  ___
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

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



Re: T5: Multiple clicks causing NPE

2008-01-08 Thread Geoff Callender

The test was with 5.0.7.

On 09/01/2008, at 5:48 AM, Robert Zeigler wrote:

I've seen this same stack trace from pretty early on, but I never  
had time to track down the issue... I figured it was a threading  
issue, to be honest, and I wasn't convinced that it wasn't my code  
that was at fault.  But if you look at

http://issues.apache.org/jira/browse/TAPESTRY-1658
I posted the same stack trace there.  I'm seeing this in two  
separate apps now, one fairly complicated app, and one extremely  
trivial one.  I should back up a bit on the trivial app; I haven't  
personally seen it, but I'm now hearing reports from users that they  
are seeing it on occasion; they didn't use to, but the app usage is  
picking up now, so...

I've seen this in version 5.0.3, 5.0.4, 5.0.5, and also in 5.0.6.

The info that Geof provided sounds about right, as the more  
complicated app has more long-running procedures.


Sorry I don't have more info than that, but I've had my own series  
of issues to deal with that have been more pressing than an  
intermittent NPE.


Robert

On Jan 8, 2008, at 1/812:16 PM , Howard Lewis Ship wrote:


That doesn't look good .. but it is an earlier version of the
framework, looks like 5.0.3 or 5.0.4.

Looks like its hitting this code:

 public CookieSource buildCookieSource()
 {
 return new CookieSource()
 {

 public Cookie[] getCookies()
 {
 return  
_requestGlobals.getHTTPServletRequest().getCookies();

 }

 };
 }

That should be pretty bullet proof, since the _requestGlobals field  
is
final and set in the constructor.  I'm not sure what other changes  
may

have affected this situation in the intervening releases.

On Jan 8, 2008 4:09 AM, Geoff Callender
<[EMAIL PROTECTED]> wrote:

While trying to demonstrate the dangers of multiple submits, I found
Tapestry throwing NullPointerException.

Can someone who understands Tapestry's internals shed some light on
this?

To make the test possible, I emulated a slow operation by sleeping 2
seconds.  The NPE then occurred on the 3rd or later click - it  
varied

quite a bit.  Here's how I emulated the slow operation...

 @ApplicationState
 private MyOrder _myOrder;

 Object onSuccess() {
 sleep(2000); // Sleep 2 seconds to simulate slow  
transaction


 int newQuantity = _myOrder.getQuantity() + 1;
 _myOrder.setQuantity(newQuantity);

 return _page2;
 }

 private void sleep(long duration) {
 try {
 Thread.sleep(duration);
 }
 catch (InterruptedException e) {
 }
 }

Here's the exception...

22:45:53,443 ERROR [RequestExceptionHandler] Processing of request
failed with uncaught exception: java.lang.NullPointerException
java.lang.NullPointerException
 at org.apache.tapestry.internal.services.InternalModule
$2.getCookies(InternalModule.java:307)
 at  
$CookieSource_11759363dd0.getCookies($CookieSource_11759363dd0.java)

 at
org
.apache
.tapestry
.internal.services.CookiesImpl.readCookieValue(CookiesImpl.java:53)
 at  
$Cookies_11759363dcf.readCookieValue($Cookies_11759363dcf.java)

 at
org
.apache
.tapestry
.services
.PersistentLocaleImpl.getCookieValue(PersistentLocaleImpl.java:46)
 at
org
.apache
.tapestry 
.services.PersistentLocaleImpl.get(PersistentLocaleImpl.java:

40)
 at
$ 
PersistentLocale_11759363dce.get($PersistentLocale_11759363dce.java)

 at
org
.apache
.tapestry
.internal
.services
.LocalizationSetterImpl 
.setThreadLocale(LocalizationSetterImpl.java:98)

 at
$
LocalizationSetter_11759363dcb
.setThreadLocale($LocalizationSetter_11759363dcb.java)
 at
org
.apache
.tapestry
.internal 
.services.LocalizationFilter.service(LocalizationFilter.java:

41)
 at
$ 
RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)

 at org.apache.tapestry.services.TapestryModule
$2.service(TapestryModule.java:688)
 at
$ 
RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)

 at
org
.apache
.tapestry
.internal 
.services.StaticFilesFilter.service(StaticFilesFilter.java:84)

 at
$ 
RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)

 at org.apache.tapestry.internal.services.CheckForUpdatesFilter
$2.invoke(CheckForUpdatesFilter.java:97)
 at org.apache.tapestry.internal.services.CheckForUpdatesFilter
$2.invoke(CheckForUpdatesFilter.java:88)
 at
org
.apache
.tapestry
.ioc 
.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)

 at
org
.apache
.tapestry
.internal
.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java: 
110)

 at
$ 
RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)

 at
$ 
RequestHandler_11759363dc6.service($RequestHandler_11759363dc6.java)

 at org.apache.tapestry.services.TapestryModule
$12.service(TapestryModule.java:1086)
 at
$
HttpServletRequestHandler_11759363dc5
.service($Http

Re: PrivateAsset example please

2008-01-08 Thread munich
So what does it do? The service method does not return/change anything?

And then, this service will be added to the Hivemind.xml? 
What does such a Hivemind configuration look like ?

Where do I add this "f" parameter ?

Would it be possible to add the following to Tapestry:



public IAsset getPrivateImage(String key){

if (allowed){
return new PrivateImage("/home/images/".concat(key));
}
else {
return new PrivateImage("/home/images/forbidden.jpg");
}

}

This would it make a lot easierand many might find it useful.


 Original-Nachricht 
> Datum: Tue, 8 Jan 2008 19:40:00 +0200
> Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> An: "Tapestry users" 
> Betreff: Re: PrivateAsset example please

> oh - I think i'd go for a custom IEngineService for that...
> 
> i.e. something like :
> 
> public void service(IRequestCycle cycle) throws IOException {
> String filename = cycle.getParameter("f");
> String realFilename = imagesFolder + filename;
> OutputStream responseOutputStream =
> response.getOutputStream(new ContentType("image/jpeg"));
> InputStream stream = new FileInputStream(realFilename);
> IOUtils.copy(stream, responseOutputStream);
> }
> 
> If you want to stick with the assets approach, you'd need your own
> implementation perhaps
> 
> On Jan 8, 2008 7:25 PM,  <[EMAIL PROTECTED]> wrote:
> > Then, I just need to change the path somewhere I assume.
> >
> > It is 250 Gigabytes of image data and I do not want to war them every
> time I make a change during development...on the final system they will be on
> a linux machine so I can just make virtual directories and link to the
> storage.
> >
> > So do I need to use the hivemind.xml somehow ?
> >
> > It sounds really complicated just to have images from an external
> directory
> > outside of the war file / the web root
> >
> >
> >  Original-Nachricht 
> > > Datum: Tue, 8 Jan 2008 17:52:02 +0100
> > > Von: "Igor Drobiazko" <[EMAIL PROTECTED]>
> >
> > > An: "Tapestry users" 
> > > Betreff: Re: PrivateAsset example please
> >
> > > Have a look at HiveMind API.
> > >
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
> > >
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html
> > >
> > > If I would be you, I would rethink the architecture. How do you want
> to
> > > access images when you go online?
> > >
> > > On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:
> > >
> > > > Do you have an example?
> > > >
> > > > What is the path? Relativ so the classpath?
> > > > How do I create a location object ?
> > > >
> > > > Do I need to set:
> > > >
> > > >
> > > > > > > value="file:///Z:/Media/"/>
> > > >
> > > > as well or would that expose the whole directoy to anyone?
> > > >
> > > >
> > > > I wish there was an example somewhere.
> > > >
> > > >
> > > >  Original-Nachricht 
> > > > > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > An: "Tapestry users" 
> > > > > Betreff: Re: PrivateAsset example please
> > > >
> > > > > Hi, those Assets implementations are easier to create through the
> > > > > AssetFactory services...
> > > > >
> > > > > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > > > > IAsset createAbsoluteAsset(String path, Locale locale, Location
> > > > location)
> > > > >
> > > > >
> > > >
> > >
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> > > > >
> > > > >
> > > > > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > PrivateAsset takes the following parameters:
> > > > > >
> > > > > > Resource resourceLocation, IEngineService assetService, Location
> > > > > location
> > > > > >
> > > > > > The images are in another directory on a different diskthe
> > > > directory
> > > > > is on the classpath...so the image should be in:
> > > > > >
> > > > > > someimages/picture.jpg
> > > > > >
> > > > > > How do I create a resourcelocation, how do I get the
> assetService
> > > and
> > > > > how the location?
> > > > > >
> > > > > > Thanks!
> > > > > >
> > > > > >
> > > > > >
> > > > > >  Original-Nachricht 
> > > > > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > > > > Von: [EMAIL PROTECTED]
> > > > > >
> > > > > > > An: "Tapestry users" 
> > > > > > > Betreff: Re: PrivateAsset example please
> > > > > >
> > > > > > > Thanks. There are no exmaples on these pages though.
> > > > > > >
> > > > > > > public IAsset getScreenshot(String name){
> > > > > > >
> > > > > > >   return new
> > > > > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > > > > >
> > > > > > > I have tried this also:
> > > > > > >
> > > > > > > So if I used PrivateAsset what do the paramters look like?
> > > > > > >
> > > > > > > Just a short example would be cool
> > > > > > >
> > > > > > >

Redirecting using PageRedirectException throws EmptyStackException on upgrading to Tapestry 4.1.3

2008-01-08 Thread Senthil Sadasivam
Hi,

I am trying to Redirect from PageA to PageB after resetting certain
elements in PageB.
I am doing so using PageRedirectException(page)
But doing so I am getting a EmptyStackException. Can someone help me
with this.
Looks like its trying to remove PageA from memory and failed to find it
in the stack.

The same code works fine in Tapestry 4.0.3 but not in Tapestry 4.1.3

Following is the code script inside PageA from where I am calling PageB.

  @Override
  public void finishLoad(IRequestCycle pCycle, IPageLoader pLoader,
IComponentSpecification pSpecification)
  {
PageB page = (PageB)pCycle.getPage("pageB");
page.setClaim(null);
page.setInitialized(false);
throw new PageRedirectException(page);
  }

and the stack trace shows

2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.page.PageLoader] Establishing inherited bindings
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.page.PageLoader] Loaded page $PageB_68  3c1[pageB] with 145
components (maximum depth 5)
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Constructing
core service implementation for service
tapestry.persist.PageClientPropertyPersistenceStrategy
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
request to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
scope to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
encoder to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Constructing
core service implementation for service
tapestry.persist.AppClientPropertyPersistenceStrategy
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
request to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
scope to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Autowired
service property encoder to 
2008-01-03 16:47:33,887 DEBUG (http-0.0.0.0-8080-5)
[org.apache.tapestry.engine.AbstractEngine] Uncaught exception
java.util.EmptyStackException
 at java.util.Stack.peek(Stack.java:79)
 at java.util.Stack.pop(Stack.java:61)
 at
org.apache.tapestry.pageload.PageLoader.endConstructComponent(PageLoader
.java:469)
 at
org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.ja
va:424)
 at
org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639)
 at $IPageLoader_1174202977e.loadPage($IPageLoader_1174202977e.java)
 at $IPageLoader_1174202977f.loadPage($IPageLoader_1174202977f.java)
 at
org.apache.tapestry.pageload.PageSource.makeObject(PageSource.java:153)
 at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic
KeyedObjectPool.java:797)
 at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:177)
 at $IPageSource_117420296de.getPage($IPageSource_117420296de.java)
 at
org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:239)
 at
org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:226)
 at
org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:559)
 at org.apache.tapestry.engine.PageService.service(PageService.java:66)
 at
$IEngineService_11742029767.service($IEngineService_11742029767.java)
 at
org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(Engine
ServiceOuterProxy.java:72)
 at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:24
1)
 at
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeE
ngineTerminator.java:54)
 at
$WebRequestServicer_11742029744.service($WebRequestServicer_11742029744.
java)
 at
org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCa
chingFilter.java:54)
 at
$WebRequestServicerFilter_11742029746.service($WebRequestServicerFilter_
11742029746.java)
 at
$WebRequestServicer_11742029748.service($WebRequestServicer_11742029748.
java)
 at
$WebRequestServicer_11742029740.service($WebRequestServicer_11742029740.
java)
 at
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.servi
ce(WebRequestServicerPipelineBridge.java:61)
 at
$ServletRequestServicer_11742029726.service($ServletRequestServicer_1174
2029726.java)
 at
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedReques
tInjector.java:55)
 at
$ServletRequestServicerFilter_11742029722.service($ServletRequestService
rFilter_11742029722.java)
 at
$ServletRequestServicer_11742029728.service($ServletRequestServicer_1174
2029728.java)
 at
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDe
coderFilter.java:52)
 at
$ServletRequestServicerFilter_11742029720.service($ServletRequestService
rFilter_11742029720.java)
 at

Delegating or Redirecting from PageA to PageB in Tapestry 4.1.3 throws Exception

2008-01-08 Thread senthil-sadasivam

Hi,

I need to reset certaing elements in a page while navigating in to it
from another page.

But doing so I am getting a EmptyStackException. Can someone help me
with this.

Looks like its trying to remove PageA from memory and failed to find it
in the stack.

Following is the code script inside PageA from where I am calling PageB.

  @Override
  public void finishLoad(IRequestCycle pCycle, IPageLoader pLoader,
IComponentSpecification pSpecification)
  {
PageB page = (PageB)pCycle.getPage("pageB");
page.setClaim(null);
page.setInitialized(false);
throw new PageRedirectException(page);
  }

and the stack trace shows 

2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.page.PageLoader] Establishing inherited bindings
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.page.PageLoader] Loaded page $PageB_68  3c1[pageB] with 145
components (maximum depth 5)
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Constructing
core service implementation for service
tapestry.persist.PageClientPropertyPersistenceStrategy
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
request to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
scope to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.PageClientPropertyPersistenceStrategy] Set property
encoder to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Constructing
core service implementation for service
tapestry.persist.AppClientPropertyPersistenceStrategy
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
request to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Set property
scope to 
2008-01-03 16:47:33,871 DEBUG (http-0.0.0.0-8080-5)
[tapestry.persist.AppClientPropertyPersistenceStrategy] Autowired
service property encoder to 
2008-01-03 16:47:33,887 DEBUG (http-0.0.0.0-8080-5)
[org.apache.tapestry.engine.AbstractEngine] Uncaught exception
java.util.EmptyStackException
 at java.util.Stack.peek(Stack.java:79)
 at java.util.Stack.pop(Stack.java:61)
 at
org.apache.tapestry.pageload.PageLoader.endConstructComponent(PageLoader
.java:469)
 at
org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.ja
va:424)
 at
org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639)
 at $IPageLoader_1174202977e.loadPage($IPageLoader_1174202977e.java)
 at $IPageLoader_1174202977f.loadPage($IPageLoader_1174202977f.java)
 at
org.apache.tapestry.pageload.PageSource.makeObject(PageSource.java:153)
 at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Generic
KeyedObjectPool.java:797)
 at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:177)
 at $IPageSource_117420296de.getPage($IPageSource_117420296de.java)
 at
org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:239)
 at
org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:226)
 at
org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:559)
 at org.apache.tapestry.engine.PageService.service(PageService.java:66)
 at
$IEngineService_11742029767.service($IEngineService_11742029767.java)
 at
org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(Engine
ServiceOuterProxy.java:72)
 at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:24
1)
 at
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeE
ngineTerminator.java:54)
 at
$WebRequestServicer_11742029744.service($WebRequestServicer_11742029744.
java)
 at
org.apache.tapestry.services.impl.DisableCachingFilter.service(DisableCa
chingFilter.java:54)
 at
$WebRequestServicerFilter_11742029746.service($WebRequestServicerFilter_
11742029746.java)
 at
$WebRequestServicer_11742029748.service($WebRequestServicer_11742029748.
java)
 at
$WebRequestServicer_11742029740.service($WebRequestServicer_11742029740.
java)
 at
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.servi
ce(WebRequestServicerPipelineBridge.java:61)
 at
$ServletRequestServicer_11742029726.service($ServletRequestServicer_1174
2029726.java)
 at
org.apache.tapestry.request.DecodedRequestInjector.service(DecodedReques
tInjector.java:55)
 at
$ServletRequestServicerFilter_11742029722.service($ServletRequestService
rFilter_11742029722.java)
 at
$ServletRequestServicer_11742029728.service($ServletRequestServicer_1174
2029728.java)
 at
org.apache.tapestry.multipart.MultipartDecoderFilter.service(MultipartDe
coderFilter.java:52)
 at
$ServletRequestServicerFilter_11742029720.service($ServletRequestService
rFilter_11742029720.java)
 at
$ServletRequestServicer_11742029728.service($ServletRequestServicer_1174
2029728.java)
 at
org.apache.tapestry.s

Re: T5: Editing a list of values

2008-01-08 Thread Kevin Menard
You could keep track of an index variable and use that to index a List in
your page class.  Something like the following:

public String getValue()
{
return values.get(index);
}

public void setValue(final String value)
{
values.set(index, value);
}

Then the trick is updating the index value, but that may be simpler for you.
I've used that trick to avoid serializing Cayenne objects in a Loop.  Of
course, in that case, the semantics of the index value are very well-defined
so YMMV.

-- 
Kevin


On 1/8/08 1:50 PM, in article [EMAIL PROTECTED], "Hugo Palma"
<[EMAIL PROTECTED]> wrote:

> My use case is this,
> 
> i would like to let the user to enter an undefined number of values. I
> have the UI implemented with a loop component getting the number of
> cycles from a page property and in each cycle it places a new textfield
> component.
> 
> The problem is, what property do i put in each of the textfield value
> paramters ? I'm holding the values in a List property in my page.
> I can't do .
> 
> Any ideas ?
> I'm thinking that i may be complicating something that probably is much
> simpler.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



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



Re: T5: Editing a list of values

2008-01-08 Thread Hugo Palma
Yep, definitely was over complicating.
I just have to use the value parameter of the Loop component.

Hugo Palma wrote:
> My use case is this,
>
> i would like to let the user to enter an undefined number of values. I
> have the UI implemented with a loop component getting the number of
> cycles from a page property and in each cycle it places a new textfield
> component.
>
> The problem is, what property do i put in each of the textfield value
> paramters ? I'm holding the values in a List property in my page.
> I can't do .
>
> Any ideas ?
> I'm thinking that i may be complicating something that probably is much
> simpler.
>
>   

-- 
Hugo Palma

LOGICAL SOFTWARE
Human Capital | Enterprise Java Systems | Research

Phone: (+351) 961104211
Email: [EMAIL PROTECTED]
Blog : http://blogs.logical-software.com/roller/logicalme 
Web  : http://www.logical-software.com



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



T5: Editing a list of values

2008-01-08 Thread Hugo Palma
My use case is this,

i would like to let the user to enter an undefined number of values. I
have the UI implemented with a loop component getting the number of
cycles from a page property and in each cycle it places a new textfield
component.

The problem is, what property do i put in each of the textfield value
paramters ? I'm holding the values in a List property in my page.
I can't do .

Any ideas ?
I'm thinking that i may be complicating something that probably is much
simpler.

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



Re: T5: Multiple clicks causing NPE

2008-01-08 Thread Robert Zeigler
I've seen this same stack trace from pretty early on, but I never had  
time to track down the issue... I figured it was a threading issue, to  
be honest, and I wasn't convinced that it wasn't my code that was at  
fault.  But if you look at

http://issues.apache.org/jira/browse/TAPESTRY-1658
I posted the same stack trace there.  I'm seeing this in two separate  
apps now, one fairly complicated app, and one extremely trivial one.   
I should back up a bit on the trivial app; I haven't personally seen  
it, but I'm now hearing reports from users that they are seeing it on  
occasion; they didn't use to, but the app usage is picking up now, so...

I've seen this in version 5.0.3, 5.0.4, 5.0.5, and also in 5.0.6.

The info that Geof provided sounds about right, as the more  
complicated app has more long-running procedures.


Sorry I don't have more info than that, but I've had my own series of  
issues to deal with that have been more pressing than an intermittent  
NPE.


Robert

On Jan 8, 2008, at 1/812:16 PM , Howard Lewis Ship wrote:


That doesn't look good .. but it is an earlier version of the
framework, looks like 5.0.3 or 5.0.4.

Looks like its hitting this code:

   public CookieSource buildCookieSource()
   {
   return new CookieSource()
   {

   public Cookie[] getCookies()
   {
   return  
_requestGlobals.getHTTPServletRequest().getCookies();

   }

   };
   }

That should be pretty bullet proof, since the _requestGlobals field is
final and set in the constructor.  I'm not sure what other changes may
have affected this situation in the intervening releases.

On Jan 8, 2008 4:09 AM, Geoff Callender
<[EMAIL PROTECTED]> wrote:

While trying to demonstrate the dangers of multiple submits, I found
Tapestry throwing NullPointerException.

Can someone who understands Tapestry's internals shed some light on
this?

To make the test possible, I emulated a slow operation by sleeping 2
seconds.  The NPE then occurred on the 3rd or later click - it varied
quite a bit.  Here's how I emulated the slow operation...

   @ApplicationState
   private MyOrder _myOrder;

   Object onSuccess() {
   sleep(2000); // Sleep 2 seconds to simulate slow  
transaction


   int newQuantity = _myOrder.getQuantity() + 1;
   _myOrder.setQuantity(newQuantity);

   return _page2;
   }

   private void sleep(long duration) {
   try {
   Thread.sleep(duration);
   }
   catch (InterruptedException e) {
   }
   }

Here's the exception...

22:45:53,443 ERROR [RequestExceptionHandler] Processing of request
failed with uncaught exception: java.lang.NullPointerException
java.lang.NullPointerException
   at org.apache.tapestry.internal.services.InternalModule
$2.getCookies(InternalModule.java:307)
   at  
$CookieSource_11759363dd0.getCookies($CookieSource_11759363dd0.java)

   at
org
.apache
.tapestry
.internal.services.CookiesImpl.readCookieValue(CookiesImpl.java:53)
   at  
$Cookies_11759363dcf.readCookieValue($Cookies_11759363dcf.java)

   at
org
.apache
.tapestry
.services
.PersistentLocaleImpl.getCookieValue(PersistentLocaleImpl.java:46)
   at
org
.apache
.tapestry 
.services.PersistentLocaleImpl.get(PersistentLocaleImpl.java:

40)
   at
$PersistentLocale_11759363dce.get($PersistentLocale_11759363dce.java)
   at
org
.apache
.tapestry
.internal
.services
.LocalizationSetterImpl.setThreadLocale(LocalizationSetterImpl.java: 
98)

   at
$
LocalizationSetter_11759363dcb
.setThreadLocale($LocalizationSetter_11759363dcb.java)
   at
org
.apache
.tapestry
.internal 
.services.LocalizationFilter.service(LocalizationFilter.java:

41)
   at
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
   at org.apache.tapestry.services.TapestryModule
$2.service(TapestryModule.java:688)
   at
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
   at
org
.apache
.tapestry
.internal.services.StaticFilesFilter.service(StaticFilesFilter.java: 
84)

   at
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
   at org.apache.tapestry.internal.services.CheckForUpdatesFilter
$2.invoke(CheckForUpdatesFilter.java:97)
   at org.apache.tapestry.internal.services.CheckForUpdatesFilter
$2.invoke(CheckForUpdatesFilter.java:88)
   at
org
.apache
.tapestry
.ioc 
.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)

   at
org
.apache
.tapestry
.internal
.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java: 
110)

   at
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
   at
$RequestHandler_11759363dc6.service($RequestHandler_11759363dc6.java)
   at org.apache.tapestry.services.TapestryModule
$12.service(TapestryModule.java:1086)
   at
$
HttpServletRequestHandler_11759363dc5
.service($HttpServletRe

Re: T5: Multiple clicks causing NPE

2008-01-08 Thread Howard Lewis Ship
That doesn't look good .. but it is an earlier version of the
framework, looks like 5.0.3 or 5.0.4.

Looks like its hitting this code:

public CookieSource buildCookieSource()
{
return new CookieSource()
{

public Cookie[] getCookies()
{
return _requestGlobals.getHTTPServletRequest().getCookies();
}

};
}

That should be pretty bullet proof, since the _requestGlobals field is
final and set in the constructor.  I'm not sure what other changes may
have affected this situation in the intervening releases.

On Jan 8, 2008 4:09 AM, Geoff Callender
<[EMAIL PROTECTED]> wrote:
> While trying to demonstrate the dangers of multiple submits, I found
> Tapestry throwing NullPointerException.
>
> Can someone who understands Tapestry's internals shed some light on
> this?
>
> To make the test possible, I emulated a slow operation by sleeping 2
> seconds.  The NPE then occurred on the 3rd or later click - it varied
> quite a bit.  Here's how I emulated the slow operation...
>
> @ApplicationState
> private MyOrder _myOrder;
>
> Object onSuccess() {
> sleep(2000); // Sleep 2 seconds to simulate slow transaction
>
> int newQuantity = _myOrder.getQuantity() + 1;
> _myOrder.setQuantity(newQuantity);
>
> return _page2;
> }
>
> private void sleep(long duration) {
> try {
> Thread.sleep(duration);
> }
> catch (InterruptedException e) {
> }
> }
>
> Here's the exception...
>
> 22:45:53,443 ERROR [RequestExceptionHandler] Processing of request
> failed with uncaught exception: java.lang.NullPointerException
> java.lang.NullPointerException
> at org.apache.tapestry.internal.services.InternalModule
> $2.getCookies(InternalModule.java:307)
> at 
> $CookieSource_11759363dd0.getCookies($CookieSource_11759363dd0.java)
> at
> org
> .apache
> .tapestry
> .internal.services.CookiesImpl.readCookieValue(CookiesImpl.java:53)
> at $Cookies_11759363dcf.readCookieValue($Cookies_11759363dcf.java)
> at
> org
> .apache
> .tapestry
> .services
> .PersistentLocaleImpl.getCookieValue(PersistentLocaleImpl.java:46)
> at
> org
> .apache
> .tapestry.services.PersistentLocaleImpl.get(PersistentLocaleImpl.java:
> 40)
> at
> $PersistentLocale_11759363dce.get($PersistentLocale_11759363dce.java)
> at
> org
> .apache
> .tapestry
> .internal
> .services
> .LocalizationSetterImpl.setThreadLocale(LocalizationSetterImpl.java:98)
> at
> $
> LocalizationSetter_11759363dcb
> .setThreadLocale($LocalizationSetter_11759363dcb.java)
> at
> org
> .apache
> .tapestry
> .internal.services.LocalizationFilter.service(LocalizationFilter.java:
> 41)
> at
> $RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
> at org.apache.tapestry.services.TapestryModule
> $2.service(TapestryModule.java:688)
> at
> $RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
> at
> org
> .apache
> .tapestry
> .internal.services.StaticFilesFilter.service(StaticFilesFilter.java:84)
> at
> $RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
> at org.apache.tapestry.internal.services.CheckForUpdatesFilter
> $2.invoke(CheckForUpdatesFilter.java:97)
> at org.apache.tapestry.internal.services.CheckForUpdatesFilter
> $2.invoke(CheckForUpdatesFilter.java:88)
> at
> org
> .apache
> .tapestry
> .ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
> at
> org
> .apache
> .tapestry
> .internal
> .services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:110)
> at
> $RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
> at
> $RequestHandler_11759363dc6.service($RequestHandler_11759363dc6.java)
> at org.apache.tapestry.services.TapestryModule
> $12.service(TapestryModule.java:1086)
> at
> $
> HttpServletRequestHandler_11759363dc5
> .service($HttpServletRequestHandler_11759363dc5.java)
> at 
> org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:135)
> at
> org
> .apache
> .catalina
> .core
> .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
> 235)
> at
> org
> .apache
> .catalina
> .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org
> .jboss
> .web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:
> 96)
> at
> org
> .apache
> .catalina
> .core
> .ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
> 235)
> at
> org
> .apache
> .catalina
> .core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org
> .apache
> .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> 230)
> 

Re: PrivateAsset example please

2008-01-08 Thread Daniel Jue
um, I meant "done this way"

On 1/8/08, Daniel Jue <[EMAIL PROTECTED]> wrote:
> It could also be dont this way:
> http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile
>
> On 1/8/08, Igor Drobiazko <[EMAIL PROTECTED]> wrote:
> > Have a look at HiveMind API.
> >
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
> >
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html
> >
> > If I would be you, I would rethink the architecture. How do you want to
> > access images when you go online?
> >
> > On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:
> >
> > > Do you have an example?
> > >
> > > What is the path? Relativ so the classpath?
> > > How do I create a location object ?
> > >
> > > Do I need to set:
> > >
> > >
> > > > > value="file:///Z:/Media/"/>
> > >
> > > as well or would that expose the whole directoy to anyone?
> > >
> > >
> > > I wish there was an example somewhere.
> > >
> > >
> > >  Original-Nachricht 
> > > > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > An: "Tapestry users" 
> > > > Betreff: Re: PrivateAsset example please
> > >
> > > > Hi, those Assets implementations are easier to create through the
> > > > AssetFactory services...
> > > >
> > > > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > > > IAsset createAbsoluteAsset(String path, Locale locale, Location
> > > location)
> > > >
> > > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> > > >
> > > >
> > > > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > PrivateAsset takes the following parameters:
> > > > >
> > > > > Resource resourceLocation, IEngineService assetService, Location
> > > > location
> > > > >
> > > > > The images are in another directory on a different diskthe
> > > directory
> > > > is on the classpath...so the image should be in:
> > > > >
> > > > > someimages/picture.jpg
> > > > >
> > > > > How do I create a resourcelocation, how do I get the assetService
> and
> > > > how the location?
> > > > >
> > > > > Thanks!
> > > > >
> > > > >
> > > > >
> > > > >  Original-Nachricht 
> > > > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > > > Von: [EMAIL PROTECTED]
> > > > >
> > > > > > An: "Tapestry users" 
> > > > > > Betreff: Re: PrivateAsset example please
> > > > >
> > > > > > Thanks. There are no exmaples on these pages though.
> > > > > >
> > > > > > public IAsset getScreenshot(String name){
> > > > > >
> > > > > >   return new
> > > > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > > > >
> > > > > > I have tried this also:
> > > > > >
> > > > > > So if I used PrivateAsset what do the paramters look like?
> > > > > >
> > > > > > Just a short example would be cool
> > > > > >
> > > > > >
> > > > > >
> > > > > >  Original-Nachricht 
> > > > > > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > > > An: "Tapestry users" 
> > > > > > > Betreff: Re: PrivateAsset example please
> > > > > >
> > > > > > > it's auto-used when it's a classpath asset...
> > > > > > > see
> > > > > > >
> > > > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > > > > > and
> > > > > > >
> > > > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > > > > > (InjectAsset)
> > > > > > >
> > > > > > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > > > I wonder who this works:
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > > > > > >
> > > > > > > > How do I use the PrivateAsset component?
> > > > > > > >
> > > > > > > >
> > > > -
> > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > > > > Tapestry / Tacos developer
> > > > > > > Open Source / JEE Consulting
> > > > > > >
> > > > > > >
> > > > -
> > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > -
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> -
> > > > > To unsubscribe, e-mail: [E

Re: PrivateAsset example please

2008-01-08 Thread Daniel Jue
It could also be dont this way:
http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile

On 1/8/08, Igor Drobiazko <[EMAIL PROTECTED]> wrote:
> Have a look at HiveMind API.
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html
>
> If I would be you, I would rethink the architecture. How do you want to
> access images when you go online?
>
> On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:
>
> > Do you have an example?
> >
> > What is the path? Relativ so the classpath?
> > How do I create a location object ?
> >
> > Do I need to set:
> >
> >
> > > value="file:///Z:/Media/"/>
> >
> > as well or would that expose the whole directoy to anyone?
> >
> >
> > I wish there was an example somewhere.
> >
> >
> >  Original-Nachricht 
> > > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > An: "Tapestry users" 
> > > Betreff: Re: PrivateAsset example please
> >
> > > Hi, those Assets implementations are easier to create through the
> > > AssetFactory services...
> > >
> > > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > > IAsset createAbsoluteAsset(String path, Locale locale, Location
> > location)
> > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> > >
> > >
> > > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > > PrivateAsset takes the following parameters:
> > > >
> > > > Resource resourceLocation, IEngineService assetService, Location
> > > location
> > > >
> > > > The images are in another directory on a different diskthe
> > directory
> > > is on the classpath...so the image should be in:
> > > >
> > > > someimages/picture.jpg
> > > >
> > > > How do I create a resourcelocation, how do I get the assetService and
> > > how the location?
> > > >
> > > > Thanks!
> > > >
> > > >
> > > >
> > > >  Original-Nachricht 
> > > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > > Von: [EMAIL PROTECTED]
> > > >
> > > > > An: "Tapestry users" 
> > > > > Betreff: Re: PrivateAsset example please
> > > >
> > > > > Thanks. There are no exmaples on these pages though.
> > > > >
> > > > > public IAsset getScreenshot(String name){
> > > > >
> > > > >   return new
> > > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > > >
> > > > > I have tried this also:
> > > > >
> > > > > So if I used PrivateAsset what do the paramters look like?
> > > > >
> > > > > Just a short example would be cool
> > > > >
> > > > >
> > > > >
> > > > >  Original-Nachricht 
> > > > > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > > An: "Tapestry users" 
> > > > > > Betreff: Re: PrivateAsset example please
> > > > >
> > > > > > it's auto-used when it's a classpath asset...
> > > > > > see
> > > > > >
> > > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > > > > and
> > > > > >
> > > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > > > > (InjectAsset)
> > > > > >
> > > > > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > > I wonder who this works:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > > > > >
> > > > > > > How do I use the PrivateAsset component?
> > > > > > >
> > > > > > >
> > > -
> > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > > > Tapestry / Tacos developer
> > > > > > Open Source / JEE Consulting
> > > > > >
> > > > > >
> > > -
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > -
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > Tapestry / Tacos developer
> > > Open Source / JEE Consulting
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PRO

Re: PrivateAsset example please

2008-01-08 Thread Igor Drobiazko
You can also create your own implementation of IAsset. Something like that:

public class YetAnotherAsset implements IAsset{
private Resource resource;

public YetAnotherAsset(Resource resource){
   this.resource=resource;
}
public String buildURL(){
return resource.getPath();
}
public Resource getResourceLocation(){
 return this.resource;
}
public Resource getAsStream(){
   use IOUtils
}
}

And put e.g
http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.htmlinto
the constructor

On Jan 8, 2008 6:40 PM, Andreas Andreou <[EMAIL PROTECTED]> wrote:

> oh - I think i'd go for a custom IEngineService for that...
>
> i.e. something like :
>
>public void service(IRequestCycle cycle) throws IOException {
>String filename = cycle.getParameter("f");
>String realFilename = imagesFolder + filename;
>OutputStream responseOutputStream =
> response.getOutputStream(new ContentType("image/jpeg"));
>InputStream stream = new FileInputStream(realFilename);
>IOUtils.copy(stream, responseOutputStream);
>}
>
> If you want to stick with the assets approach, you'd need your own
> implementation perhaps
>
> On Jan 8, 2008 7:25 PM,  <[EMAIL PROTECTED]> wrote:
> > Then, I just need to change the path somewhere I assume.
> >
> > It is 250 Gigabytes of image data and I do not want to war them every
> time I make a change during development...on the final system they will be
> on a linux machine so I can just make virtual directories and link to the
> storage.
> >
> > So do I need to use the hivemind.xml somehow ?
> >
> > It sounds really complicated just to have images from an external
> directory
> > outside of the war file / the web root
> >
> >
> >  Original-Nachricht 
> > > Datum: Tue, 8 Jan 2008 17:52:02 +0100
> > > Von: "Igor Drobiazko" <[EMAIL PROTECTED]>
> >
> > > An: "Tapestry users" 
> > > Betreff: Re: PrivateAsset example please
> >
> > > Have a look at HiveMind API.
> > >
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
> > >
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html
> > >
> > > If I would be you, I would rethink the architecture. How do you want
> to
> > > access images when you go online?
> > >
> > > On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:
> > >
> > > > Do you have an example?
> > > >
> > > > What is the path? Relativ so the classpath?
> > > > How do I create a location object ?
> > > >
> > > > Do I need to set:
> > > >
> > > >
> > > > > > > value="file:///Z:/Media/"/>
> > > >
> > > > as well or would that expose the whole directoy to anyone?
> > > >
> > > >
> > > > I wish there was an example somewhere.
> > > >
> > > >
> > > >  Original-Nachricht 
> > > > > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > An: "Tapestry users" 
> > > > > Betreff: Re: PrivateAsset example please
> > > >
> > > > > Hi, those Assets implementations are easier to create through the
> > > > > AssetFactory services...
> > > > >
> > > > > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > > > > IAsset createAbsoluteAsset(String path, Locale locale, Location
> > > > location)
> > > > >
> > > > >
> > > >
> > >
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> > > > >
> > > > >
> > > > > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > PrivateAsset takes the following parameters:
> > > > > >
> > > > > > Resource resourceLocation, IEngineService assetService, Location
> > > > > location
> > > > > >
> > > > > > The images are in another directory on a different diskthe
> > > > directory
> > > > > is on the classpath...so the image should be in:
> > > > > >
> > > > > > someimages/picture.jpg
> > > > > >
> > > > > > How do I create a resourcelocation, how do I get the
> assetService
> > > and
> > > > > how the location?
> > > > > >
> > > > > > Thanks!
> > > > > >
> > > > > >
> > > > > >
> > > > > >  Original-Nachricht 
> > > > > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > > > > Von: [EMAIL PROTECTED]
> > > > > >
> > > > > > > An: "Tapestry users" 
> > > > > > > Betreff: Re: PrivateAsset example please
> > > > > >
> > > > > > > Thanks. There are no exmaples on these pages though.
> > > > > > >
> > > > > > > public IAsset getScreenshot(String name){
> > > > > > >
> > > > > > >   return new
> > > > > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > > > > >
> > > > > > > I have tried this also:
> > > > > > >
> > > > > > > So if I used PrivateAsset what do the paramters look like?
> > > > > > >
> > > > > > > Just a short example would be cool
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >  Original-Nachricht 
> > > 

Re: PrivateAsset example please

2008-01-08 Thread Andreas Andreou
oh - I think i'd go for a custom IEngineService for that...

i.e. something like :

public void service(IRequestCycle cycle) throws IOException {
String filename = cycle.getParameter("f");
String realFilename = imagesFolder + filename;
OutputStream responseOutputStream =
response.getOutputStream(new ContentType("image/jpeg"));
InputStream stream = new FileInputStream(realFilename);
IOUtils.copy(stream, responseOutputStream);
}

If you want to stick with the assets approach, you'd need your own
implementation perhaps

On Jan 8, 2008 7:25 PM,  <[EMAIL PROTECTED]> wrote:
> Then, I just need to change the path somewhere I assume.
>
> It is 250 Gigabytes of image data and I do not want to war them every time I 
> make a change during development...on the final system they will be on a 
> linux machine so I can just make virtual directories and link to the storage.
>
> So do I need to use the hivemind.xml somehow ?
>
> It sounds really complicated just to have images from an external directory
> outside of the war file / the web root
>
>
>  Original-Nachricht 
> > Datum: Tue, 8 Jan 2008 17:52:02 +0100
> > Von: "Igor Drobiazko" <[EMAIL PROTECTED]>
>
> > An: "Tapestry users" 
> > Betreff: Re: PrivateAsset example please
>
> > Have a look at HiveMind API.
> > http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
> > http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html
> >
> > If I would be you, I would rethink the architecture. How do you want to
> > access images when you go online?
> >
> > On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:
> >
> > > Do you have an example?
> > >
> > > What is the path? Relativ so the classpath?
> > > How do I create a location object ?
> > >
> > > Do I need to set:
> > >
> > >
> > > > > value="file:///Z:/Media/"/>
> > >
> > > as well or would that expose the whole directoy to anyone?
> > >
> > >
> > > I wish there was an example somewhere.
> > >
> > >
> > >  Original-Nachricht 
> > > > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > An: "Tapestry users" 
> > > > Betreff: Re: PrivateAsset example please
> > >
> > > > Hi, those Assets implementations are easier to create through the
> > > > AssetFactory services...
> > > >
> > > > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > > > IAsset createAbsoluteAsset(String path, Locale locale, Location
> > > location)
> > > >
> > > >
> > >
> > http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> > > >
> > > >
> > > > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > PrivateAsset takes the following parameters:
> > > > >
> > > > > Resource resourceLocation, IEngineService assetService, Location
> > > > location
> > > > >
> > > > > The images are in another directory on a different diskthe
> > > directory
> > > > is on the classpath...so the image should be in:
> > > > >
> > > > > someimages/picture.jpg
> > > > >
> > > > > How do I create a resourcelocation, how do I get the assetService
> > and
> > > > how the location?
> > > > >
> > > > > Thanks!
> > > > >
> > > > >
> > > > >
> > > > >  Original-Nachricht 
> > > > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > > > Von: [EMAIL PROTECTED]
> > > > >
> > > > > > An: "Tapestry users" 
> > > > > > Betreff: Re: PrivateAsset example please
> > > > >
> > > > > > Thanks. There are no exmaples on these pages though.
> > > > > >
> > > > > > public IAsset getScreenshot(String name){
> > > > > >
> > > > > >   return new
> > > > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > > > >
> > > > > > I have tried this also:
> > > > > >
> > > > > > So if I used PrivateAsset what do the paramters look like?
> > > > > >
> > > > > > Just a short example would be cool
> > > > > >
> > > > > >
> > > > > >
> > > > > >  Original-Nachricht 
> > > > > > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > > > An: "Tapestry users" 
> > > > > > > Betreff: Re: PrivateAsset example please
> > > > > >
> > > > > > > it's auto-used when it's a classpath asset...
> > > > > > > see
> > > > > > >
> > > > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > > > > > and
> > > > > > >
> > > > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > > > > > (InjectAsset)
> > > > > > >
> > > > > > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > > > I wonder who this works:
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > >
> > >
> > http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > > > > > >
> > > > > > > > How do I use the PrivateAsset component?
> > > >

Re: PrivateAsset example please

2008-01-08 Thread munich
Then, I just need to change the path somewhere I assume.

It is 250 Gigabytes of image data and I do not want to war them every time I 
make a change during development...on the final system they will be on a linux 
machine so I can just make virtual directories and link to the storage.

So do I need to use the hivemind.xml somehow ?

It sounds really complicated just to have images from an external directory
outside of the war file / the web root


 Original-Nachricht 
> Datum: Tue, 8 Jan 2008 17:52:02 +0100
> Von: "Igor Drobiazko" <[EMAIL PROTECTED]>
> An: "Tapestry users" 
> Betreff: Re: PrivateAsset example please

> Have a look at HiveMind API.
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
> http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html
> 
> If I would be you, I would rethink the architecture. How do you want to
> access images when you go online?
> 
> On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:
> 
> > Do you have an example?
> >
> > What is the path? Relativ so the classpath?
> > How do I create a location object ?
> >
> > Do I need to set:
> >
> >
> > > value="file:///Z:/Media/"/>
> >
> > as well or would that expose the whole directoy to anyone?
> >
> >
> > I wish there was an example somewhere.
> >
> >
> >  Original-Nachricht 
> > > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > An: "Tapestry users" 
> > > Betreff: Re: PrivateAsset example please
> >
> > > Hi, those Assets implementations are easier to create through the
> > > AssetFactory services...
> > >
> > > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > > IAsset createAbsoluteAsset(String path, Locale locale, Location
> > location)
> > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> > >
> > >
> > > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > > PrivateAsset takes the following parameters:
> > > >
> > > > Resource resourceLocation, IEngineService assetService, Location
> > > location
> > > >
> > > > The images are in another directory on a different diskthe
> > directory
> > > is on the classpath...so the image should be in:
> > > >
> > > > someimages/picture.jpg
> > > >
> > > > How do I create a resourcelocation, how do I get the assetService
> and
> > > how the location?
> > > >
> > > > Thanks!
> > > >
> > > >
> > > >
> > > >  Original-Nachricht 
> > > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > > Von: [EMAIL PROTECTED]
> > > >
> > > > > An: "Tapestry users" 
> > > > > Betreff: Re: PrivateAsset example please
> > > >
> > > > > Thanks. There are no exmaples on these pages though.
> > > > >
> > > > > public IAsset getScreenshot(String name){
> > > > >
> > > > >   return new
> > > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > > >
> > > > > I have tried this also:
> > > > >
> > > > > So if I used PrivateAsset what do the paramters look like?
> > > > >
> > > > > Just a short example would be cool
> > > > >
> > > > >
> > > > >
> > > > >  Original-Nachricht 
> > > > > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > > An: "Tapestry users" 
> > > > > > Betreff: Re: PrivateAsset example please
> > > > >
> > > > > > it's auto-used when it's a classpath asset...
> > > > > > see
> > > > > >
> > > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > > > > and
> > > > > >
> > > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > > > > (InjectAsset)
> > > > > >
> > > > > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > > I wonder who this works:
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > > > > >
> > > > > > > How do I use the PrivateAsset component?
> > > > > > >
> > > > > > >
> > > -
> > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > > > Tapestry / Tacos developer
> > > > > > Open Source / JEE Consulting
> > > > > >
> > > > > >
> > > -
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > -
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]

Re: PrivateAsset example please

2008-01-08 Thread Igor Drobiazko
Have a look at HiveMind API.
http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/impl/LocationImpl.html
http://hivemind.apache.org/hivemind1/hivemind/apidocs/org/apache/hivemind/util/URLResource.html

If I would be you, I would rethink the architecture. How do you want to
access images when you go online?

On Jan 8, 2008 5:37 PM, <[EMAIL PROTECTED]> wrote:

> Do you have an example?
>
> What is the path? Relativ so the classpath?
> How do I create a location object ?
>
> Do I need to set:
>
>
> value="file:///Z:/Media/"/>
>
> as well or would that expose the whole directoy to anyone?
>
>
> I wish there was an example somewhere.
>
>
>  Original-Nachricht 
> > Datum: Tue, 8 Jan 2008 18:20:34 +0200
> > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > An: "Tapestry users" 
> > Betreff: Re: PrivateAsset example please
>
> > Hi, those Assets implementations are easier to create through the
> > AssetFactory services...
> >
> > For instance, there's a ClasspathAssetFactory, so perhaps use its
> > IAsset createAbsoluteAsset(String path, Locale locale, Location
> location)
> >
> >
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> >
> >
> > On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > > PrivateAsset takes the following parameters:
> > >
> > > Resource resourceLocation, IEngineService assetService, Location
> > location
> > >
> > > The images are in another directory on a different diskthe
> directory
> > is on the classpath...so the image should be in:
> > >
> > > someimages/picture.jpg
> > >
> > > How do I create a resourcelocation, how do I get the assetService and
> > how the location?
> > >
> > > Thanks!
> > >
> > >
> > >
> > >  Original-Nachricht 
> > > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > > Von: [EMAIL PROTECTED]
> > >
> > > > An: "Tapestry users" 
> > > > Betreff: Re: PrivateAsset example please
> > >
> > > > Thanks. There are no exmaples on these pages though.
> > > >
> > > > public IAsset getScreenshot(String name){
> > > >
> > > >   return new
> > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > > >
> > > > I have tried this also:
> > > >
> > > > So if I used PrivateAsset what do the paramters look like?
> > > >
> > > > Just a short example would be cool
> > > >
> > > >
> > > >
> > > >  Original-Nachricht 
> > > > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > > An: "Tapestry users" 
> > > > > Betreff: Re: PrivateAsset example please
> > > >
> > > > > it's auto-used when it's a classpath asset...
> > > > > see
> > > > >
> > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > > > and
> > > > >
> > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > > > (InjectAsset)
> > > > >
> > > > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > > I wonder who this works:
> > > > > >
> > > > > >
> > > > >
> > > >
> >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > > > >
> > > > > > How do I use the PrivateAsset component?
> > > > > >
> > > > > >
> > -
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > > Tapestry / Tacos developer
> > > > > Open Source / JEE Consulting
> > > > >
> > > > >
> > -
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> > --
> > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > Tapestry / Tacos developer
> > Open Source / JEE Consulting
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Best regards,

Igor Drobiazko


Re: T5: Multiple clicks causing NPE

2008-01-08 Thread Daniel Jue
This is great!  We should all be stress testing the framework to
reveal these kinds of problems.  Easier to fix now than later!

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



Re: PrivateAsset example please

2008-01-08 Thread munich
Do you have an example?

What is the path? Relativ so the classpath?
How do I create a location object ?

Do I need to set:




as well or would that expose the whole directoy to anyone?


I wish there was an example somewhere.  


 Original-Nachricht 
> Datum: Tue, 8 Jan 2008 18:20:34 +0200
> Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> An: "Tapestry users" 
> Betreff: Re: PrivateAsset example please

> Hi, those Assets implementations are easier to create through the
> AssetFactory services...
> 
> For instance, there's a ClasspathAssetFactory, so perhaps use its
> IAsset createAbsoluteAsset(String path, Locale locale, Location location)
> 
> http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html
> 
> 
> On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> > PrivateAsset takes the following parameters:
> >
> > Resource resourceLocation, IEngineService assetService, Location
> location
> >
> > The images are in another directory on a different diskthe directory
> is on the classpath...so the image should be in:
> >
> > someimages/picture.jpg
> >
> > How do I create a resourcelocation, how do I get the assetService and
> how the location?
> >
> > Thanks!
> >
> >
> >
> >  Original-Nachricht 
> > > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > > Von: [EMAIL PROTECTED]
> >
> > > An: "Tapestry users" 
> > > Betreff: Re: PrivateAsset example please
> >
> > > Thanks. There are no exmaples on these pages though.
> > >
> > > public IAsset getScreenshot(String name){
> > >
> > >   return new
> ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> > >
> > > I have tried this also:
> > >
> > > So if I used PrivateAsset what do the paramters look like?
> > >
> > > Just a short example would be cool
> > >
> > >
> > >
> > >  Original-Nachricht 
> > > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > > An: "Tapestry users" 
> > > > Betreff: Re: PrivateAsset example please
> > >
> > > > it's auto-used when it's a classpath asset...
> > > > see
> > > >
> http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > > and
> > > >
> http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > > (InjectAsset)
> > > >
> > > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > > I wonder who this works:
> > > > >
> > > > >
> > > >
> > >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > > >
> > > > > How do I use the PrivateAsset component?
> > > > >
> > > > >
> -
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > > Tapestry / Tacos developer
> > > > Open Source / JEE Consulting
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> 
> -- 
> Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread Daniel Jue
I just realized my non-tapestry pages are using
org.apache.log4j.Logger; not slf4j.

On Jan 8, 2008 11:32 AM, Daniel Jue <[EMAIL PROTECTED]> wrote:
> I like to make mine static in the non-tapestry pages:
>
> private static Logger logger = Logger.getLogger(DAOUtil.class);
>
> Perhaps this is a good time to learn how I can use Tapestry IOC for
> the non Tapestry portion of my web app?
> That would be pretty cool.
>
> Here is an excerpt from my log4j.properties.  I am just assuming slf4j
> uses log4j.properties as well.
>
> log4j.rootCategory=debug, A1
>
> # A1 is set to be a ConsoleAppender.
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>
> # A1 uses PatternLayout.
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
>
> #log4j.category.org.apache.tapestry.TapestryFilter=debug
> #log4j.category.org.apache.tapestry=error
> #log4j.category.tapestry=error
> org.acegisecurity=debug
> log4j.category.com.mycompany.myapp=debug
> log4j.category.com.mycompany.myapp.wui.tapestry.components.layout.recognizer=info
> log4j.category.org.apache.tapestry=error
> log4j.category.com.mycompany.myapp.wui.general.OldMenu=error
> log4j.category.com.mycompany.myapp.wui.general.TreeMenu=error
> log4j.logger.org.acegisecurity=DEBUG
> #log4j.category.app=error
> #log4j.category.app.TimingFilter=debug
>
> # Turning on debug mode for a page or component will show all of the
> code changes that occur when the
> # class is loaded.  Turning on debug mode for a page will enable
> verbose output about rendering
> # the page (and its components).
> # log4j.category.org.example.myapp.pages.Start=debug
>
> ### Hibernate logging options ###
> log4j.logger.net.sf.hibernate=debug
> ### log JDBC bind parameters ###
> log4j.logger.net.sf.hibernate.type=debug
> ### log PreparedStatement cache activity ###
> log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=debug
>
>
>
>
>
>
>
>
>
> On Jan 8, 2008 3:38 AM, Davor Hrg <[EMAIL PROTECTED]> wrote:
> > for tapestry services just define "Logger logger" as constructor parameter..
> >
> >
> > Davor Hrg
> >
> >
> > On Jan 8, 2008 9:22 AM, Steph <[EMAIL PROTECTED]> wrote:
> > > How do you get your logger in your code ?
> > > The injection
> > > @Inject
> > > private Logger log;
> > > is only useable in Tapestry pages, components, ...
> > > It will log nothing in your other classes managed by Spring, Hibernate, 
> > > ...
> > > Outside of Tapestry, you should use something like the line below to use
> > > slf4j :
> > > private final Logger log = LoggerFactory.getLogger(YourClass.class);
> > >
> > > Stephane
> > >
> > > Andy Huhn a écrit :
> > >
> > > > Hi Buckofive,
> > > >
> > > > Here are a couple of relevant lines from my log4j.properties file.  My
> > > > file is in src/main/resources:
> > > >
> > > > log4j.logger.org.hibernate=info
> > > >
> > > > ### log HQL query parser activity
> > > > #log4j.logger.org.hibernate.hql.ast.AST=info
> > > >
> > > > ### log just the SQL
> > > > log4j.logger.org.hibernate.SQL=debug
> > > >
> > > > This seems to be logging what I expect.
> > > >
> > > > Andy
> > > >
> > > > On Mon, 2008-01-07 at 15:07 -0800, buckofive wrote:
> > > >
> > > >> Is no one else having issues logging 3rd party libraries?  I am unable 
> > > >> to get
> > > >> any hibernate or spring logs.  I have tried creating several different
> > > >> tapestry test projects using the 5.0.7 archetype but with I still get
> > > >> nothing.  They all seem to only log tapestry framework and "my pages" 
> > > >> logs.
> > > >> Could someone who has success logging hibernate post their 
> > > >> log4j.properties
> > > >> file? Please. Pretty Please ... with sugar on top.
> > > >>
> > > >> thanks,
> > > >> B
> > > >>
> > > >>
> > > >>
> > > >> buckofive wrote:
> > > >>
> > > >>> Hi all,
> > > >>>
> > > >>> I'm stuck at the moment trying to get log4j to log any 3rd party
> > > >>> libraries.  It seems to work fine for classes within my web project(ie
> > > >>> page classes etc.) and if I set the root level to debug I get what 
> > > >>> looks
> > > >>> like mostly  web container statements.  Any help would be much
> > > >>> appreciated.
> > > >>>
> > > >>> Here is a very basic version of my log4j.properties file:
> > > >>>
> > > >>> [code]
> > > >>> log4j.rootCategory=WARN, A1
> > > >>>
> > > >>> # A1 is set to be a ConsoleAppender.
> > > >>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> > > >>>
> > > >>> # A1 uses PatternLayout.
> > > >>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > > >>> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
> > > >>>
> > > >>> log4j.category.org.apache.tapestry.TapestryFilter=info
> > > >>> log4j.category.org.apache.tapestry=error
> > > >>> log4j.category.tapestry=error
> > > >>>
> > > >>> log4j.category.com.jpa=error
> > > >>>
> > > >>> # Service category names are the name of the defining module class
> > > >>> # and then the service id.
> > > >>> log4j.catego

Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread Daniel Jue
I like to make mine static in the non-tapestry pages:

private static Logger logger = Logger.getLogger(DAOUtil.class);

Perhaps this is a good time to learn how I can use Tapestry IOC for
the non Tapestry portion of my web app?
That would be pretty cool.

Here is an excerpt from my log4j.properties.  I am just assuming slf4j
uses log4j.properties as well.

log4j.rootCategory=debug, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n

#log4j.category.org.apache.tapestry.TapestryFilter=debug
#log4j.category.org.apache.tapestry=error
#log4j.category.tapestry=error
org.acegisecurity=debug
log4j.category.com.mycompany.myapp=debug
log4j.category.com.mycompany.myapp.wui.tapestry.components.layout.recognizer=info
log4j.category.org.apache.tapestry=error
log4j.category.com.mycompany.myapp.wui.general.OldMenu=error
log4j.category.com.mycompany.myapp.wui.general.TreeMenu=error
log4j.logger.org.acegisecurity=DEBUG
#log4j.category.app=error
#log4j.category.app.TimingFilter=debug

# Turning on debug mode for a page or component will show all of the
code changes that occur when the
# class is loaded.  Turning on debug mode for a page will enable
verbose output about rendering
# the page (and its components).
# log4j.category.org.example.myapp.pages.Start=debug

### Hibernate logging options ###
log4j.logger.net.sf.hibernate=debug
### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=debug
### log PreparedStatement cache activity ###
log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=debug








On Jan 8, 2008 3:38 AM, Davor Hrg <[EMAIL PROTECTED]> wrote:
> for tapestry services just define "Logger logger" as constructor parameter..
>
>
> Davor Hrg
>
>
> On Jan 8, 2008 9:22 AM, Steph <[EMAIL PROTECTED]> wrote:
> > How do you get your logger in your code ?
> > The injection
> > @Inject
> > private Logger log;
> > is only useable in Tapestry pages, components, ...
> > It will log nothing in your other classes managed by Spring, Hibernate, ...
> > Outside of Tapestry, you should use something like the line below to use
> > slf4j :
> > private final Logger log = LoggerFactory.getLogger(YourClass.class);
> >
> > Stephane
> >
> > Andy Huhn a écrit :
> >
> > > Hi Buckofive,
> > >
> > > Here are a couple of relevant lines from my log4j.properties file.  My
> > > file is in src/main/resources:
> > >
> > > log4j.logger.org.hibernate=info
> > >
> > > ### log HQL query parser activity
> > > #log4j.logger.org.hibernate.hql.ast.AST=info
> > >
> > > ### log just the SQL
> > > log4j.logger.org.hibernate.SQL=debug
> > >
> > > This seems to be logging what I expect.
> > >
> > > Andy
> > >
> > > On Mon, 2008-01-07 at 15:07 -0800, buckofive wrote:
> > >
> > >> Is no one else having issues logging 3rd party libraries?  I am unable 
> > >> to get
> > >> any hibernate or spring logs.  I have tried creating several different
> > >> tapestry test projects using the 5.0.7 archetype but with I still get
> > >> nothing.  They all seem to only log tapestry framework and "my pages" 
> > >> logs.
> > >> Could someone who has success logging hibernate post their 
> > >> log4j.properties
> > >> file? Please. Pretty Please ... with sugar on top.
> > >>
> > >> thanks,
> > >> B
> > >>
> > >>
> > >>
> > >> buckofive wrote:
> > >>
> > >>> Hi all,
> > >>>
> > >>> I'm stuck at the moment trying to get log4j to log any 3rd party
> > >>> libraries.  It seems to work fine for classes within my web project(ie
> > >>> page classes etc.) and if I set the root level to debug I get what looks
> > >>> like mostly  web container statements.  Any help would be much
> > >>> appreciated.
> > >>>
> > >>> Here is a very basic version of my log4j.properties file:
> > >>>
> > >>> [code]
> > >>> log4j.rootCategory=WARN, A1
> > >>>
> > >>> # A1 is set to be a ConsoleAppender.
> > >>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> > >>>
> > >>> # A1 uses PatternLayout.
> > >>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > >>> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
> > >>>
> > >>> log4j.category.org.apache.tapestry.TapestryFilter=info
> > >>> log4j.category.org.apache.tapestry=error
> > >>> log4j.category.tapestry=error
> > >>>
> > >>> log4j.category.com.jpa=error
> > >>>
> > >>> # Service category names are the name of the defining module class
> > >>> # and then the service id.
> > >>> log4j.category.com.jpa.services.AppModule.TimingFilter=info
> > >>>
> > >>> log4j.category.org.hibernate=debug
> > >>>
> > >>> [/code]
> > >>>
> > >>>
> > >>> Whats weird is these settings works fine in a non-tapestry application. 
> > >>>  I
> > >>> created my project with the tapestry 5.0.7 archetype and my file is
> > >>> located in \src\main\resources\log4j.properties.  Am I missing
> > >>> something or doing something wrong?
> > >>>
> >

Re: PrivateAsset example please

2008-01-08 Thread Andreas Andreou
Hi, those Assets implementations are easier to create through the
AssetFactory services...

For instance, there's a ClasspathAssetFactory, so perhaps use its
IAsset createAbsoluteAsset(String path, Locale locale, Location location)

http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ClasspathAssetFactory.html


On Jan 8, 2008 5:46 PM,  <[EMAIL PROTECTED]> wrote:
> PrivateAsset takes the following parameters:
>
> Resource resourceLocation, IEngineService assetService, Location location
>
> The images are in another directory on a different diskthe directory is 
> on the classpath...so the image should be in:
>
> someimages/picture.jpg
>
> How do I create a resourcelocation, how do I get the assetService and how the 
> location?
>
> Thanks!
>
>
>
>  Original-Nachricht 
> > Datum: Tue, 08 Jan 2008 16:24:41 +0100
> > Von: [EMAIL PROTECTED]
>
> > An: "Tapestry users" 
> > Betreff: Re: PrivateAsset example please
>
> > Thanks. There are no exmaples on these pages though.
> >
> > public IAsset getScreenshot(String name){
> >
> >   return new 
> > ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> >
> > I have tried this also:
> >
> > So if I used PrivateAsset what do the paramters look like?
> >
> > Just a short example would be cool
> >
> >
> >
> >  Original-Nachricht 
> > > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > > An: "Tapestry users" 
> > > Betreff: Re: PrivateAsset example please
> >
> > > it's auto-used when it's a classpath asset...
> > > see
> > > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > > and
> > > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > > (InjectAsset)
> > >
> > > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > > I wonder who this works:
> > > >
> > > >
> > >
> > http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > > >
> > > > How do I use the PrivateAsset component?
> > > >
> > > > -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > > Tapestry / Tacos developer
> > > Open Source / JEE Consulting
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Re: PrivateAsset example please

2008-01-08 Thread munich
PrivateAsset takes the following parameters:

Resource resourceLocation, IEngineService assetService, Location location

The images are in another directory on a different diskthe directory is on 
the classpath...so the image should be in:

someimages/picture.jpg

How do I create a resourcelocation, how do I get the assetService and how the 
location?

Thanks!



 Original-Nachricht 
> Datum: Tue, 08 Jan 2008 16:24:41 +0100
> Von: [EMAIL PROTECTED]
> An: "Tapestry users" 
> Betreff: Re: PrivateAsset example please

> Thanks. There are no exmaples on these pages though.
> 
> public IAsset getScreenshot(String name){
>   
>   return new 
> ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);
> 
> I have tried this also:
> 
> So if I used PrivateAsset what do the paramters look like?
> 
> Just a short example would be cool
> 
> 
> 
>  Original-Nachricht 
> > Datum: Tue, 8 Jan 2008 14:36:51 +0200
> > Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> > An: "Tapestry users" 
> > Betreff: Re: PrivateAsset example please
> 
> > it's auto-used when it's a classpath asset...
> > see
> > http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> > and
> > http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> > (InjectAsset)
> > 
> > On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > > I wonder who this works:
> > >
> > >
> >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> > >
> > > How do I use the PrivateAsset component?
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > 
> > 
> > 
> > -- 
> > Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> > Tapestry / Tacos developer
> > Open Source / JEE Consulting
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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



T5 javascript form submit toolbar

2008-01-08 Thread riccaruf

Hi everybody!

I have a simple question (hope) about T5 and I don't know what I'm doing
wrong :-(
I'm trying to build a sort of command toolbar for my application in a
component that
all pages of the application have to add to theirself.

This toolbar let the user submit with different logical event handler method
the page form, 
passing a parameter to retrieve which button has been pressed by the user. 

In short I've got something like that

function submitForm(formName)
{   var d = $(formName);
d.submit();
}

in the toolbar component(button.tml) I've got something like 

!a t:type="actionlink" t:id="appbuton" onclick="submitForm('${formId}');" />

button.java retrieve the value for formId and buttonImg formId='formTest' in
the example

In sample.tml a form like that



 

 


 

and in sample.java the event handler method

@InjectPage(value="sampletest")
private Object sampleTest;

@OnEvent(component="testForm",value="submit")
private Object onSubmit(){
logger.info("### on submit return page ...");
return sampleTest;
}

Naturally I've already tried to submit using its button and everything works
fine,
and T5 create the redirect url to my sampleTest page so the browser can send
its render request
for that page.
Otherwise using the button link of the toolbar I've noticed that the submit
event was fired
but after a redirection to the same page(???) so it seems there are two
different events,
a event handler with return value void (redirect to the same page

Have you got any ideas?Any suggestion for a different approach? I've read
the interesting post
on using an Ajax request to transfer data, but I'd like to understand why T5
do that...and I don't find
anything else about something similar :(

Thanks in advance.

-Rick.
-- 
View this message in context: 
http://www.nabble.com/T5-javascript-form-submit-toolbar-tp14692144p14692144.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: PrivateAsset example please

2008-01-08 Thread munich
Thanks. There are no exmaples on these pages though.

public IAsset getScreenshot(String name){

return new 
ExternalAsset("thumbs/".concat(name).concat(".JPG"), null);

I have tried this also:

So if I used PrivateAsset what do the paramters look like?

Just a short example would be cool



 Original-Nachricht 
> Datum: Tue, 8 Jan 2008 14:36:51 +0200
> Von: "Andreas Andreou" <[EMAIL PROTECTED]>
> An: "Tapestry users" 
> Betreff: Re: PrivateAsset example please

> it's auto-used when it's a classpath asset...
> see
> http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
> and
> http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
> (InjectAsset)
> 
> On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> > I wonder who this works:
> >
> >
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
> >
> > How do I use the PrivateAsset component?
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> 
> -- 
> Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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



Re: PrivateAsset example please

2008-01-08 Thread Andreas Andreou
it's auto-used when it's a classpath asset...
see
http://tapestry.apache.org/tapestry4.1/usersguide/spec.html#spec.asset
and
http://tapestry.apache.org/tapestry4.1/tapestry-annotations/index.html
(InjectAsset)

On Jan 8, 2008 2:02 PM,  <[EMAIL PROTECTED]> wrote:
> I wonder who this works:
>
> http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html
>
> How do I use the PrivateAsset component?
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Grid component with checkboxes (updateable) in one of the columns

2008-01-08 Thread Mahen Perera
Hi all,

 

I need to have a Grid component where one of the columns have
checkboxes. I know I can use  to display the checkboxes,,,
but then  I need to know which of the checkboxes are selected when the
form is submitted. Is this doable using tapestry 5?

 

Thanks in advance for any help

 

The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone (+44 (0)20 7896 0011) and then delete the email and any 
copies of it. Opinions, conclusions (etc.) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it. IG Index plc is a company registered in England and Wales under number 
01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 
157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the 
Financial Services Authority. FSA Register number 114059.


T5: Multiple clicks causing NPE

2008-01-08 Thread Geoff Callender
While trying to demonstrate the dangers of multiple submits, I found  
Tapestry throwing NullPointerException.


Can someone who understands Tapestry's internals shed some light on  
this?


To make the test possible, I emulated a slow operation by sleeping 2  
seconds.  The NPE then occurred on the 3rd or later click - it varied  
quite a bit.  Here's how I emulated the slow operation...


@ApplicationState
private MyOrder _myOrder;

Object onSuccess() {
sleep(2000); // Sleep 2 seconds to simulate slow transaction

int newQuantity = _myOrder.getQuantity() + 1;
_myOrder.setQuantity(newQuantity);

return _page2;
}

private void sleep(long duration) {
try {
Thread.sleep(duration);
}
catch (InterruptedException e) {
}
}

Here's the exception...

22:45:53,443 ERROR [RequestExceptionHandler] Processing of request  
failed with uncaught exception: java.lang.NullPointerException

java.lang.NullPointerException
	at org.apache.tapestry.internal.services.InternalModule 
$2.getCookies(InternalModule.java:307)

at $CookieSource_11759363dd0.getCookies($CookieSource_11759363dd0.java)
	at  
org 
.apache 
.tapestry 
.internal.services.CookiesImpl.readCookieValue(CookiesImpl.java:53)

at $Cookies_11759363dcf.readCookieValue($Cookies_11759363dcf.java)
	at  
org 
.apache 
.tapestry 
.services 
.PersistentLocaleImpl.getCookieValue(PersistentLocaleImpl.java:46)
	at  
org 
.apache 
.tapestry.services.PersistentLocaleImpl.get(PersistentLocaleImpl.java: 
40)
	at  
$PersistentLocale_11759363dce.get($PersistentLocale_11759363dce.java)
	at  
org 
.apache 
.tapestry 
.internal 
.services 
.LocalizationSetterImpl.setThreadLocale(LocalizationSetterImpl.java:98)
	at  
$ 
LocalizationSetter_11759363dcb 
.setThreadLocale($LocalizationSetter_11759363dcb.java)
	at  
org 
.apache 
.tapestry 
.internal.services.LocalizationFilter.service(LocalizationFilter.java: 
41)
	at  
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
	at org.apache.tapestry.services.TapestryModule 
$2.service(TapestryModule.java:688)
	at  
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
	at  
org 
.apache 
.tapestry 
.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:84)
	at  
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
	at org.apache.tapestry.internal.services.CheckForUpdatesFilter 
$2.invoke(CheckForUpdatesFilter.java:97)
	at org.apache.tapestry.internal.services.CheckForUpdatesFilter 
$2.invoke(CheckForUpdatesFilter.java:88)
	at  
org 
.apache 
.tapestry 
.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
	at  
org 
.apache 
.tapestry 
.internal 
.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:110)
	at  
$RequestHandler_11759363dcd.service($RequestHandler_11759363dcd.java)
	at  
$RequestHandler_11759363dc6.service($RequestHandler_11759363dc6.java)
	at org.apache.tapestry.services.TapestryModule 
$12.service(TapestryModule.java:1086)
	at  
$ 
HttpServletRequestHandler_11759363dc5 
.service($HttpServletRequestHandler_11759363dc5.java)

at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:135)
	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
235)
	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at  
org 
.jboss 
.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java: 
96)
	at  
org 
.apache 
.catalina 
.core 
.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 
235)
	at  
org 
.apache 
.catalina 
.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at  
org 
.apache 
.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 
230)
	at  
org 
.apache 
.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 
175)
	at  
org 
.jboss 
.web 
.tomcat 
.security 
.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
	at  
org 
.jboss 
.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at  
org 
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
127)
	at  
org 
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 
102)
	at  
org 
.jboss 
.web 
.tomcat 
.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java: 
157)
	at  
org 
.apache 
.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at  
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
262)
	at  
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
844)
	at org.apache.coyote.http11.Http11Protocol 
$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 
446)

   

PrivateAsset example please

2008-01-08 Thread munich
I wonder who this works:

http://tapestry.apache.org/tapestry4.1/tapestry-framework/apidocs/org/apache/tapestry/asset/PrivateAsset.html

How do I use the PrivateAsset component?

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



Re: How to use images outside webroot

2008-01-08 Thread munich
But how do you avoid that people can access those images
directly ? They should not be accessible through  a direct website url
as there is a permission check before.

 Original-Nachricht 
> Datum: Thu, 20 Dec 2007 16:08:02 +0100
> Von: Sven Homburg <[EMAIL PROTECTED]>
> An: Tapestry users 
> Betreff: Re: How to use images outside webroot

> goto Project Settings
> and add a new "Web  Resource Directory"
> 
> 
> best regards
> S.Homburg
> 
> 
> 
> 
> [EMAIL PROTECTED] schrieb:
> > During development I would like to access/use images that are on a
> network drive (e.g. f:\images) as I dont have enough space on my harddisk.
> >
> > How can I tell Tapestry that it finds "localhost:8080/images/image.gif"
> > here "f:\images\image.gif"  ?
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >   
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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



Override Header Names for Grid Component

2008-01-08 Thread Peter Stavrinides

Hi

I have a simple grid component and I wish to override the grids header 
names with different names or even an image in some cases (or a 
combination of text and an image)


Is this possible using a  option?  something like this 
example that I am using for rendering a cell


   
   
Due Diligence
  



Thanks,
Peter



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



NON MANDATORY field should be validated as alphanumeric only if entered

2008-01-08 Thread mj123

I have two fields which are NOT MANDATORY but if entered its should be
vaidated as alphanumeric

how will i do this
if I use ValidField as the component type  it will display error if i don't
enter anything...
"You must enter a value for [SOME NAME]". 
which i don't want
but if I enter something it should be validated as alphanumeric 
-- 
View this message in context: 
http://www.nabble.com/NON-MANDATORY-field-should-be-validated-as-alphanumeric-only-if-entered-tp14686366p14686366.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5 How to bypass TapestryFilter?

2008-01-08 Thread Dapeng

yet ... want to implement some access control

say only valid login user should be able to view the images, pdfs

non-login user should be redirected to loginpage




Here is my current solution

i registered a new Filter and checks the Session of the request,

i am storing User as an ASO once login

so i check against the URL (begins with "/private") and the Session for 
the ASO key (figure out it is something like aso:my.package.User)


if the key is not found then i redirect the response to my login page



sample codes


// PrivateResourceFilter.java
///

   public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain)
   throws IOException, ServletException {

   HttpServletRequest httprequest = (HttpServletRequest) request;

   if (httprequest.getServletPath().startsWith("/private")) {
   HttpSession session = httprequest.getSession(false);
  
   if(session == null || 
session.getAttribute("aso:"+User.class.getName())== null){


   HttpServletResponse httpresponse = 
(HttpServletResponse)response;
   
httpresponse.sendRedirect(httprequest.getContextPath()+"/login");
  
   return;

   }
   }
  
   chain.doFilter(request, response);

   }



/
// web.xml

   
   app
   org.apache.tapestry.TapestryFilter
   
  


   
   PrivateResourceFilter
   
com.mine.train.webfilters.PrivateResourceFilter

   
   
   PrivateResourceFilter
   /*
   

  
   

   app
   /*
   







it works but ... any better solutions ???




Dapeng wrote:
Ye ... have to say my mistake ... i juz took the design mockup from my 
designer and FIND-AND-REPLACE the dummy links


turns out there is a typo in the links ...

:<



Sorry



Fernando Padilla wrote:

That is really weird because the TapestryFilter is supposed to check to
see if there is a resource in the file system that matches the url
first, before trying to interpret it.  If that functionality is really
truly broken, then a bug should be filed, and tapestry fixed.

So the first question, are the url correct and pointing to the real
files in the filesystem?


Davor Hrg wrote:
 

there are few ways..
one is to extend tapestryFilter and use that version in web.xml

Davor Hrg

On Jan 7, 2008 6:21 AM, Dapeng <[EMAIL PROTECTED]> wrote:
   

Hi guys

I have a protected folder /private under the root

but inside the folder i am only going to serve static contents like
images and pdf





but when i try to access the resource



/myApp/private/images/1.jpg


i got an exception saying there is no such page


Unable to resolve 'private/images/1' to a known page name.





how to bypass the TapestryFilter?


juz let the tomcat handle the request as per normal ???


thx

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


  

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




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

  



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




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



Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread Davor Hrg
for tapestry services just define "Logger logger" as constructor parameter..


Davor Hrg

On Jan 8, 2008 9:22 AM, Steph <[EMAIL PROTECTED]> wrote:
> How do you get your logger in your code ?
> The injection
> @Inject
> private Logger log;
> is only useable in Tapestry pages, components, ...
> It will log nothing in your other classes managed by Spring, Hibernate, ...
> Outside of Tapestry, you should use something like the line below to use
> slf4j :
> private final Logger log = LoggerFactory.getLogger(YourClass.class);
>
> Stephane
>
> Andy Huhn a écrit :
>
> > Hi Buckofive,
> >
> > Here are a couple of relevant lines from my log4j.properties file.  My
> > file is in src/main/resources:
> >
> > log4j.logger.org.hibernate=info
> >
> > ### log HQL query parser activity
> > #log4j.logger.org.hibernate.hql.ast.AST=info
> >
> > ### log just the SQL
> > log4j.logger.org.hibernate.SQL=debug
> >
> > This seems to be logging what I expect.
> >
> > Andy
> >
> > On Mon, 2008-01-07 at 15:07 -0800, buckofive wrote:
> >
> >> Is no one else having issues logging 3rd party libraries?  I am unable to 
> >> get
> >> any hibernate or spring logs.  I have tried creating several different
> >> tapestry test projects using the 5.0.7 archetype but with I still get
> >> nothing.  They all seem to only log tapestry framework and "my pages" logs.
> >> Could someone who has success logging hibernate post their log4j.properties
> >> file? Please. Pretty Please ... with sugar on top.
> >>
> >> thanks,
> >> B
> >>
> >>
> >>
> >> buckofive wrote:
> >>
> >>> Hi all,
> >>>
> >>> I'm stuck at the moment trying to get log4j to log any 3rd party
> >>> libraries.  It seems to work fine for classes within my web project(ie
> >>> page classes etc.) and if I set the root level to debug I get what looks
> >>> like mostly  web container statements.  Any help would be much
> >>> appreciated.
> >>>
> >>> Here is a very basic version of my log4j.properties file:
> >>>
> >>> [code]
> >>> log4j.rootCategory=WARN, A1
> >>>
> >>> # A1 is set to be a ConsoleAppender.
> >>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >>>
> >>> # A1 uses PatternLayout.
> >>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> >>> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
> >>>
> >>> log4j.category.org.apache.tapestry.TapestryFilter=info
> >>> log4j.category.org.apache.tapestry=error
> >>> log4j.category.tapestry=error
> >>>
> >>> log4j.category.com.jpa=error
> >>>
> >>> # Service category names are the name of the defining module class
> >>> # and then the service id.
> >>> log4j.category.com.jpa.services.AppModule.TimingFilter=info
> >>>
> >>> log4j.category.org.hibernate=debug
> >>>
> >>> [/code]
> >>>
> >>>
> >>> Whats weird is these settings works fine in a non-tapestry application.  I
> >>> created my project with the tapestry 5.0.7 archetype and my file is
> >>> located in \src\main\resources\log4j.properties.  Am I missing
> >>> something or doing something wrong?
> >>>
> >>> thanks in advance,
> >>> B
> >>>
> >>>
> >>>
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

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



Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread Steph
How do you get your logger in your code ?
The injection
@Inject
private Logger log;
is only useable in Tapestry pages, components, ...
It will log nothing in your other classes managed by Spring, Hibernate, ...
Outside of Tapestry, you should use something like the line below to use
slf4j :
private final Logger log = LoggerFactory.getLogger(YourClass.class);

Stephane

Andy Huhn a écrit :
> Hi Buckofive,
>
> Here are a couple of relevant lines from my log4j.properties file.  My
> file is in src/main/resources:
>
> log4j.logger.org.hibernate=info
>
> ### log HQL query parser activity
> #log4j.logger.org.hibernate.hql.ast.AST=info
>
> ### log just the SQL
> log4j.logger.org.hibernate.SQL=debug
>
> This seems to be logging what I expect.
>
> Andy
>
> On Mon, 2008-01-07 at 15:07 -0800, buckofive wrote:
>   
>> Is no one else having issues logging 3rd party libraries?  I am unable to get
>> any hibernate or spring logs.  I have tried creating several different
>> tapestry test projects using the 5.0.7 archetype but with I still get
>> nothing.  They all seem to only log tapestry framework and "my pages" logs. 
>> Could someone who has success logging hibernate post their log4j.properties
>> file? Please. Pretty Please ... with sugar on top.
>>
>> thanks,
>> B
>>
>>
>>
>> buckofive wrote:
>> 
>>> Hi all,
>>>
>>> I'm stuck at the moment trying to get log4j to log any 3rd party
>>> libraries.  It seems to work fine for classes within my web project(ie
>>> page classes etc.) and if I set the root level to debug I get what looks
>>> like mostly  web container statements.  Any help would be much
>>> appreciated.  
>>>
>>> Here is a very basic version of my log4j.properties file:
>>>
>>> [code]
>>> log4j.rootCategory=WARN, A1
>>>
>>> # A1 is set to be a ConsoleAppender. 
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> # A1 uses PatternLayout.
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
>>>
>>> log4j.category.org.apache.tapestry.TapestryFilter=info
>>> log4j.category.org.apache.tapestry=error
>>> log4j.category.tapestry=error
>>>
>>> log4j.category.com.jpa=error
>>>
>>> # Service category names are the name of the defining module class
>>> # and then the service id.
>>> log4j.category.com.jpa.services.AppModule.TimingFilter=info
>>>
>>> log4j.category.org.hibernate=debug
>>>
>>> [/code]
>>>
>>>
>>> Whats weird is these settings works fine in a non-tapestry application.  I
>>> created my project with the tapestry 5.0.7 archetype and my file is
>>> located in \src\main\resources\log4j.properties.  Am I missing
>>> something or doing something wrong?
>>>
>>> thanks in advance,
>>> B
>>>
>>>
>>>   
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>   


Re: T5 How to bypass TapestryFilter?

2008-01-08 Thread Dapeng
Ye ... have to say my mistake ... i juz took the design mockup from my 
designer and FIND-AND-REPLACE the dummy links


turns out there is a typo in the links ...

:<



Sorry



Fernando Padilla wrote:

That is really weird because the TapestryFilter is supposed to check to
see if there is a resource in the file system that matches the url
first, before trying to interpret it.  If that functionality is really
truly broken, then a bug should be filed, and tapestry fixed.

So the first question, are the url correct and pointing to the real
files in the filesystem?


Davor Hrg wrote:
  

there are few ways..
one is to extend tapestryFilter and use that version in web.xml

Davor Hrg

On Jan 7, 2008 6:21 AM, Dapeng <[EMAIL PROTECTED]> wrote:


Hi guys

I have a protected folder /private under the root

but inside the folder i am only going to serve static contents like
images and pdf





but when i try to access the resource



/myApp/private/images/1.jpg


i got an exception saying there is no such page


Unable to resolve 'private/images/1' to a known page name.





how to bypass the TapestryFilter?


juz let the tomcat handle the request as per normal ???


thx

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


  

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




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

  



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