RE: urgent: access a spring bean from a service encoder?

2006-10-20 Thread Jeff Lubetkin
The important thing to keep in mind is that the "object" parameter to the 
"encoder" element is a hivemind reference, which means it can be a reference to 
another hivemind service, or to a spring service.
 

 
or
 


You can configure those beans in the usual way.  My guess at what you want is 
(using your example class names):
 

  

  
  
  

  





 
jeff



From: Josh Long [mailto:[EMAIL PROTECTED]
Sent: Fri 10/20/2006 7:27 PM
To: Tapestry users
Subject: urgent: access a spring bean from a service encoder?



Hi all,

What's the best way to get access to a spring bean setup using the standard
context from isnide a service encoder?

I have the following (well, something like it: obviously the names have been
changed to protect the innocent..)



Whcih doesn't yeild anything except  stack traces. What's the correct way to
do this?

Thanks in advance for any help,
Josh




Re: Duplicate id and updateComponents

2006-10-20 Thread Jesse Kuhnert

JIRA ?

On 10/20/06, Frank <[EMAIL PROTECTED]> wrote:


Hi,

Got a problem with duplicate id's :




When Tapestry render the HTML there are 2 id's in the code, and this gives
the async update a javascript error.

Regards
Frank





--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: want external link to cause cycle.forgetPage() behaviour

2006-10-20 Thread Jesse Kuhnert

https://issues.apache.org/jira/browse/TAPESTRY-1116

On 10/20/06, Sam Gendler <[EMAIL PROTECTED]> wrote:


I've got a CSS menu bar on my pages.  I want the links in the menu to
use ExternalLink so that they are bookmarkable. I can't have the link
submitting back to a listener method in my shell component, beacuse
then the URL is always one page behind the page I am actually looking
at, since the parameters in the URL will have the page name/component
name of the PREVIOUS page.

Many of the pages accessed via the menu have tables on them which are
derived from contrib:table, meaning that the state of the table pages
and sorted column are kept in the session.

When accessing a page via the menu, I always want the page to be in
its default state.  I only want the table state to be retained when
accessing the page via other links, never the menu.  I can't easily
just reset all the values in activateExternalPage because many of the
persistent properties are actually part of components nested several
levels deep within the page.  Calling cycle.forgetPage() would
ordinarily be enough to blow all the stored state about any component
in the page out of the session (I assume that's what it does, anyway).

So I tried adding a parameter to the service parameters that get
passed to activateExternalPage().  If I get a reset param, then I call
cycle.forgetPage(getPageName());  This mostly works - however, because
activateExternalPage is called AFTER the page is attached, it has
already been populated with values from the session, so after
activateExternalPage runs, the page displays with its stored state.
Then, if I hit reload, the page gets a new instance form the page
cache, and this time the session has been cleared of all data BEFORE
the page was attached, so now it displays in its default state.

So then I tried calling cycle.forgetPage() and then created an
ExternalCallback to the
current page, this time without the reset parameter, since the page
has already been reset. I then call performCallback on the callback,
to try to get an instance of the page to run which is populated after
the call to forgetPage().  In my logs, I can see activateExternalPage
getting called twice, but the second one still has the saved state.
The only way to get the reset to actually show up is to reload the
page - basically, it appears to require a new request cycle in order
to forget a page.

Is there some other way around this?

--sam

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





--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


urgent: access a spring bean from a service encoder?

2006-10-20 Thread Josh Long

Hi all,

What's the best way to get access to a spring bean setup using the standard
context from isnide a service encoder?

I have the following (well, something like it: obviously the names have been
changed to protect the innocent..)



Whcih doesn't yeild anything except  stack traces. What's the correct way to
do this?

Thanks in advance for any help,
Josh


Re: RE: RE: Recovery of session during pageValidate

2006-10-20 Thread Sam Gendler

Thanks Jeff.  Shawn, I assume your email response to me crossed paths
with Jeff's, but if not, I'd look pretty carefully at his solution.
It is a more heavyweight solution than I'm sure any of us want, but it
will definitely get the job done and doesn't look like it would be too
hard or time consuming to implement.

I'll probably do it myself when I get a chance.  If you like, I'll
post my code here when I'm done, but I can't say when that will be.

--sam

On 10/20/06, Jeff Lubetkin <[EMAIL PROTECTED]> wrote:

Specifically, we use a service that implements
org.apache.tapestry.services.WebRequestServicerFilter.  The only method
you need to implement is WebRequestServicerFilter.service, and the only
really important thing is to call servicer.service() to keep the chain
going.  See Tapestry's DisableCachingFilter for an example.

To hook up a filter in hivemodule.xml, you just need to instantiate the
service, then add it to the
"tapestry.request.WebRequestServicerPipeline" configuration point.
Example:













jeff

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam
Gendler
Sent: Friday, October 20, 2006 3:40 PM
To: Tapestry users
Subject: Re: RE: Recovery of session during pageValidate

Can you expound upon how you plug in the WebRequestFilter.
Constructing the WebRequest subclass looks simple enough, and the
Callback factory dosn't seem too tough, but injecting a web request
filter sounds like hivemind magic that I'm unaware of.

This seems like something we'd want to provide a more accessible
solution for in the core tapestry framework.  It is a fairly common
requirement of webapps.  Preserving the state of the current HTTP
request so that it can be restored in a callback later seems to me like
something that we'd want to make very easy.

--sam

On 10/20/06, Jeff Lubetkin <[EMAIL PROTECTED]> wrote:
> Not sure if this will help, but here's how we handle this (it's kinda
> complicated, but it works):
>
> * All of our callback generation for interstitial processes like login

> go through a Callback factory service.  In order to preserve URL
> integrity for bookmarking and the like, we use an ICallback
> implementation that sends a redirect to the browser.
> * When a callback needs to be generated for a POST, or a GET that is
> too long, the current request parameters (from
> HttpServletRequest.getParameterMap) are stored in session, along with
> a randomly-generated token. The parameters are stripped from the
> request and the token is added as a the "postToken" parameter
> ("www.zillow.com/foo?postToken=123").
> * We have a WebRequestFilter that handles "global" URL parameters that

> can appear on any request.  This custom URL handling code sees the
> "postToken" parameter and creates a wrapper WebRequest that returns
> the saved parameters from the getParameterNames, getParameterValue,
> and getParameterValues methods (passing the rest of the methods
> through to the wrapped WebRequest).  This causes the request to look
> just like it did before being sent off for authentication.
> Rewind/render happens just as expected.  The only difference is that
> (in the POST case) the method will be GET rather than POST in the
> callback, but that rarely matters.
>
> The code for this is in no state to share, but hopefully the idea
helps.
>
> jeff
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam
> Gendler
> Sent: Friday, October 20, 2006 2:15 PM
> To: Tapestry users
> Subject: Re: Recovery of session during pageValidate
>
> I can think of a couple of ways of doing this.  The way I do this is
> to use an ExternalCallback, store that in session, and after
> successful authentication, I just execute the callback.  However, this

> only works if you use ExternalLinks, and doesn't work at all if
> someone submits a form after being away from their computer for long
> enough to lose their session.
>
> Here's what would be really useful, but doens't actually work,
> currently:
>
> If you have their serviceParameters, you shouldn't need to put them
> back in a request via the URL of the age, I think.  You should just be

> able to do something like this in your listener after they've
> successfully
> authenticated:
>
> @Persist
> public abstract IPage getPreviousPage(); public abstract void
> setPreviousPage(IPage page)
>
> @Persist
> public abstract Object[] getStoredServiceParameters(); public abstract

> void setStoredServiceParameters(Object[] params);
>
> public void doSomething(IRequestCycle cycle) {
> // check auth here
>
> if (authSuccess) {
> cycle.setServiceParameters(getStoredServiceParameters());
> cycle.activate(getPreviousPage());
> return;
> }
> }
>
> Unfortunately, when a page is activated, it doesn't go through a
> rewind cycle, so even if the service parameters have all the right
> info (and I'

RE: RE: Recovery of session during pageValidate

2006-10-20 Thread Jeff Lubetkin
Specifically, we use a service that implements
org.apache.tapestry.services.WebRequestServicerFilter.  The only method
you need to implement is WebRequestServicerFilter.service, and the only
really important thing is to call servicer.service() to keep the chain
going.  See Tapestry's DisableCachingFilter for an example.

To hook up a filter in hivemodule.xml, you just need to instantiate the
service, then add it to the
"tapestry.request.WebRequestServicerPipeline" configuration point.
Example:













jeff

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam
Gendler
Sent: Friday, October 20, 2006 3:40 PM
To: Tapestry users
Subject: Re: RE: Recovery of session during pageValidate

Can you expound upon how you plug in the WebRequestFilter.
Constructing the WebRequest subclass looks simple enough, and the
Callback factory dosn't seem too tough, but injecting a web request
filter sounds like hivemind magic that I'm unaware of.

This seems like something we'd want to provide a more accessible
solution for in the core tapestry framework.  It is a fairly common
requirement of webapps.  Preserving the state of the current HTTP
request so that it can be restored in a callback later seems to me like
something that we'd want to make very easy.

--sam

On 10/20/06, Jeff Lubetkin <[EMAIL PROTECTED]> wrote:
> Not sure if this will help, but here's how we handle this (it's kinda 
> complicated, but it works):
>
> * All of our callback generation for interstitial processes like login

> go through a Callback factory service.  In order to preserve URL 
> integrity for bookmarking and the like, we use an ICallback 
> implementation that sends a redirect to the browser.
> * When a callback needs to be generated for a POST, or a GET that is 
> too long, the current request parameters (from
> HttpServletRequest.getParameterMap) are stored in session, along with 
> a randomly-generated token. The parameters are stripped from the 
> request and the token is added as a the "postToken" parameter 
> ("www.zillow.com/foo?postToken=123").
> * We have a WebRequestFilter that handles "global" URL parameters that

> can appear on any request.  This custom URL handling code sees the 
> "postToken" parameter and creates a wrapper WebRequest that returns 
> the saved parameters from the getParameterNames, getParameterValue, 
> and getParameterValues methods (passing the rest of the methods 
> through to the wrapped WebRequest).  This causes the request to look 
> just like it did before being sent off for authentication.  
> Rewind/render happens just as expected.  The only difference is that 
> (in the POST case) the method will be GET rather than POST in the 
> callback, but that rarely matters.
>
> The code for this is in no state to share, but hopefully the idea
helps.
>
> jeff
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam 
> Gendler
> Sent: Friday, October 20, 2006 2:15 PM
> To: Tapestry users
> Subject: Re: Recovery of session during pageValidate
>
> I can think of a couple of ways of doing this.  The way I do this is 
> to use an ExternalCallback, store that in session, and after 
> successful authentication, I just execute the callback.  However, this

> only works if you use ExternalLinks, and doesn't work at all if 
> someone submits a form after being away from their computer for long 
> enough to lose their session.
>
> Here's what would be really useful, but doens't actually work,
> currently:
>
> If you have their serviceParameters, you shouldn't need to put them 
> back in a request via the URL of the age, I think.  You should just be

> able to do something like this in your listener after they've 
> successfully
> authenticated:
>
> @Persist
> public abstract IPage getPreviousPage(); public abstract void 
> setPreviousPage(IPage page)
>
> @Persist
> public abstract Object[] getStoredServiceParameters(); public abstract

> void setStoredServiceParameters(Object[] params);
>
> public void doSomething(IRequestCycle cycle) {
> // check auth here
>
> if (authSuccess) {
> cycle.setServiceParameters(getStoredServiceParameters());
> cycle.activate(getPreviousPage());
> return;
> }
> }
>
> Unfortunately, when a page is activated, it doesn't go through a 
> rewind cycle, so even if the service parameters have all the right 
> info (and I'm not sure they do), the fields of your new page would not

> be populated with the data.
>
> I never found a solution to this, so my app has ExternalLinks 
> everywhere I can get them, and if you submit a form hours after you 
> loaded it, you just have to suffer through the process of filling it 
> out again manually.  It is more than a little frustrating, but after 
> fighting with this problem for a good long while, I gave up on it.
>
> I'd love to find a way to force a page to go t

Re: Recovery of session during pageValidate

2006-10-20 Thread Shawn Church
It's nice to at least know you've had the same problem.  Your code below
represents exactly what I'm after, but I so far haven't found any
practical way to make it work.  I've tried things like creating my own
POST (using HttpClient) within the current request cycle, but dealing
with this "inner" response while servicing the original response is
pretty messy and generally involves a bad hack to the Tapestry request
cycle.  Hopefully someone else already has a solution, but otherwise I
plan to come up with something more graceful than a "sorry, I'm too
stupid to service your request" page.

Thanks,
Shawn

Quoting Sam Gendler <[EMAIL PROTECTED]>:

> I can think of a couple of ways of doing this.  The way I do this is
> to use an ExternalCallback, store that in session, and after
> successful authentication, I just execute the callback.  However,
> this
> only works if you use ExternalLinks, and doesn't work at all if
> someone submits a form after being away from their computer for long
> enough to lose their session.
>
> Here's what would be really useful, but doens't actually work,
> currently:
>
> If you have their serviceParameters, you shouldn't need to put them
> back in a request via the URL of the age, I think.  You should just
> be
> able to do something like this in your listener after they've
> successfully authenticated:
>
> @Persist
> public abstract IPage getPreviousPage();
> public abstract void setPreviousPage(IPage page)
>
> @Persist
> public abstract Object[] getStoredServiceParameters();
> public abstract void setStoredServiceParameters(Object[] params);
>
> public void doSomething(IRequestCycle cycle) {
> // check auth here
>
> if (authSuccess) {
> cycle.setServiceParameters(getStoredServiceParameters());
> cycle.activate(getPreviousPage());
> return;
> }
> }
>
> Unfortunately, when a page is activated, it doesn't go through a
> rewind cycle, so even if the service parameters have all the right
> info (and I'm not sure they do), the fields of your new page would
> not
> be populated with the data.
>
> I never found a solution to this, so my app has ExternalLinks
> everywhere I can get them, and if you submit a form hours after you
> loaded it, you just have to suffer through the process of filling it
> out again manually.  It is more than a little frustrating, but after
> fighting with this problem for a good long while, I gave up on it.
>
> I'd love to find a way to force a page to go through the entire
> rewind/render cycle programmatically from a listener on another page,
> but there doesn't seem to be a way to do this.
>
> --sam
>
> -
> 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: RE: Recovery of session during pageValidate

2006-10-20 Thread Sam Gendler

Can you expound upon how you plug in the WebRequestFilter.
Constructing the WebRequest subclass looks simple enough, and the
Callback factory dosn't seem too tough, but injecting a web request
filter sounds like hivemind magic that I'm unaware of.

This seems like something we'd want to provide a more accessible
solution for in the core tapestry framework.  It is a fairly common
requirement of webapps.  Preserving the state of the current HTTP
request so that it can be restored in a callback later seems to me
like something that we'd want to make very easy.

--sam

On 10/20/06, Jeff Lubetkin <[EMAIL PROTECTED]> wrote:

Not sure if this will help, but here's how we handle this (it's kinda
complicated, but it works):

* All of our callback generation for interstitial processes like login
go through a Callback factory service.  In order to preserve URL
integrity for bookmarking and the like, we use an ICallback
implementation that sends a redirect to the browser.
* When a callback needs to be generated for a POST, or a GET that is too
long, the current request parameters (from
HttpServletRequest.getParameterMap) are stored in session, along with a
randomly-generated token. The parameters are stripped from the request
and the token is added as a the "postToken" parameter
("www.zillow.com/foo?postToken=123").
* We have a WebRequestFilter that handles "global" URL parameters that
can appear on any request.  This custom URL handling code sees the
"postToken" parameter and creates a wrapper WebRequest that returns the
saved parameters from the getParameterNames, getParameterValue, and
getParameterValues methods (passing the rest of the methods through to
the wrapped WebRequest).  This causes the request to look just like it
did before being sent off for authentication.  Rewind/render happens
just as expected.  The only difference is that (in the POST case) the
method will be GET rather than POST in the callback, but that rarely
matters.

The code for this is in no state to share, but hopefully the idea helps.

jeff

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam
Gendler
Sent: Friday, October 20, 2006 2:15 PM
To: Tapestry users
Subject: Re: Recovery of session during pageValidate

I can think of a couple of ways of doing this.  The way I do this is to
use an ExternalCallback, store that in session, and after successful
authentication, I just execute the callback.  However, this only works
if you use ExternalLinks, and doesn't work at all if someone submits a
form after being away from their computer for long enough to lose their
session.

Here's what would be really useful, but doens't actually work,
currently:

If you have their serviceParameters, you shouldn't need to put them back
in a request via the URL of the age, I think.  You should just be able
to do something like this in your listener after they've successfully
authenticated:

@Persist
public abstract IPage getPreviousPage(); public abstract void
setPreviousPage(IPage page)

@Persist
public abstract Object[] getStoredServiceParameters(); public abstract
void setStoredServiceParameters(Object[] params);

public void doSomething(IRequestCycle cycle) {
// check auth here

if (authSuccess) {
cycle.setServiceParameters(getStoredServiceParameters());
cycle.activate(getPreviousPage());
return;
}
}

Unfortunately, when a page is activated, it doesn't go through a rewind
cycle, so even if the service parameters have all the right info (and
I'm not sure they do), the fields of your new page would not be
populated with the data.

I never found a solution to this, so my app has ExternalLinks everywhere
I can get them, and if you submit a form hours after you loaded it, you
just have to suffer through the process of filling it out again
manually.  It is more than a little frustrating, but after fighting with
this problem for a good long while, I gave up on it.

I'd love to find a way to force a page to go through the entire
rewind/render cycle programmatically from a listener on another page,
but there doesn't seem to be a way to do this.

--sam

-
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: include-script question

2006-10-20 Thread Brian Duchek

Do these scripts need to have the same filename as the *.script file?

I'm trying to include a number of files from the yui library, and only
want to include them on pages that use their services.  But when I try
to do either:


or


And place the files in the appropriate location, I get the following NPE:

# 
org.apache.tapestry.script.IncludeScriptToken.write(IncludeScriptToken.java:60)
# org.apache.tapestry.script.AbstractToken.writeChildren(AbstractToken.java:76)
# org.apache.tapestry.script.ParsedScript.execute(ParsedScript.java:57)
# 
com.iconclude.dharma.em.tapestry.EventMapPage.renderComponent(EventMapPage.java:58)
# org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)

Thanks in advance... 

On 8/23/06, andyhot <[EMAIL PROTECTED]> wrote:

use include-script for resources in your classpath, i.e.


and put ajaxRequest.js in that package

Vinicius Carvalho wrote:
> Hello there! I'm trying to include a script with my .script file, but
> it is not being loaded by the browser:
>
> My script is located at context/WEB-INF/components/ajaxSend.script
>
> 
>
> When creating the page its rendering:
>
>  src="/chat/WEB-INF/components/ajaxRequest.js">
>
> Well, it seems ok, but the browser is not loading it. Isn't WEB-INF a
> protected folder? I mean, I can't access anything on it.
>
> Regards
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE 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: Recovery of session during pageValidate

2006-10-20 Thread Jeff Lubetkin
Not sure if this will help, but here's how we handle this (it's kinda
complicated, but it works):

* All of our callback generation for interstitial processes like login
go through a Callback factory service.  In order to preserve URL
integrity for bookmarking and the like, we use an ICallback
implementation that sends a redirect to the browser.
* When a callback needs to be generated for a POST, or a GET that is too
long, the current request parameters (from
HttpServletRequest.getParameterMap) are stored in session, along with a
randomly-generated token. The parameters are stripped from the request
and the token is added as a the "postToken" parameter
("www.zillow.com/foo?postToken=123").
* We have a WebRequestFilter that handles "global" URL parameters that
can appear on any request.  This custom URL handling code sees the
"postToken" parameter and creates a wrapper WebRequest that returns the
saved parameters from the getParameterNames, getParameterValue, and
getParameterValues methods (passing the rest of the methods through to
the wrapped WebRequest).  This causes the request to look just like it
did before being sent off for authentication.  Rewind/render happens
just as expected.  The only difference is that (in the POST case) the
method will be GET rather than POST in the callback, but that rarely
matters.

The code for this is in no state to share, but hopefully the idea helps.

jeff

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam
Gendler
Sent: Friday, October 20, 2006 2:15 PM
To: Tapestry users
Subject: Re: Recovery of session during pageValidate

I can think of a couple of ways of doing this.  The way I do this is to
use an ExternalCallback, store that in session, and after successful
authentication, I just execute the callback.  However, this only works
if you use ExternalLinks, and doesn't work at all if someone submits a
form after being away from their computer for long enough to lose their
session.

Here's what would be really useful, but doens't actually work,
currently:

If you have their serviceParameters, you shouldn't need to put them back
in a request via the URL of the age, I think.  You should just be able
to do something like this in your listener after they've successfully
authenticated:

@Persist
public abstract IPage getPreviousPage(); public abstract void
setPreviousPage(IPage page)

@Persist
public abstract Object[] getStoredServiceParameters(); public abstract
void setStoredServiceParameters(Object[] params);

public void doSomething(IRequestCycle cycle) {
// check auth here

if (authSuccess) {
cycle.setServiceParameters(getStoredServiceParameters());
cycle.activate(getPreviousPage());
return;
}
}

Unfortunately, when a page is activated, it doesn't go through a rewind
cycle, so even if the service parameters have all the right info (and
I'm not sure they do), the fields of your new page would not be
populated with the data.

I never found a solution to this, so my app has ExternalLinks everywhere
I can get them, and if you submit a form hours after you loaded it, you
just have to suffer through the process of filling it out again
manually.  It is more than a little frustrating, but after fighting with
this problem for a good long while, I gave up on it.

I'd love to find a way to force a page to go through the entire
rewind/render cycle programmatically from a listener on another page,
but there doesn't seem to be a way to do this.

--sam

-
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: Help, robots are attacking my listeners!

2006-10-20 Thread Daniel Jue

some robots.txt magic?

On 10/20/06, spamsucks <[EMAIL PROTECTED]> wrote:

hi everybody,
Sorry for the title, but that's what is happening.  I have a very high
traffic (very public) site that now is using ajax/tapestry for some
functionality.  Because we are being constantly crawled by bots, my
listeners are invoked on the "voting for a playlist" links in my app, and
it's throwing the numbers off.

I was thinking about writing a tapestry component that would hide the
wrapped components if the request comes from a robot.  Anybody have any
thoughts on such a component?


Thanks.




-
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]



Help, robots are attacking my listeners!

2006-10-20 Thread spamsucks

hi everybody,
Sorry for the title, but that's what is happening.  I have a very high 
traffic (very public) site that now is using ajax/tapestry for some 
functionality.  Because we are being constantly crawled by bots, my 
listeners are invoked on the "voting for a playlist" links in my app, and 
it's throwing the numbers off.


I was thinking about writing a tapestry component that would hide the 
wrapped components if the request comes from a robot.  Anybody have any 
thoughts on such a component?



Thanks.




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



Re: Recovery of session during pageValidate

2006-10-20 Thread Sam Gendler

I can think of a couple of ways of doing this.  The way I do this is
to use an ExternalCallback, store that in session, and after
successful authentication, I just execute the callback.  However, this
only works if you use ExternalLinks, and doesn't work at all if
someone submits a form after being away from their computer for long
enough to lose their session.

Here's what would be really useful, but doens't actually work, currently:

If you have their serviceParameters, you shouldn't need to put them
back in a request via the URL of the age, I think.  You should just be
able to do something like this in your listener after they've
successfully authenticated:

@Persist
public abstract IPage getPreviousPage();
public abstract void setPreviousPage(IPage page)

@Persist
public abstract Object[] getStoredServiceParameters();
public abstract void setStoredServiceParameters(Object[] params);

public void doSomething(IRequestCycle cycle) {
   // check auth here

   if (authSuccess) {
   cycle.setServiceParameters(getStoredServiceParameters());
   cycle.activate(getPreviousPage());
   return;
   }
}

Unfortunately, when a page is activated, it doesn't go through a
rewind cycle, so even if the service parameters have all the right
info (and I'm not sure they do), the fields of your new page would not
be populated with the data.

I never found a solution to this, so my app has ExternalLinks
everywhere I can get them, and if you submit a form hours after you
loaded it, you just have to suffer through the process of filling it
out again manually.  It is more than a little frustrating, but after
fighting with this problem for a good long while, I gave up on it.

I'd love to find a way to force a page to go through the entire
rewind/render cycle programmatically from a listener on another page,
but there doesn't seem to be a way to do this.

--sam

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



want external link to cause cycle.forgetPage() behaviour

2006-10-20 Thread Sam Gendler

I've got a CSS menu bar on my pages.  I want the links in the menu to
use ExternalLink so that they are bookmarkable. I can't have the link
submitting back to a listener method in my shell component, beacuse
then the URL is always one page behind the page I am actually looking
at, since the parameters in the URL will have the page name/component
name of the PREVIOUS page.

Many of the pages accessed via the menu have tables on them which are
derived from contrib:table, meaning that the state of the table pages
and sorted column are kept in the session.

When accessing a page via the menu, I always want the page to be in
its default state.  I only want the table state to be retained when
accessing the page via other links, never the menu.  I can't easily
just reset all the values in activateExternalPage because many of the
persistent properties are actually part of components nested several
levels deep within the page.  Calling cycle.forgetPage() would
ordinarily be enough to blow all the stored state about any component
in the page out of the session (I assume that's what it does, anyway).

So I tried adding a parameter to the service parameters that get
passed to activateExternalPage().  If I get a reset param, then I call
cycle.forgetPage(getPageName());  This mostly works - however, because
activateExternalPage is called AFTER the page is attached, it has
already been populated with values from the session, so after
activateExternalPage runs, the page displays with its stored state.
Then, if I hit reload, the page gets a new instance form the page
cache, and this time the session has been cleared of all data BEFORE
the page was attached, so now it displays in its default state.

So then I tried calling cycle.forgetPage() and then created an
ExternalCallback to the
current page, this time without the reset parameter, since the page
has already been reset. I then call performCallback on the callback,
to try to get an instance of the page to run which is populated after
the call to forgetPage().  In my logs, I can see activateExternalPage
getting called twice, but the second one still has the saved state.
The only way to get the reset to actually show up is to reload the
page - basically, it appears to require a new request cycle in order
to forget a page.

Is there some other way around this?

--sam

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



Recovery of session during pageValidate

2006-10-20 Thread Shawn Church
I'm hoping to find a better way to handle expired sessions without
redirecting to a default page.  I have many users which tend to let
sessions time out over lunch or over night, but who expect to be able
to resume working at any time without losing form data, etc.

I have a typical "protected" base page which implements
PageValidateListener.  If no Visit object exists, my current
implementation captures the full request URL and parameters (via
getHttpServletRequest().getParameterNames()), stores them in the (newly
created) Visit object, redirects to my authentication server (which
redirects back upon successful authentication), and then services the
original request by redirecting to the previously stored URL.

The problem is that I often exceed the max GET request length, since I
am having to encode form post data in the URL.  Does anyone know of a
way to capture post data during pageValidate so I can eventually (upon
completion of validation and visit creation) serve the
originally-requested page without losing form posts?  Even though I
can't in this case remain completely stateless, I would like to be able
to gracefully recover the expired session state and continue without
interruption (or loss of user form data).

Everything is working fine now, except in the case where the URL request
length exceeds the browser maximum.  I would really like to be able to
inject the previously stored request parameters into the Tapestry
request cycle, and then continue with a normal cycle.activate().  I
would greatly appreciate any help, since this problem is very common
among a dozen or so applications I have running in this environment
(Tapestry 4).

Thanks,
Shawn


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



Re: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Patrick Moore

I have a follow-on question. For most every thing I have found I don't
need a .page or .jwc file at all. However, for some cases like this I
do (the other is changing the default Home location).

But the .page file is pretty empty. Is there away to avoid having to
have this empty .page file?

-Pat

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



Duplicate id and updateComponents

2006-10-20 Thread Frank

Hi,

Got a problem with duplicate id's :




When Tapestry render the HTML there are 2 id's in the code, and this gives
the async update a javascript error.

Regards
Frank


Re: How do I override the stale session and links pages

2006-10-20 Thread Ryan Holmes

Nevermind, looks like Andreas and Thomas answered your question.

Although I have to say that overriding the page names in your  
hivemodule file seems like a cleaner approach than "hiding" the  
default pages in your .application. My guess is that you were running  
into a page resolution issue in your first attempt and Tapestry  
couldn't find your custom pages (?). I'll find out for myself soon  
enough since I have to do the same thing in a week or two...


-Ryan

On Oct 19, 2006, at 9:08 AM, Mats Henricson wrote:


Hi!

I've spent too much time trying to figure out how this is done in  
Tapestry

4.
I found this suggestion on the net:

   
   
   value="StaleSessionError"/>

   
   

The exception page works fine, but the stale session/link does not.
Does the accompanying Java page file need to extend a specific base?
I need no dynamic info displayed on my stale pages, just static text,
so I'd assume it would be a no-brainer.

Any suggestion?

Mats



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



Re: How do I override the stale session and links pages

2006-10-20 Thread Ryan Holmes
The default StaleLink page extends BasePage, so you shouldn't have to  
extend a special base class. However, the default StaleLink page  
class declares a "message" property (i.e. public abstract void  
setMessage(String message)), so your custom page probably needs the  
same thing.


There doesn't appear to be a specific StaleSession page class in  
Tapestry, so I'm not sure why yours isn't working. If you can provide  
more details on the error you are seeing, maybe I can help.


-Ryan

On Oct 19, 2006, at 9:08 AM, Mats Henricson wrote:


Hi!

I've spent too much time trying to figure out how this is done in  
Tapestry

4.
I found this suggestion on the net:

   
   
   value="StaleSessionError"/>

   
   

The exception page works fine, but the stale session/link does not.
Does the accompanying Java page file need to extend a specific base?
I need no dynamic info displayed on my stale pages, just static text,
so I'd assume it would be a no-brainer.

Any suggestion?

Mats



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



@PropertySelection inside a @For

2006-10-20 Thread pipothebit
Hi,
I have a problem with this convination. When I use a simple
PropertySelection getter / setter it's work fine but when I use a @Form
component to render many options to select it not works.
My Java code:

public abstract UserPage extends BasePage implements
PageBeginRenderListener {
...
@Persist
public abstract User getUser();
public abstract void setUser(User user);
...
public RolSelectionModel getRolSelectionModel() throws Exception {
  InitialContext initialContext = new InitialContext();
  IRoleServiceRemote iRoleServiceRemote = (IRoleServiceRemote)
initialContext.lookup("app/RoleService/remote");
  return new RoleSelectionModel(iRoleServiceRemote.findAll());
}

public void addRolAction() throws Exception {
  getUser().getRoles().add(new Role());
}
...
public void submitAction() throws Exception {
  // after add one role the user property have 1 role
  // but data are not initialized
  for (Rol role : getUser().getRoles()) {
System.out.println("id: " + rol.getId());
System.out.println("name: " + rol.getName());
  }
...

public class RolSelectionModel implements IPropertySelectionModel,
Serializable {
  private List roles;

public RolSelectionModel(List roles) {
  this.roles = roles;
}
public int getOptionCount() {
 return roles.size();
}
public Object getOption(int index) {
  return roles.get(index);
}
public String getLabel(int index) {
  return roles.get(index).getCodigo();
}
public String getValue(int index) {
  return String.valueOf(roles.get(index).getId());
}
public Object translateValue(String value) {
  for (Rol rol : roles) {
if (rol.getId() == Integer.valueOf(value)) {
  return rol;
}
  }
  return null;
}
}

HTML template code:
...

  

  
  
  del

  

...

UserPage.page code:
...





I don't have idea why this dont't work, can someone help me?
Very than you.





__ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

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



Re: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Andreas Andreou

[EMAIL PROTECTED] wrote:

* Yes, the "StaleLink" "StaleSession" and "Exception" keys are 'magic'
  


Actually, i wouldn't call them magic :)
They're real pages - the framework defines them ...
See 
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/


But if in your own app, you define a custom page as Exception (or 
StaleLink, or StaleSession)

it will 'hide' the framework provided version.


--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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



RE: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Thomas.Vaughan
* Yes, the "StaleLink" "StaleSession" and "Exception" keys are 'magic'

* No, the "New" is just part of Andreas' class naming example

* No, no special interfaces needed in the backing .java classes

* Nothing needed in the hivemodule


For comparison's sake, here's my StaleLink configuration:


 My .application file 






-Original Message-
From: Mats Henricson [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 20, 2006 9:26 AM
To: Tapestry users
Subject: Re: How can I do custom Exception page in tapestry portlet?

Hm... just to be damned sure;

* The strings "StaleLink" and "StaleSession" are "magic", right, in the
sense that they're properties spelled exactly like that in some class,
so
spelling them wrong is a nono?

* Is there something "magic" about "New" as the prefix to the page
names?
Can I call them whatever I want?

* Do the backing Java classes implement any special interfaces?

* Do I need to do anything in hivemodule.xml ?

Sorry for these idiotic questions, but it doesn't work as is.

Mats

On 10/20/06, Andreas Andreou <[EMAIL PROTECTED]> wrote:
>
> in the .application
>
> 
> 
>  specification-path="/pages/NewStaleSession.page"/>
>
>
>
> Mats Henricson wrote:
> > Hi!
> >
> > I think that page describes how to do it in Tapestry 3.
> > I use this in 4, and it works:
> >
> > 
> >  
> > 
> >
> > GeneralError is my page, and it has a corresponding Java, HTML and
page
> > class.
> >
> > Unfortunately you can't handle stale sessions the same way. I've
> > struggled
> > with that for about two days now. The info I see on the web doesn't
> work,
> > and no response from this mailing list.
> >
> > Mats
> >
> > On 10/19/06, Vitaly Baranovsky <[EMAIL PROTECTED]>
wrote:
> >>
> >> How can I do custom Exception page in tapestry portlet?
> >>
> >> All is fine when I make it in servlet :
> >> http://tapestry-tutorial.cloudnine.net.nz/pages-example.html
> >>
> >> But in portlet it does not work.
> >>
> >> Help me please!
> >>
> >> Thanks!
> >>
> >> _
> >> With best regards,
> >> Vitaly Baranovsky
> >>
> >>
-
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
>
> --
> Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / J2EE 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: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Mats Henricson

Hm... just to be damned sure;

* The strings "StaleLink" and "StaleSession" are "magic", right, in the
sense that they're properties spelled exactly like that in some class, so
spelling them wrong is a nono?

* Is there something "magic" about "New" as the prefix to the page names?
Can I call them whatever I want?

* Do the backing Java classes implement any special interfaces?

* Do I need to do anything in hivemodule.xml ?

Sorry for these idiotic questions, but it doesn't work as is.

Mats

On 10/20/06, Andreas Andreou <[EMAIL PROTECTED]> wrote:


in the .application







Mats Henricson wrote:
> Hi!
>
> I think that page describes how to do it in Tapestry 3.
> I use this in 4, and it works:
>
> 
>  
> 
>
> GeneralError is my page, and it has a corresponding Java, HTML and page
> class.
>
> Unfortunately you can't handle stale sessions the same way. I've
> struggled
> with that for about two days now. The info I see on the web doesn't
work,
> and no response from this mailing list.
>
> Mats
>
> On 10/19/06, Vitaly Baranovsky <[EMAIL PROTECTED]> wrote:
>>
>> How can I do custom Exception page in tapestry portlet?
>>
>> All is fine when I make it in servlet :
>> http://tapestry-tutorial.cloudnine.net.nz/pages-example.html
>>
>> But in portlet it does not work.
>>
>> Help me please!
>>
>> Thanks!
>>
>> _
>> With best regards,
>> Vitaly Baranovsky
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>

--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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




Re: Support for Java 5 - Generics in Tapestry 4.0.2

2006-10-20 Thread Gareth
I've answered my own question following "sleeping on it"...

The serialVersionUIDs hadn't been updated for a couple of files, meaning that 
they wern't recognised as being new - presumably something got serialized at 
some point!

Am installing the ant task serialver to automate the process of updating them 
for the future!



- Original Message 
From: Gareth <[EMAIL PROTECTED]>
To: Tapestry users 
Sent: Thursday, 19 October, 2006 10:59:24 PM
Subject: Support for Java 5 - Generics in Tapestry 4.0.2

Hi,

I've been having fun writing a page in Tapestry, but I could see a lot of 
duplication about, so I introduced generics, with various objects that get 
injected by hivemind also extending generic objects big mistake.

The problem is... I am now getting errors to the effect of "method doesnt exist 
methodName(path.to.BaseGenericClass);"...  This is a little concerning as I 
don't really want to have lots of duplication everywhere unless I absolutely 
have to.

Is this a known problem with Tapestry 4.0 that is fixed in 4.1?

Thanks

Gareth

Exception stack below:

Note:  DBO is my Base generic object, which an LDO object extends, which in 
turn is extended by my 'ModelObject'.





An exception has occurred.


You may continue by restarting the session.











org.apache.tapestry.BindingException



Exception
invoking listener method onSave of component AmendDetails: Failure
invoking listener method 'public java.lang.String
com.co.ind.gui.pages.AmendDetails.onSave()' on
[EMAIL PROTECTED]:
com.co.ind.model.globals.GlobalModelStore.update(Lcom/co/ind/model/DBO;)V



binding:
[EMAIL PROTECTED]
action, component=AmendDetails, methodName=onSave,
location=context:/WEB-INF/AmendDetails.page, line 10, column 50]


component:
[EMAIL PROTECTED]


location:
context:/WEB-INF/AmendDetails.page, line 10, column 50
5
6

7
8

9
10
11
12

13
14
15




 


 



org.apache.hivemind.ApplicationRuntimeException



Failure
invoking listener method 'public java.lang.String
com.co.ind.gui.pages.AmendDetails.onSave()' on
[EMAIL PROTECTED]:
com.co.ind.model.globals.GlobalModelStore.update(Lcom/co/ind/model/DBO;)V



component:
[EMAIL PROTECTED]


location:
context:/WEB-INF/AmendDetails.page, line 5, column 21
1
2http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";;>
5
6

7
8

9
10




 


 



java.lang.NoSuchMethodError




com.co.ind.model.globals.GlobalModelStore.update(Lcom/co/ind/model/DBO;)V








Stack Trace:




com.extsys.ind.gui.pages.AmendDetails.onSave(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)

org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod(ListenerMethodInvokerImpl.java:214)

org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:155)

org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke(ListenerMethodInvokerImpl.java:124)

org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod(ListenerMethodInvokerImpl.java:65)

org.apache.tapestry.listener.SyntheticListener.actionTriggered(SyntheticListener.java:51)

org.apache.tapestry.binding.ListenerMethodBinding.actionTriggered(ListenerMethodBinding.java:77)

org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener(ListenerInvokerTerminator.java:51)

$ListenerInvoker_10e6290fc74.invokeListener($ListenerInvoker_10e6290fc74.java)

org.apache.tapestry.form.AbstractSubmit$1.run(AbstractSubmit.java:88)

org.apache.tapestry.form.FormSupportImpl.runDeferredRunnables(FormSupportImpl.java:608)

org.apache.tapestry.form.FormSupportImpl.rewind(FormSupportImpl.java:589)
org.apache.tapestry.form.Form.renderComponent(Form.java:226)
$Form_4.renderComponent($Form_4.java)

org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
org.apache.tapestry.form.Form.rewind(Form.java

Re: Tapestry 5

2006-10-20 Thread Andreas Andreou

indeed, there are some typos (?) in
http://tapestry.apache.org/tapestry5/source-repository.html

Do:
svn co 
http://svn.apache.org/repos/asf/tapestry/tapestry5/tapestry-core/trunk/ 
tapestry-core
svn co 
http://svn.apache.org/repos/asf/tapestry/tapestry5/tapestry-project/trunk/ 
tapestry-project

cd tapestry-core
mvn install

David Avenante wrote:

Hello,

I would try Tapestry 5 to play with it.
How can i found the sources for build it.
I've tried to reach the svn repository for URL proposed on the site 
but it's

seems to be only for browser view.

I'de liked to download the sources files, build it and try it (i've 
already

work 5 months with tapestry 3 and try tapestry 4.1)

Thanks for any help



--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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



Re: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Andreas Andreou

in the .application







Mats Henricson wrote:

Hi!

I think that page describes how to do it in Tapestry 3.
I use this in 4, and it works:


 


GeneralError is my page, and it has a corresponding Java, HTML and page
class.

Unfortunately you can't handle stale sessions the same way. I've 
struggled

with that for about two days now. The info I see on the web doesn't work,
and no response from this mailing list.

Mats

On 10/19/06, Vitaly Baranovsky <[EMAIL PROTECTED]> wrote:


How can I do custom Exception page in tapestry portlet?

All is fine when I make it in servlet :
http://tapestry-tutorial.cloudnine.net.nz/pages-example.html

But in portlet it does not work.

Help me please!

Thanks!

_
With best regards,
Vitaly Baranovsky

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






--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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



Tapestry 5

2006-10-20 Thread David Avenante

Hello,

I would try Tapestry 5 to play with it.
How can i found the sources for build it.
I've tried to reach the svn repository for URL proposed on the site but it's
seems to be only for browser view.

I'de liked to download the sources files, build it and try it (i've already
work 5 months with tapestry 3 and try tapestry 4.1)

Thanks for any help


Re: implementing friendly urls

2006-10-20 Thread D&J Gredler

Yeah, but all of that happens in the page itself. The ServiceEncoder just
works on parameters if they exist.

On 10/20/06, Warner Onstine <[EMAIL PROTECTED]> wrote:


Do you currently handle null/empty params, so that if a user types in
manually:
http://localhost:8080/eventscalendar/event/
it would redirect somewhere instead of showing a bad exception page?

-warner

On Oct 19, 2006, at 9:58 PM, D&J Gredler wrote:

> I ended up hacking together a custom ServiceEncoder that knew which
> pages
> took a single String param, which took a single Long param, which
> took two
> Long params, etc. It strips the first character off of the
> parameters as
> needed in the encode( ) method and adds them back in the decode( )
> method.
> Ugly, but it was quick and it works. Hopefully this will be done
> via the new
> type coercion framework in Tap5 so that the type identifiers aren't
> needed...
>
> http://tapestry.apache.org/tapestry5/guide/coercion.html
>
>
> On 10/20/06, Warner Onstine <[EMAIL PROTECTED]> wrote:
>>
>> So far I have everything working the way that I want but I ran into
>> something odd while implementing this:
>> http://tapestry.apache.org/tapestry4/UsersGuide/friendly-urls.html
>>
>> specifically I am implementing the REST-like part of the friendly
>> urls the custom encoder. I created my own encoder/decoder pair but
>> when I call it for an external link I get this as my url:
>> http://localhost:8080/eventscalendar/event/l1
>>
>> After looking at this again I finally realized what that extra
>> character is, it is telling Tapestry that the value I'm passing is a
>> Long (which it is when it gets set on the wire), is there a way
>> (short of changing the actual value passed to an int) to get this to
>> remove the extra param, or am I stuck with it if I want to change it?
>>
>> Also, I am curious if anyone has developed a full-blown REST plugin
>> for Tapestry so that all the urls are easily mappable (ala Rails). So
>> that something like this
>> http://localhost:8080/eventscalendar/events/
>> would go to a default page like EventsHome.html and
>> http://localhost:8080/eventscalendar/events/new
>> would go to NewEvent.html
>> etc.
>>
>> It would be nice if we could easily do routes like Rails does in a
>> default Tapestry app, rather than having to jump through two files
>> (web.xml and hivemodule.xml).
>>
>> -warner
>>
>> -
>> 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: How can I do custom Exception page in tapestry portlet?

2006-10-20 Thread Mats Henricson

Hi!

I think that page describes how to do it in Tapestry 3.
I use this in 4, and it works:


 


GeneralError is my page, and it has a corresponding Java, HTML and page
class.

Unfortunately you can't handle stale sessions the same way. I've struggled
with that for about two days now. The info I see on the web doesn't work,
and no response from this mailing list.

Mats

On 10/19/06, Vitaly Baranovsky <[EMAIL PROTECTED]> wrote:


How can I do custom Exception page in tapestry portlet?

All is fine when I make it in servlet :
http://tapestry-tutorial.cloudnine.net.nz/pages-example.html

But in portlet it does not work.

Help me please!

Thanks!

_
With best regards,
Vitaly Baranovsky

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