• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

JSTL Help  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I need some help with JSTL tags. One with retreiving values from request object and other with storing the values into session so that I can access the value from another page.

I trying to replace scriptlet code with JSTL tags.
Here is my working scriplet code.






I am trying to access the hello variable from other page.
by using


Could anyone provide with some direction.
I am using core tags to do the if else logic.
here is my JSTL Code.

And trying to access the variable value in another page by



I am getting error message saying that session has no value.
Please let me know what is wrong with the above code.

[ February 12, 2007: Message edited by: Kris10 ]
[ February 13, 2007: Message edited by: Bear Bibeault ]
 
Marshal
Posts: 67162
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Kris10", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

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

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
Ravi Kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I got most of the part working. However I have one question

1. Is there anyway to see that the session values do not expire.

Using scriplets I was doing
session.setMaxInactiveInterval(-1);

How do I set this??

[ February 12, 2007: Message edited by: Ravi Kumar ]
[ February 12, 2007: Message edited by: Ravi Kumar ]
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ravi Kumar:
Is there anyway to see that the session values do not expire.



Session values never get expired. Session itself get expired.
 
Ravi Kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Adeel Yes I meant the session. Is there anyway to see that the session doesn't expire. Any alternative approach to this.
[ February 13, 2007: Message edited by: Ravi Kumar ]
 
Bear Bibeault
Marshal
Posts: 67162
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Preventing the session from expiring would not be the best of ideas. Why would you want sessions not to ever expire?
 
Ravi Kumar
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am storing values into session. When the session expires, a new session is created. I don't want to loose the value in session. That's the reason I am trying to set my session not to expire.

My Issue is resolved.I used the same scriplet code to set the session not to expire.

However if there is any way I could do using JSTL I would like to know.

Thanks
[ February 13, 2007: Message edited by: Ravi Kumar ]
 
Bear Bibeault
Marshal
Posts: 67162
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give a man a gun and he's liable to shoot himself in the foot.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ravi Kumar:
However if there is any way I could do using JSTL I would like to know.



Use your existing JSTL code after removing the conditions. Then you will get to know that the problem was there in your condition.

I shouldn't be that much sure about it. Anyways lets see..
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Kris10:
...
I am using core tags to do the if else logic.
here is my JSTL Code.

...



the bold line above should be:
<c:when test="${param.username eq 'Customer'}">

About the session-timeout though, I'm sure you wouldn't want your sessions to never expire. Would you (or your clients) want to retrieve a session that was created years ago (If session id is still saved in the URL or cookie)? You also wouldn't want to burden your server with stale sessions.

Anyway, to answer your question, I don't think there's a JSTL for that. You can move your session time-out settings in the deployment descriptor, though.
[ February 17, 2007: Message edited by: Hunny Growl ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!