Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsessionid and session tracking

 
Alex George
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use struts frame work. And I use HttpSession for session tracking. When I deploy and test in my test environment (WSAD and WebSphere application server), I don�t see jsessionid attached to the url. Is this the case always? Also I don�t see the data I submit in the url. Does this mean that the default method used in struts is �post� not �get�? I am still learning struts and jsp. Can somebody please give me some information?
Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64835
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"alexgeorge georgeAlex",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Alex George
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir, I tried with my real name when I registered. But it wouldn't let me proceed without changing the name. So I had to change it the way it is now.
[ March 24, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64835
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do believe that the struts form tag defaults to creating an html form tag with a method of "post" but it's been a long time since I've used Struts. To be sure, I've moved this post to the Struts forum where questions on Struts and its tags are discussed.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear is right. If you use the <html:form /> tag in your JSP, the default method is post instead of get. Aslo, regarding your JSessionId question: Since your development environment is WSAD, the test server you are using is IBM's WebSphere Application Server (WAS). The default configuration for WAS is to use cookies only for tracking sessions. If you want sessions to be tracked via URL rewriting, you must change the configuration of WAS to do so. Once you do this, you will begin to see JSessionID attached to your URLs.
 
Alex George
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
Alex George
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this sounds like a stupid question. But let me ask this anyway. If I use HttpSession for session tracking, does WAS use cookies for session tracking?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under the covers, Httpsession tracking uses cookies or falls back on URL rewriting(if neccessary) to handle sessions. This is nothing you need to worry about, unless your users browser will not have cookies enabled. In that case, you have to make sure your code uses URL rewriting if to encode any URLs you generate.

Originally posted by Alex George:
May be this sounds like a stupid question. But let me ask this anyway. If I use HttpSession for session tracking, does WAS use cookies for session tracking?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic