Hi All

I am creating a url for a file, which is uploaded in content management server, in the jsp page and from this jsp, I am opening a new window for this file to show the content to the user. My problem is, I want to hide the url which is showing the path to file exists in content management server.

I have following doubts---

1)How to show some another url in place of actual url.

2) Is it a problem If user see the url of a file, which is uploaded in content management server

Please correct me if I am wrong.

Regards
Nishant

If you use frames, then the URL in the address bar would be only of the main page which accommodates all the frames. But getting the URL of the page inside the frame is not too difficult.

Alternatively if you use the <jsp:forward> tag then I **suppose** the address bar would only be displaying the URL of the page from which request was forwarded, but this is only a guess.

Hi stephen84s

Thanks for the response.

You are right. we can achieve this by <jsp:forward> tag.

As I told i am creating url for a file in jsp and from same jsp I am opening this file in new popup window like the following...

function popUpDocuument()

	{
		
		var aaurl = '<%= url %>';
		
		window.open(aaurl);
	
		
		
	}

jsp:forward is used to forward the request and response. here I am not forwarding request and response, I am just opening the file in new popup window only.

Pls guide me If i am wrong somewhere.

Regards
Nishant

Well I have another suggestion, if you are opening a new browser window via Javascript why don't you just hide the address bar in the pop up ??

Can you please tell me how to hide the address bar in the pop up.

Regards
Nishant

Look here for more info on that.

Hi stephen84s

Thank you once again for your response.
I got the below code from the google. It is working fine. This code helps to hide the address bar of popup window. But user is still able to see the url in title bar. I added titlebar=no in var feature but still it is showing url in titlebar. Even I passed title name in the below method like this window.open(newloc,'titleName', v3, features) but the code behaviour is still same.
Now we are discussing on java script in jsp forum. I am creating a new thread in java script forum for this issue also.

function loadMainWindow() 
{ 
   var win = window.self; 
   win.opener = window.self; 
   var newloc = '<%= url %>'; 
   var ih = (window.window.screen.availHeight - 60) - 100; 
   var iw = (window.window.screen.availWidth - 10) - 100; 
   var it = ((window.window.screen.availHeight - 60) - ih) / 2; 
   var il = ((window.window.screen.availWidth - 10) - iw) / 2; 
   
   var features = 
"directories=no,menubar=no,location=no,toolbar=no,status=no,scrollbars=yes­,resizable=yes" 
+ ",width=" + iw + ",height=" + ih + ",top=" + it + ",left=" + il + ""; 
   v1 = new Date(); 
   v2 = Date.parse(v1); 
   v3 = "pg" + v2; 
   
   var oNewWindow = window.open(newloc, v3, features); 
  

   oNewWindow.focus(); 


   

} 

function popUpDocuument() 
{ 
   try 
   { 
      loadMainWindow(); 
   } 
   catch(e) 
   { 
      popUpMessage.style.display = 'block'; 
   } 
}

Regards
Nishant

As per my understanding, we can't hide the titlebar. But we can rename this. I am surprised why this code is not showing the title whatever I am passing the title name string in window.open method.

Regards
Nishant

Yes that is strange, try setting the "title" in the called URL / web page, to override the address from being displayed in the title bar.

That's already there. Actualy we are creating a new window. for this popup window we have to set the title. Even I tried like this also...

oNewWindow.title="hello";

I passed the title in different position in open method also like this--

var oNewWindow = window.open("hello", newloc, v3, features); 
var oNewWindow = window.open(newloc,"hello",  v3, features); 
var oNewWindow = window.open(newloc, v3,"hello" ,  features); 
var oNewWindow = window.open(newloc, v3, features, "hello");

Now I am thinking is it possible to rename the title of popup window.

Regards
Nishant

Well yes it seems strange, BTW did you try setting the title of the pop up window using the title tag (<title>), in the page(JSP, Servlet, etc) which you wish to open in this pop up window.

Yes I tried to set the title in my jsp page from where I am opening the popup window. It is not showing this title for popup window.

Don't know it's possible or not. As i told i created a new thread in java script forum. Can please check the response of Almostbob in this forum. He suggested to use the <div>. I don't know how to use it. here is the url--
http://www.daniweb.com/forums/thread178019.html

Regards
Nishant

Hi

Can any buddy tell me, Is It possible to change the title of popup window. Is there any control on pop window title.

Any help/suggestion is highly appriciated.

Regards
Nishant

The following code snippet opens the a new Pop up window, with the specified title in the child window.

File : popupparent.html

<html>
  <head>
    <script language="javascript">
      function openPopUp() {
        window.open("popupchild.html");
      }
    </script>
  </head>
  <body>
    <a href="javascript:openPopUp()">HERE</a>
  </body>
</html>

File : popupchild.html

<html>
  <head>
    <title>HELLO</title>
  </head>
</html>

Title of the new Window was "HELLO"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.