Board index » jbuilder » ReferrURL\RedirectPage

ReferrURL\RedirectPage


2005-07-14 02:04:59 AM
jbuilder0
The index page of one of my websites is set as the starting document in
IIS. I have another website the user has to log into and if the login
is valid I redirect them to this site. I only want this site to be able
to be opened from my other website. Does anyone have the code to do
this? I was going to use the following java script in the index page,
but not sure if this was correct, and not sure how to redirect back to
the website that called it. Someone mentioned using a server side
method for this.
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
if (document.referrer != "www.mysite/launch.html")
location.href = "";
</SCRIPT>
TIA
 
 

Re:ReferrURL\RedirectPage

"Jeff" < XXXX@XXXXX.COM >wrote in message
Quote
The index page of one of my websites is set as the starting document in
IIS.
You stated you were using IIS.. Are you using a servlet container as well?
 

Re:ReferrURL\RedirectPage

Paul:
The java web application was purchased by my client from another
company. I am new to java so I am trying to figure out the best
approach for this. As fae as I can tell there is not any servelts with
the application. Currently I have a login page on an ASP.NET site where
I validate the users login\password and if they are valid, I call the
index page page of the java web app. Everything is working, but we need
to allow the java web site to be opened only from the ASP.NET page. Any
suggestions?
TIA
Paul Nichols (TeamB) wrote:
Quote
"Jeff" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>The index page of one of my websites is set as the starting document in
>IIS.


You stated you were using IIS.. Are you using a servlet container as well?


 

{smallsort}

Re:ReferrURL\RedirectPage

"Jeff" < XXXX@XXXXX.COM >wrote in message
Quote
Paul:

The java web application was purchased by my client from another
company. I am new to java so I am trying to figure out the best
approach for this. As fae as I can tell there is not any servelts with
the application. Currently I have a login page on an ASP.NET site where
I validate the users login\password and if they are valid, I call the
index page page of the java web app. Everything is working, but we need
to allow the java web site to be opened only from the ASP.NET page. Any
suggestions?

I would do this only via a POST method in your form, or by encoding a
C#/VB.NET (or whatever)
request method (something akin to RequestDispatcher in Java), and pass a
param to the Java page that must be in some type of valid range. If it is
invalid (aka because the page attempt access was outside the parameter),
then throw a page inmforming user of invalid access.
Of course another way is to have the .NET app write to a file somewhere and
place a value into the file. Modify the Java app to look for this file or a
setting in this file. If the value is absent (say a SessionID), then the
Java page will not be opened and an access denied page displayed instead,
informing the user they must login.
Of course, if you really want to get fancy, you could pass an Ajax request
from Java Script as an XML file to the Java app, and check for the value. Or
use a Web Service, etc.
The easiest method would be suggestion one and two above. Of these the file
method would be the most secure.