• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Going back through the book....

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going through the book again trying to get a better grasp of Tapestry. Like I said before, I like the concept. It's usability in my life remains to be seen.

Anyway, I am working with the Login example and I realized that it seems if you access the root of your webapp, Tapestry automatically looks for the page defined as Home. In my login app I have defined home as Login.page like:



My question is, will Home always be what Tapestry looks for? I couldn't seem to find this information in the Book but if it is there please point it out to me. Also, is there a way to change Tapestry so that you can specify say "Index" instead of "Home". I realize there wouldn't be much point in this probably but I am curious.

Thanks.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gregg,
You can extend org.apache.tapestry.engine.HomeService and override service method to supply your own Home Service. In the service method you can get a predefined "Index" instead of "Home" page from IRequestCycle, and then render the "Index" page. Just like the following :





and and the line blow to your ****.application file

[ May 25, 2004: Message edited by: Looluo Zhu ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Looluo Zhu:
Hi Gregg,
You can extend org.apache.tapestry.engine.HomeService and override service method to supply your own Home Service. In the service method you can get a predefined "Index" instead of "Home" page from IRequestCycle, and then render the "Index" page. Just like the following :






Thanks for the info Looluo. Now the question is, would one ever really need to do this? If so, why? It's not the big of a deal to me to define my index page as Home. I am just curious.
 
Looluo Zhu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In one of my recent project, the whole project was devided into several moudles(library in Tapestry), each member was responsible for his own module. And the "Home", "Login", "About" were contained in the "home" module(library), so the actual "Home" page was "home:Home". That is Why I need to supply my own Home Service.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally, you make Home.page the real home page not the login page. What I do when I have a group of pages that must be protected by a login page is create a base Java class for those pages. The base class overrides the validate() method.

Perhaps one could call it ProtectedPage:



There's an interface for creating callbacks you can pass to the Login page before redirecting. That way the Login page can direct the user back to the page they originally requested after they log in.

I didn't put that code in as I didn't want to confuse things.

There is an example of the callback in Home.java in this small jar file
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic