• 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

Session tracking and tiles

 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I've just finished "Struts 2 in Action" book, and I didn't find at any place wird about session tracking. Considering that Struts architecture is built upon Servlet API ( and on servlet we know that sesion tracking is preserved by cookies or url writing), I guess that framework by itself maintain such a tracking, isn't it?
And also I'm interesting where I place the tiles declaration file (tiles.xml) in the application (in the WEB-INF/classes, or ? ) ?
Thanks...
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reason you didn't find any information about session tracking in a Struts book is that session tracking is not done by Struts or any other web framwork. It's done by the application server (Tomcat, WebLogic, WebSphere, etc.). To understand how your application server does it, consult the relevant documentation.
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, Servlets, also deployed on (let say) Tomcat, use mentioned mechanisms (cookies and URL rewriting) and it's specified by Servlet specification, right? I mean, it's not defined by server but Servlet spec.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servers implement the Servlet spec. The server implements session tracking as defined by the spec.

Do you have a specific question about Struts and sessions?

The tiles definition files can go wherever you want as long as you define the location. I'd consider reading the Tiles documentation regarding configuration. Note also that Tiles 2 is no longer part of the Struts project.
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aha, Tiled are plugins, it's ok. Well about session tracking, just as I've asked, do I need to perform certain explicit method of session tracking (such as URL rewriting just as I did in pure Servlet based web application), do I need such a thing to perform in Action class (just as I did , or what?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the "using tags" docs, the <s:url...> tag will:

URL-encode the link with the Java session ID, if needed, so that the Java session can be retained across requests.


 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I guess It will :-) But can I do that from Action like in Servlets where also in the sort of authentication servlet I should retrieve a session from request to start session tracking, or only in Struts, it could e done through the tag, if it is quite enough?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You *could* do it in an action, but I don't really know why you'd want to. Unless you specifically disable sessions (including on every JSP page) you're going to have a session, as far as I know.
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aha, no really matter just curiosity, because I don't want to leave any "whole" in order to built "firm" knowledge... Thanks a lot...
reply
    Bookmark Topic Watch Topic
  • New Topic