You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by mateen <ma...@gmail.com> on 2012/11/12 13:06:04 UTC
using onActivate to see if this is the correct page .
Hi,
I came across some code that consists of a Index.java page and a index.tml
page. In the index.java page we have
Object onActivate(String... vals)
{
return new HttpError(HttpServletResponse.SC_NOT_FOUND, "Page Not
Found");
}
now this is real magic. If i sat mycontext/index thats fine, but if i say
mycontext/indexxaasa this code executes. How is this possible? Why is the
function only called when tapestry truncates the URL ?
Kind Regards
--
View this message in context: http://tapestry.1045711.n5.nabble.com/using-onActivate-to-see-if-this-is-the-correct-page-tp5717931.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: using onActivate to see if this is the correct page .
Posted by Bob Harner <bo...@gmail.com>.
Tapestry only calls the onActivate method that has a number of parameters
corresponding to the URL path segments after the last segment that is
recognized as a page name. Since there is no page named "indexxaasa" then
the last URL path segment that is recognized as a page name is "/". So
Tapestry considers "indexxaasa" to be the activation context, and it then
calls the "/" page (implicitly the index.java page) and passes "indexxaasa"
as the activation context.
On Mon, Nov 12, 2012 at 7:06 AM, mateen <ma...@gmail.com> wrote:
> Hi,
>
> I came across some code that consists of a Index.java page and a index.tml
> page. In the index.java page we have
>
> Object onActivate(String... vals)
> {
> return new HttpError(HttpServletResponse.SC_NOT_FOUND, "Page Not
> Found");
> }
>
> now this is real magic. If i sat mycontext/index thats fine, but if i say
> mycontext/indexxaasa this code executes. How is this possible? Why is the
> function only called when tapestry truncates the URL ?
>
> Kind Regards
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/using-onActivate-to-see-if-this-is-the-correct-page-tp5717931.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: using onActivate to see if this is the correct page .
Posted by Bryan Lewis <jb...@gmail.com>.
Tapestry invokes the Index page when it receives a request for a page that
doesn't exist. I couldn't quickly find where this is explained in detail,
but I did find this footnote at
http://tapestry.apache.org/error-page-recipe.html
"... any invalid path, which would normally generate a 404 error, is
instead routed to the
Index page..."
On Mon, Nov 12, 2012 at 7:06 AM, mateen <ma...@gmail.com> wrote:
> Hi,
>
> I came across some code that consists of a Index.java page and a index.tml
> page. In the index.java page we have
>
> Object onActivate(String... vals)
> {
> return new HttpError(HttpServletResponse.SC_NOT_FOUND, "Page Not
> Found");
> }
>
> now this is real magic. If i sat mycontext/index thats fine, but if i say
> mycontext/indexxaasa this code executes. How is this possible? Why is the
> function only called when tapestry truncates the URL ?
>
> Kind Regards
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/using-onActivate-to-see-if-this-is-the-correct-page-tp5717931.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>