• Post Reply Bookmark Topic Watch Topic
  • New Topic

restrict the previous page after signout  RSS feed

 
Manoj semwal .
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HAi Friends
iam using the session to store the userid and password value. and after signout it's going back in previous page.so how to disable the back button of the browser or restricted the user to go back.
in my signout.jsp page iam also using the session.invalidate()function.

Manoj
[ August 06, 2008: Message edited by: Bear Bibeault ]
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't control the browser's back button, but you can prevent it from being an issue. The problem is multi-tiered and depends on Caching on the client side, and being able to re-post data that re-introduces client state to a new session on the server.

There is an article On JavaWorld that addresses the problem quite clearly, and provides the solution.

In addition to the information provided by that page, I would suggest making any servlet that receives a POST request from the client use a sendRedirect to the JSP display page, rather than a server-side forward. This will prevent the back button from being able to post the data, as the new request to the JSP would replace the POST form request.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66152
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indeed. This pattern is described in this article which you may find helpful.
 
Manoj semwal .
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friend
Thanks really that article helped me too much. i have solved my problem 80%
but how can i restriced to see the folder through URL access

Manoj
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by manoj Rksh:
Dear Friend
Thanks really that article helped me too much. i have solved my problem 80%
but how can i restriced to see the folder through URL access

Manoj


Can you please explain what you mean by this question? What is the behavior you are currently seeing, and what do you want it to change to?
 
Manoj semwal .
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Luke,

My all project file are in jsp and html folder so, if anybody access the folder through URL Like
http://localhost/Online/jsp
it will show the all file so iwant t restricted the user to see the folder content.

One more think Luke i want to know it is possible to create jdbc link without following the process ControlPanel--->Administrative tools--->ODBC--->SystemDsn..etc . allthose thing.


Manoj
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To prevent people from seeing the contents of a folder, you have to use a <welcome-file>. These are usually something like index.html or index.jsp. If you put one of them in every directory then you should get that index page displayed instead of the file listing.

Depending on your server there may be a specific setting that will disable the listings on all folders. And if you have a Front Controller Servlet then you could easily intercept these requests and do with them what you want.

For the second question, A JDBC Tutorial is a good place to start.
 
Manoj semwal .
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Luks its good idea to place index.jsp or html page in each folder.
 
Ghufran Ul Haq
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Make a new folder in WEB-INF and name it as jsp.
now place all your jsp files in this new folder
Once you do it, no one will be able to directly access your jsp files through urls.

This is because the container restricts the direct user access to the things placed inside web-inf folder. for example you can not access this url
http://yourserver.com/yourapp/WEB-INF/web.xml

However you are free to access the objects placed in webinf folder from your servlets and jsps


Regards

Ghufran
 
Manoj semwal .
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks gulfran

Gulfran it is possible to upload a bulk data in jsp inspite of single entry in each time. like data is in excel file and upload in sql or Access.

can you help me for do that.

Manoj
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66152
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"manoj Rksh", please check your private messages for an important administrative matter. Again.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66152
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"manoj Rksh", please check your private messages for an important administrative matter.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!