You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonny Wray <jo...@yahoo.com> on 2004/02/23 21:08:46 UTC

Multiple tapestry apps under one web app/context

Hi,

It's looking like the best organization for my current application is
going to be multiple tapestry applications under one web context. We
need one central entry point but the individual applications are more
or less independent. I have a couple of questions/requests for advice.

i) How do people who do this organize their web application directory
structure. It seems the standard way would result in no seperation
between the tapestry applications.

ii) I may need to implement something along the lines of single sign
on. ie if the user logs in to one tapestry application they shouldn't
have to log in again to another, until their session times out. This
should be implementable as all the tapestry apps are running under the
same web app, and hence http session. However, this would mean
something along the lines of a shared (between tapestry apps) visit
object. Anything like this exisit?

thanks for any help/suggestions,

Jonny

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example still does not compile :-(

Posted by ea...@gmx.de.
Hello!

I managed to compile it with eclipse. Ant runs though without any error
messages, but when I go to the url localhost:8081:petshop I get the following:


HTTP ERROR: 500 Could not load class org.apache.tapestry.pets.PetshopEngine
from
org.mortbay.http.ContextLoader(file:/C:/DOKUME~1/root/LOKALE~1/Temp/Jetty__8081__petshop/lib/Jetty-60937.jar) /
sun.misc.Launcher$AppClassLoader@e80a59: org/apache/tapestry/pets/PetshopEngine (wrong name:
src/org/apache/tapestry/pets/PetshopEngine)
RequestURI=/petshop/app


Any ideas?

Thanks!

> I included j2ee.jar now in the classpath and I get the following errors:
> 
> C:\java\tapestry\petshop\petshop>ant run
> Buildfile: build.xml
> 
> run:
> 
> start-mckoidb:
>    [delete] Deleting directory C:\java\tapestry\petshop\petshop\mckoidb
> 
> compile:
>     [javac] Compiling 94 source files to
> C:\java\tapestry\petshop\petshop\build\
> classes
>     [javac]
> C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
> tation\pages\EditAccountPage.java:86: cannot resolve symbol
>     [javac] symbol  : constructor Locale  (java.lang.String)
>     [javac] location: class java.util.Locale
>     [javac]                                     getEngine().setLocale(new
> Locale
> (newCustomer.getProfile().getLangPref()));
>     [javac]                                                              
> ^
>     [javac]
> C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
> tation\pages\OrderProcessPage.java:22: cannot resolve symbol
>     [javac] symbol  : constructor Locale  (java.lang.String)
>     [javac] location: class java.util.Locale
>     [javac]                    
> setCurrencyFormat(NumberFormat.getCurrencyInstan
> ce((new Locale(getUserLanguage()))));
>     [javac]
>         ^
>     [javac]
> C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
> tation\pages\SignInPage.java:45: cannot resolve symbol
>     [javac] symbol  : constructor Locale  (java.lang.String)
>     [javac] location: class java.util.Locale
>     [javac]             engine.setLocale(new
> Locale(customer.getProfile().getLan
> gPref()));
>     [javac]                                  ^
>     [javac]
> C:\java\tapestry\petshop\petshop\src\pt\waveweb\core\AplicationExcep
> tion.java:7: cannot resolve symbol
> 
> > AFAIK javax.sql.Datasource is part of the j2ee.jar that comes with the 
> > j2sdkee distro. When you compile apps for application servers op web 
> > containers you generally need to add it to your classpath.
> > 
> > David Moran wrote:
> > > I was able to download it and it ran 
> > > with no modifications. 
> > > 
> > > 
> > > 
> > > On Mon, 2004-02-23 at 18:00, easy-to-remember@gmx.de wrote:
> > > 
> > >>Hi there!
> > >>
> > >>I just downloaded the PetShop example from this location
> > >>here:
> > >>
> >
>
>>http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> > >>
> > >>I entered ant run but I still get error messages.
> > >>
> > >>Do you know how to correct the build.xml file in order to run
> properly?
> > >>
> > >>I guess some jars have not been included as well, eg.
> > javax.sql.DataSource
> > >>has not been found and I dont know which jar file this one should be.
> > >>
> > >>Or does anyone have a working version of the PetShop example?
> > >>
> > >>
> > >>Thanks!
> > >>
> > >>Toby
> > >>
> > >>
> > >>
> > >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >>
> > > 
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example still does not compile :-(

Posted by Jonny Wray <jo...@yahoo.com>.
This is pretty basic java stuff.

If you compare the APIs of Java 1.3 and 1.4 you will see that the
constructor for Locale(String) is only added in 1.4, as was Datasource.
Hence I assume you are trying to compile with a 1.3 SDK.

It looks like the example requires 1.4
Jonny

--- easy-to-remember@gmx.de wrote:
> I included j2ee.jar now in the classpath and I get the following
> errors:
> 
> C:\java\tapestry\petshop\petshop>ant run
> Buildfile: build.xml
> 
> run:
> 
> start-mckoidb:
>    [delete] Deleting directory
> C:\java\tapestry\petshop\petshop\mckoidb
> 
> compile:
>     [javac] Compiling 94 source files to
> C:\java\tapestry\petshop\petshop\build\
> classes
>     [javac]
> C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
> tation\pages\EditAccountPage.java:86: cannot resolve symbol
>     [javac] symbol  : constructor Locale  (java.lang.String)
>     [javac] location: class java.util.Locale
>     [javac]                                    
> getEngine().setLocale(new
> Locale
> (newCustomer.getProfile().getLangPref()));
>     [javac]                                                          
>     ^
>     [javac]
> C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
> tation\pages\OrderProcessPage.java:22: cannot resolve symbol
>     [javac] symbol  : constructor Locale  (java.lang.String)
>     [javac] location: class java.util.Locale
>     [javac]                    
> setCurrencyFormat(NumberFormat.getCurrencyInstan
> ce((new Locale(getUserLanguage()))));
>     [javac]
>         ^
>     [javac]
> C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
> tation\pages\SignInPage.java:45: cannot resolve symbol
>     [javac] symbol  : constructor Locale  (java.lang.String)
>     [javac] location: class java.util.Locale
>     [javac]             engine.setLocale(new
> Locale(customer.getProfile().getLan
> gPref()));
>     [javac]                                  ^
>     [javac]
> C:\java\tapestry\petshop\petshop\src\pt\waveweb\core\AplicationExcep
> tion.java:7: cannot resolve symbol
> 
> > AFAIK javax.sql.Datasource is part of the j2ee.jar that comes with
> the 
> > j2sdkee distro. When you compile apps for application servers op
> web 
> > containers you generally need to add it to your classpath.
> > 
> > David Moran wrote:
> > > I was able to download it and it ran 
> > > with no modifications. 
> > > 
> > > 
> > > 
> > > On Mon, 2004-02-23 at 18:00, easy-to-remember@gmx.de wrote:
> > > 
> > >>Hi there!
> > >>
> > >>I just downloaded the PetShop example from this location
> > >>here:
> > >>
> >
>
>>http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> > >>
> > >>I entered ant run but I still get error messages.
> > >>
> > >>Do you know how to correct the build.xml file in order to run
> properly?
> > >>
> > >>I guess some jars have not been included as well, eg.
> > javax.sql.DataSource
> > >>has not been found and I dont know which jar file this one should
> be.
> > >>
> > >>Or does anyone have a working version of the PetShop example?
> > >>
> > >>
> > >>Thanks!
> > >>
> > >>Toby
> > >>
> > >>
> > >>
> >
>
>>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > >>For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> > >>
> > > 
> > > 
> > > 
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> > > 
> > > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Petshop example still does not compile :-(

Posted by ea...@gmx.de.
I included j2ee.jar now in the classpath and I get the following errors:

C:\java\tapestry\petshop\petshop>ant run
Buildfile: build.xml

run:

start-mckoidb:
   [delete] Deleting directory C:\java\tapestry\petshop\petshop\mckoidb

compile:
    [javac] Compiling 94 source files to
C:\java\tapestry\petshop\petshop\build\
classes
    [javac]
C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
tation\pages\EditAccountPage.java:86: cannot resolve symbol
    [javac] symbol  : constructor Locale  (java.lang.String)
    [javac] location: class java.util.Locale
    [javac]                                     getEngine().setLocale(new
Locale
(newCustomer.getProfile().getLangPref()));
    [javac]                                                               ^
    [javac]
C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
tation\pages\OrderProcessPage.java:22: cannot resolve symbol
    [javac] symbol  : constructor Locale  (java.lang.String)
    [javac] location: class java.util.Locale
    [javac]                    
setCurrencyFormat(NumberFormat.getCurrencyInstan
ce((new Locale(getUserLanguage()))));
    [javac]
        ^
    [javac]
C:\java\tapestry\petshop\petshop\src\org\apache\tapestry\pets\presen
tation\pages\SignInPage.java:45: cannot resolve symbol
    [javac] symbol  : constructor Locale  (java.lang.String)
    [javac] location: class java.util.Locale
    [javac]             engine.setLocale(new
Locale(customer.getProfile().getLan
gPref()));
    [javac]                                  ^
    [javac]
C:\java\tapestry\petshop\petshop\src\pt\waveweb\core\AplicationExcep
tion.java:7: cannot resolve symbol

> AFAIK javax.sql.Datasource is part of the j2ee.jar that comes with the 
> j2sdkee distro. When you compile apps for application servers op web 
> containers you generally need to add it to your classpath.
> 
> David Moran wrote:
> > I was able to download it and it ran 
> > with no modifications. 
> > 
> > 
> > 
> > On Mon, 2004-02-23 at 18:00, easy-to-remember@gmx.de wrote:
> > 
> >>Hi there!
> >>
> >>I just downloaded the PetShop example from this location
> >>here:
> >>
>
>>http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> >>
> >>I entered ant run but I still get error messages.
> >>
> >>Do you know how to correct the build.xml file in order to run properly?
> >>
> >>I guess some jars have not been included as well, eg.
> javax.sql.DataSource
> >>has not been found and I dont know which jar file this one should be.
> >>
> >>Or does anyone have a working version of the PetShop example?
> >>
> >>
> >>Thanks!
> >>
> >>Toby
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example does not compile :-(

Posted by Serge Beaumont <se...@sogeti.nl>.
AFAIK javax.sql.Datasource is part of the j2ee.jar that comes with the 
j2sdkee distro. When you compile apps for application servers op web 
containers you generally need to add it to your classpath.

David Moran wrote:
> I was able to download it and it ran 
> with no modifications. 
> 
> 
> 
> On Mon, 2004-02-23 at 18:00, easy-to-remember@gmx.de wrote:
> 
>>Hi there!
>>
>>I just downloaded the PetShop example from this location
>>here:
>>
>>http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
>>
>>I entered ant run but I still get error messages.
>>
>>Do you know how to correct the build.xml file in order to run properly?
>>
>>I guess some jars have not been included as well, eg. javax.sql.DataSource
>>has not been found and I dont know which jar file this one should be.
>>
>>Or does anyone have a working version of the PetShop example?
>>
>>
>>Thanks!
>>
>>Toby
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple Forms in a Foreach with Submit components

Posted by "F. Da Costa" <da...@xs4all.nl>.
Jens Brehmen wrote:
> Thank you for the quick reply.
> To be honest I don't really see how a hidden component in the form might
> solve my problem. I'm not interested in any attributes of the containing
> page in the form, because the form shall be independant of the page in
> which it is embedded. My problem is that the wrong listener is invoked
> and therefore the wrong data is updated: If I click a button in the
> first form within the foreach-component, the listener of the last form
> is triggered. If I had a hidden component in the form, I would still get
> the wrong one. 
> 
Maybe you can try the following (i finally figured out how to use it):
- Put a ... onsubmit="return true;" ... attribute in your <form>
- Make sure you can reference the form, either by id (which i'm using) or name.
- Introduce a very small js:
function submitForm(frm) {
  if (frm.onsubmit()) {
   frm.submit();
  }
}
Place a <button> (or link) on the screen somewhere but beware *do not*
  place it *within* a form (any form) and put the following code in:
<button onClick="submitForm(document.getElementById('tbodyForm'));" > 
btnText </button>
This calls the form by id.

Whether this will solve your particular problem i don't know but it should 
solve the submission of the proper form.

Cheers,
Fermin DCG


> Kind Regards,
> 
> Jens
> 
> "Howard M. Lewis Ship" wrote:
> 
>>When you put a Form inside a Foreach, you have to remember that the full state of the page (such as
>>the property updated by the Foreach) will not be available to the Form unless you make use of a
>>Hidden component to encode it into the HTML <form>.
>>
>>I believe what is happening is that when the form submits, the value left behind in that instance
>>variable is being used ... that's the last value accessed by the Foreach.
>>
>>This indicates a problem in your application: you aren't clearing that property correctly before it
>>is returned to the page pool. If you added -Dorg.apache.tapestry.disable-caching=true to your
>>command line, you would probably see your application fail.
>>
>>The correct way to define properties on your page (or even in a component) is with the
>><property-specification> element in the page or component specification. This ensures a proper
>>cleanup.
>>
>>--
>>Howard M. Lewis Ship
>>Independent J2EE / Open-Source Java Consultant
>>Creator, Tapestry: Java Web Components
>>http://howardlewisship.com
>>
>>
>>>-----Original Message-----
>>>From: jb@FernUni-Hagen.de [mailto:jb@FernUni-Hagen.de] On
>>>Behalf Of Jens Brehmen
>>>Sent: Tuesday, February 24, 2004 10:14 AM
>>>To: Tapestry users
>>>Subject: Multiple Forms in a Foreach with Submit components
>>>
>>>
>>>Hi,
>>>
>>>I've a page with a form repeated in a foreach component. The forms
>>>supports different operations, therefore I use two
>>>Submit-Components in
>>>the form. Let's say the foreach iterates twice so I get a
>>>page with two
>>>forms. Now the following happens: No matter on which form I click a
>>>button, always the listener of the last form in the foreach
>>>is invoked.
>>>I guess the problem is in the generated HTML: The forms have different
>>>names, but the submit buttons have the same name in each
>>>form. How can I
>>>tell Tapestry to differentiate correct between the forms, for
>>>example by
>>>generating different name-attributes for the submit buttons in each
>>>form?
>>>
>>>Thanks,
>>>
>>>Jens
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Solved: Multiple Forms in a Foreach with Submit components

Posted by Jens Brehmen <je...@fernuni-hagen.de>.
I should have read the wonderful manual more carefully - a simple
<binding name="direct" expression="false"/>
in the component specification and it simply works as it should.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Multiple Forms in a Foreach with Submit components

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
There's some property on your page being set by the Foreach. This property is, in some way,
influencing the choice of listener for your Form.

Since the Foreach is outside of the Form, you need a different strategy to restore that property to
its render-time value, when the HTML form is submitted.  A Hidden component is the right way to do
that.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: jb@FernUni-Hagen.de [mailto:jb@FernUni-Hagen.de] On 
> Behalf Of Jens Brehmen
> Sent: Wednesday, February 25, 2004 2:31 AM
> To: Tapestry users
> Subject: Re: Multiple Forms in a Foreach with Submit components
> 
> 
> Thank you for the quick reply.
> To be honest I don't really see how a hidden component in the 
> form might
> solve my problem. I'm not interested in any attributes of the 
> containing
> page in the form, because the form shall be independant of the page in
> which it is embedded. My problem is that the wrong listener is invoked
> and therefore the wrong data is updated: If I click a button in the
> first form within the foreach-component, the listener of the last form
> is triggered. If I had a hidden component in the form, I 
> would still get
> the wrong one. 
> 
> Kind Regards,
> 
> Jens
> 
> "Howard M. Lewis Ship" wrote:
> > 
> > When you put a Form inside a Foreach, you have to remember 
> that the full state of the page (such as
> > the property updated by the Foreach) will not be available 
> to the Form unless you make use of a
> > Hidden component to encode it into the HTML <form>.
> > 
> > I believe what is happening is that when the form submits, 
> the value left behind in that instance
> > variable is being used ... that's the last value accessed 
> by the Foreach.
> > 
> > This indicates a problem in your application: you aren't 
> clearing that property correctly before it
> > is returned to the page pool. If you added 
> -Dorg.apache.tapestry.disable-caching=true to your
> > command line, you would probably see your application fail.
> > 
> > The correct way to define properties on your page (or even 
> in a component) is with the
> > <property-specification> element in the page or component 
> specification. This ensures a proper
> > cleanup.
> > 
> > --
> > Howard M. Lewis Ship
> > Independent J2EE / Open-Source Java Consultant
> > Creator, Tapestry: Java Web Components
> > http://howardlewisship.com
> > 
> > > -----Original Message-----
> > > From: jb@FernUni-Hagen.de [mailto:jb@FernUni-Hagen.de] On
> > > Behalf Of Jens Brehmen
> > > Sent: Tuesday, February 24, 2004 10:14 AM
> > > To: Tapestry users
> > > Subject: Multiple Forms in a Foreach with Submit components
> > >
> > >
> > > Hi,
> > >
> > > I've a page with a form repeated in a foreach component. The forms
> > > supports different operations, therefore I use two
> > > Submit-Components in
> > > the form. Let's say the foreach iterates twice so I get a
> > > page with two
> > > forms. Now the following happens: No matter on which form 
> I click a
> > > button, always the listener of the last form in the foreach
> > > is invoked.
> > > I guess the problem is in the generated HTML: The forms 
> have different
> > > names, but the submit buttons have the same name in each
> > > form. How can I
> > > tell Tapestry to differentiate correct between the forms, for
> > > example by
> > > generating different name-attributes for the submit 
> buttons in each
> > > form?
> > >
> > > Thanks,
> > >
> > > Jens
> > >
> > > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: 
> tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> > >
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple Forms in a Foreach with Submit components

Posted by Jens Brehmen <je...@fernuni-hagen.de>.
Thank you for the quick reply.
To be honest I don't really see how a hidden component in the form might
solve my problem. I'm not interested in any attributes of the containing
page in the form, because the form shall be independant of the page in
which it is embedded. My problem is that the wrong listener is invoked
and therefore the wrong data is updated: If I click a button in the
first form within the foreach-component, the listener of the last form
is triggered. If I had a hidden component in the form, I would still get
the wrong one. 

Kind Regards,

Jens

"Howard M. Lewis Ship" wrote:
> 
> When you put a Form inside a Foreach, you have to remember that the full state of the page (such as
> the property updated by the Foreach) will not be available to the Form unless you make use of a
> Hidden component to encode it into the HTML <form>.
> 
> I believe what is happening is that when the form submits, the value left behind in that instance
> variable is being used ... that's the last value accessed by the Foreach.
> 
> This indicates a problem in your application: you aren't clearing that property correctly before it
> is returned to the page pool. If you added -Dorg.apache.tapestry.disable-caching=true to your
> command line, you would probably see your application fail.
> 
> The correct way to define properties on your page (or even in a component) is with the
> <property-specification> element in the page or component specification. This ensures a proper
> cleanup.
> 
> --
> Howard M. Lewis Ship
> Independent J2EE / Open-Source Java Consultant
> Creator, Tapestry: Java Web Components
> http://howardlewisship.com
> 
> > -----Original Message-----
> > From: jb@FernUni-Hagen.de [mailto:jb@FernUni-Hagen.de] On
> > Behalf Of Jens Brehmen
> > Sent: Tuesday, February 24, 2004 10:14 AM
> > To: Tapestry users
> > Subject: Multiple Forms in a Foreach with Submit components
> >
> >
> > Hi,
> >
> > I've a page with a form repeated in a foreach component. The forms
> > supports different operations, therefore I use two
> > Submit-Components in
> > the form. Let's say the foreach iterates twice so I get a
> > page with two
> > forms. Now the following happens: No matter on which form I click a
> > button, always the listener of the last form in the foreach
> > is invoked.
> > I guess the problem is in the generated HTML: The forms have different
> > names, but the submit buttons have the same name in each
> > form. How can I
> > tell Tapestry to differentiate correct between the forms, for
> > example by
> > generating different name-attributes for the submit buttons in each
> > form?
> >
> > Thanks,
> >
> > Jens
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Multiple Forms in a Foreach with Submit components

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
When you put a Form inside a Foreach, you have to remember that the full state of the page (such as
the property updated by the Foreach) will not be available to the Form unless you make use of a
Hidden component to encode it into the HTML <form>.

I believe what is happening is that when the form submits, the value left behind in that instance
variable is being used ... that's the last value accessed by the Foreach.

This indicates a problem in your application: you aren't clearing that property correctly before it
is returned to the page pool. If you added -Dorg.apache.tapestry.disable-caching=true to your
command line, you would probably see your application fail.

The correct way to define properties on your page (or even in a component) is with the
<property-specification> element in the page or component specification. This ensures a proper
cleanup.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Tapestry: Java Web Components 
http://howardlewisship.com


> -----Original Message-----
> From: jb@FernUni-Hagen.de [mailto:jb@FernUni-Hagen.de] On 
> Behalf Of Jens Brehmen
> Sent: Tuesday, February 24, 2004 10:14 AM
> To: Tapestry users
> Subject: Multiple Forms in a Foreach with Submit components
> 
> 
> Hi,
> 
> I've a page with a form repeated in a foreach component. The forms
> supports different operations, therefore I use two 
> Submit-Components in
> the form. Let's say the foreach iterates twice so I get a 
> page with two
> forms. Now the following happens: No matter on which form I click a
> button, always the listener of the last form in the foreach 
> is invoked.
> I guess the problem is in the generated HTML: The forms have different
> names, but the submit buttons have the same name in each 
> form. How can I
> tell Tapestry to differentiate correct between the forms, for 
> example by
> generating different name-attributes for the submit buttons in each
> form?
> 
> Thanks,
> 
> Jens
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Multiple Forms in a Foreach with Submit components

Posted by Jens Brehmen <je...@fernuni-hagen.de>.
Hi,

I've a page with a form repeated in a foreach component. The forms
supports different operations, therefore I use two Submit-Components in
the form. Let's say the foreach iterates twice so I get a page with two
forms. Now the following happens: No matter on which form I click a
button, always the listener of the last form in the foreach is invoked.
I guess the problem is in the generated HTML: The forms have different
names, but the submit buttons have the same name in each form. How can I
tell Tapestry to differentiate correct between the forms, for example by
generating different name-attributes for the submit buttons in each
form?

Thanks,

Jens

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example does not compile :-(

Posted by David Moran <dm...@nc.rr.com>.
I was able to download it and it ran 
with no modifications. 



On Mon, 2004-02-23 at 18:00, easy-to-remember@gmx.de wrote:
> Hi there!
> 
> I just downloaded the PetShop example from this location
> here:
> 
> http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> 
> I entered ant run but I still get error messages.
> 
> Do you know how to correct the build.xml file in order to run properly?
> 
> I guess some jars have not been included as well, eg. javax.sql.DataSource
> has not been found and I dont know which jar file this one should be.
> 
> Or does anyone have a working version of the PetShop example?
> 
> 
> Thanks!
> 
> Toby
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example does not compile :-(

Posted by David Moran <dm...@nc.rr.com>.
On my system it is in ${J2SDK1.4.2_01_HOME}/jre/lib/rt.jar

On Tue, 2004-02-24 at 03:47, easy-to-remember@gmx.de wrote:
> It is a bit weird as it starts compiling....so the java classpath is ok. I
> also never had any problems compiling other stuff. Does anybody happen to know
> where this javax.sql.DataSource resides?
> 
> Thanks!
> 
> Toby
> 
> > 
> > Well, the fact that Datasource could not be found means there's
> > something wrong with your environment/classpath. That's part of the
> > standard java distribution, and shouldn't be in the petshop jar. 
> > 
> > --- easy-to-remember@gmx.de wrote:
> > > Hi there!
> > > 
> > > I just downloaded the PetShop example from this location
> > > here:
> > > 
> > >
> >
> http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> > > 
> > > I entered ant run but I still get error messages.
> > > 
> > > Do you know how to correct the build.xml file in order to run
> > > properly?
> > > 
> > > I guess some jars have not been included as well, eg.
> > > javax.sql.DataSource
> > > has not been found and I dont know which jar file this one should be.
> > > 
> > > Or does anyone have a working version of the PetShop example?
> > > 
> > > 
> > > Thanks!
> > > 
> > > Toby
> > > 
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tapestry-user-help@jakarta.apache.org
> > > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example does not compile :-(

Posted by ea...@gmx.de.
It is a bit weird as it starts compiling....so the java classpath is ok. I
also never had any problems compiling other stuff. Does anybody happen to know
where this javax.sql.DataSource resides?

Thanks!

Toby

> 
> Well, the fact that Datasource could not be found means there's
> something wrong with your environment/classpath. That's part of the
> standard java distribution, and shouldn't be in the petshop jar. 
> 
> --- easy-to-remember@gmx.de wrote:
> > Hi there!
> > 
> > I just downloaded the PetShop example from this location
> > here:
> > 
> >
>
http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> > 
> > I entered ant run but I still get error messages.
> > 
> > Do you know how to correct the build.xml file in order to run
> > properly?
> > 
> > I guess some jars have not been included as well, eg.
> > javax.sql.DataSource
> > has not been found and I dont know which jar file this one should be.
> > 
> > Or does anyone have a working version of the PetShop example?
> > 
> > 
> > Thanks!
> > 
> > Toby
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Petshop example does not compile :-(

Posted by Jonny Wray <jo...@yahoo.com>.
Well, the fact that Datasource could not be found means there's
something wrong with your environment/classpath. That's part of the
standard java distribution, and shouldn't be in the petshop jar. 

--- easy-to-remember@gmx.de wrote:
> Hi there!
> 
> I just downloaded the PetShop example from this location
> here:
> 
>
http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz
> 
> I entered ant run but I still get error messages.
> 
> Do you know how to correct the build.xml file in order to run
> properly?
> 
> I guess some jars have not been included as well, eg.
> javax.sql.DataSource
> has not been found and I dont know which jar file this one should be.
> 
> Or does anyone have a working version of the PetShop example?
> 
> 
> Thanks!
> 
> Toby
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Petshop example does not compile :-(

Posted by ea...@gmx.de.
Hi there!

I just downloaded the PetShop example from this location
here:

http://pwp.netcabo.pt/users/164/0229592601/tapestryapps/files/petshop-0.4.1.tar.gz

I entered ant run but I still get error messages.

Do you know how to correct the build.xml file in order to run properly?

I guess some jars have not been included as well, eg. javax.sql.DataSource
has not been found and I dont know which jar file this one should be.

Or does anyone have a working version of the PetShop example?


Thanks!

Toby



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple tapestry apps under one web app/context

Posted by Jonny Wray <jo...@yahoo.com>.
Erik and Kevin,

thanks for your suggestions and advice. I'm currently anticipating
what's going to be asked of this application (and hence me) next, and
weighing up the various options. So, my need is not immediate but your
advice helps a lot,

thanks again,
Jonnny 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple tapestry apps under one web app/context

Posted by "Kevin C. Dorff" <kd...@kcp.com>.
We actually do authentication via a completely seperate servlet that we 
have integrated into apache's authentication system. When authenticated 
there is a cookie that contains information. The server compares what is 
in the cookie vs. what should be in the cookie to verify authentication. 
What we are using is a derivitive of  mod_auth_tkt

   http://www.openfusion.com.au/labs/mod_auth_tkt/

the login page, creation of the cookie, etc. is done via a servlet we 
wrote. The apache side (which does the verification for every page 
reuqest) is a slightly modified version of the mod_auth_tkt apache 
module.  The, the applicatiction can gather the username, etc. from the 
cookie using an api we wrote. For tapestry user verification (just 
seeing who the known authenticated user is) is done in the pageValidate 
event. The application will never see a non-logged in user, 
apache/mod_auth_tkt module stops them before they get to the application.

This way we have a single sign on for all applications on the server. 
Some of our apps are tapesty, some are plain servlets, some are php, 
some are perl, etc.

Before you ask: No, I cannot share the code. Get mod_auth_tkt, that 
should get you most of the way toward a solution.

Kevin

Jonny Wray wrote:

>Hi,
>
>It's looking like the best organization for my current application is
>going to be multiple tapestry applications under one web context. We
>need one central entry point but the individual applications are more
>or less independent. I have a couple of questions/requests for advice.
>
>i) How do people who do this organize their web application directory
>structure. It seems the standard way would result in no seperation
>between the tapestry applications.
>
>ii) I may need to implement something along the lines of single sign
>on. ie if the user logs in to one tapestry application they shouldn't
>have to log in again to another, until their session times out. This
>should be implementable as all the tapestry apps are running under the
>same web app, and hence http session. However, this would mean
>something along the lines of a shared (between tapestry apps) visit
>object. Anything like this exisit?
>
>thanks for any help/suggestions,
>
>Jonny
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Multiple tapestry apps under one web app/context

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 23, 2004, at 3:08 PM, Jonny Wray wrote:
> It's looking like the best organization for my current application is
> going to be multiple tapestry applications under one web context. We
> need one central entry point but the individual applications are more
> or less independent. I have a couple of questions/requests for advice.

We are definitely playing outside the recommended path, but I'm doing 
this also.

> i) How do people who do this organize their web application directory
> structure. It seems the standard way would result in no seperation
> between the tapestry applications.

The nice thing is that things are shared a bit.  We share our Border 
component, for example, which makes the login page (from 
login.application) look like the other applications pages.

We separate pages into subdirectories under WEB-INF, and spell them all 
out individually in the .application file.  Less than ideal, but works 
to keep things separate and cleaner structurally.

> ii) I may need to implement something along the lines of single sign
> on. ie if the user logs in to one tapestry application they shouldn't
> have to log in again to another, until their session times out. This
> should be implementable as all the tapestry apps are running under the
> same web app, and hence http session. However, this would mean
> something along the lines of a shared (between tapestry apps) visit
> object. Anything like this exisit?

At this point it is not possible to share global or visit across 
applications.  Both make sense to be separate by application 
conceptually, but in practice it does make sense to share state across 
Tapestry applications.  At the moment, we've punted on this issue, but 
we will likely revisit it and implement some type of static type of 
thing to share true global stuff across all global's.  As for visit - 
I'm not sure how to deal with that in your scenario - but you could 
always tinker with the inner workings of Tapestry a little since it is 
pretty pluggable and change how visit is dealt with and make it common 
across a session not a .application.

Let us know what you come up with.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org