?
Solved

jsp from page

Posted on 2004-04-18
11
Medium Priority
?
287 Views
Last Modified: 2010-04-01
Hi Experts,

How can I get URL of some page where my main JSP page was opened from ?

Thank you.
0
Comment
Question by:fpoyavo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10855978
<%
String uri = request.getRequestURI();
String querystring = request.getQueryString();
%>
0
 
LVL 92

Expert Comment

by:objects
ID: 10855985
also:

StringBuffer url = request.getRequestURL();
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10856059
I was trying it before I posted this question. For some reason I get main jsp url not the one where it was initiated from.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Expert Comment

by:objects
ID: 10856079
Sorry misunderstood what u wanted.
If you want the URL of the page that called the jsp, check the referer request header.

request.getHeader("referer");
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10856181
You mean Just in main.jsp :

String ref = request.getHeader("referer");

0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10856188
Can it be a problem if I open main.jsp using javascript from html ?
0
 
LVL 92

Expert Comment

by:objects
ID: 10856234
the referer header is not guarnteed to be there, i think it is dependant on the browser as to whether it is included or not.

You could pass the url as a query parameter when you call main.jsp.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10856269
I am trying to accomplish the following thing:

1 It is login page
2 I cannot use cookies or session becuase of client's requirements
3 I get user, password if valid then open main.jsp using javascript
4 in main.jsp I would check if page where it was opened from login.html
5 if it is then continue if not go to login.jsp  

The problem is that I want to check it only first time. I would keep it in  my url but don't want to check it every time page processed
and besides that the url is changing constantly due to application requests.

Is it doable without session variables and cookies ?

Thank you.
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 10856288
> Is it doable without session variables and cookies ?

Not that I can think of.

Are you using a database? If so you could store some unique key for the user when they logged in and pass that id as a parameter to every page and use that to lookup database to determine if user logged in ok. bit messy though.
0
 
LVL 92

Expert Comment

by:objects
ID: 10856564
How come the client doesn't want to use sessions?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10862382
:) Sometimes they do.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question