Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 23rd, 2004, 07:05 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default JSP string find characters

Hi,
I have a JSP login form that creates a session after a successful login.
I want to make sure that the session is ended when a user either closes their browser, or leaves my site. (if they bookmark the site I want to force a login even if the session hasn't timed out)

The way that I want to do this is by looking at the referring page:
<%request.getHeader("referer");%> and comparing it to my Web URL www.mySite.com/index.jsp.

All that I want to find out is that the 'www.mySite.com' exists in the 'request.getHeader("referer");'

I have seen the command 'FindNoCase(substring, string [, start ])' as a Cold Fusion function, but I can't find anything in JSP that does the same thing.

Any help would be greatly appreciated

Nick




Reply With Quote
  #2 (permalink)  
Old November 23rd, 2004, 09:26 PM
Authorized User
 
Join Date: Jul 2003
Location: kl, kl, Malaysia.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yuji_chen
Default

Hi,
  Your can use the method provide in the string object "indexOf(String str) " to do that. If u facing any problem in future you can alway refer back to java doc http://java.sun.com/j2se/1.5.0/docs/api/index.html . HTH

regards
yuji


Reply With Quote
  #3 (permalink)  
Old November 24th, 2004, 09:52 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , .
Posts: 204
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Im afraid I do not know how to answer your about closing sessions, but once a user closes their browser they will lose connectivity to their session anyway. By this I mean your server may keep the session open for x amount of time, but the client will not be able to re-connect to it once they have lost their 'end' of the session.

My site works in the way you desire without forcing sessions to close.
Every time I re-open the browser I have to log on again.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing multiple characters in a string philboparker BOOK: XSLT Programmer's Reference, 2nd Edition 0 May 20th, 2008 04:38 PM
Replacing characters in a string semilemon C# 2005 2 June 16th, 2006 11:31 PM
Find and Replace 2 characters at once!! HELP scovitch65 VB.NET 2002/2003 Basics 2 March 18th, 2006 01:40 AM
swapping characters in a string pritz VB How-To 1 August 22nd, 2005 12:19 PM
How to eliminate special characters from string dadahonde VB How-To 2 March 11th, 2005 05:14 AM



All times are GMT -4. The time now is 11:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.