• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

opening jsp in new tab

 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my project i have created many jsp pages with a main project name abc

but the problem is that when ii am logged in & in a new tab i tried to open a jsp like //localhost/abc/xyz.jsp

it is opening xyz.jsp

but if i am not logged in that is logged out then this will no open xyz.jsp

tell me what should i do ???

thank you
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't really follow the problem. Do you know why it is not opening the page you expect? Do you get an error in the logs?
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please clarify bit more. Is the page opening and you don't want it to open or you want to open the page but its not opening?
 
Aditi agarwal
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks to both of you for replying

first of all sorry that i cannot explain my problem in a proper manner

Actually my problem is this:-

My project name is abc i have many jsp files in it for example xyz is one of them now i want that either i am logging in or logged out this file should not be open if directly given the path of it means

localhost/abc/xyz.jsp

at present what is happening is this

i am running my project if i am logged in then in a new tab except the tab in which project is running through tomcat my page is opened but if i am logged out it will not open in new tab


so i basically need is that it should not be open in any of the way

thankyou

if still you cannot understand my problem then please let me know
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aaaaah !! Is it that you dont want to open any of the jsp's without logging in ?

well one of the way is validating the user credentials in your actions and mapping each of your jsp's to actions in your struts.xml file.. and if your applications has only jsp's and no actions or no struts then go for the 1980's way of scriptlets inside jsp's to validate the user name and password in the session that you have to put after you log in.

one more way - adding security-constraint tag in web.xml (declarative security)... I read in a O'Reily book. search about it..

and this might help -> Link and this also -> Link 2
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aditi,
As far as I have understood your problem, if you keep the file inside WEB-INF folder, and make an url-mapping for that, it might solve your problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic