aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes opening new window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "opening new window" Watch "opening new window" New topic
Author

opening new window

sachin pachpute
Ranch Hand

Joined: Nov 04, 2004
Posts: 38
I have developed one form which on submition opens a new window and displaying anather jsp page successfully. I created a war file and deployed on the test server but same form is not working on it. Newly opened window is not able to find a jsp page and is giving 404 error.

my java script code is as follows,
var sName ='UPDATE_PROJECT';
var oParentWindow =window;
var iWidth =750;
var iHeight =400;
var scroll =0;

var xPos = oParentWindow.screen.width / 2 - iWidth / 2;
var yPos = oParentWindow.screen.height / 2 - iHeight / 2;

var sFeatures = 'width='+ iWidth + ',' + 'height=' + iHeight + ',';
sFeatures += 'left='+ xPos + ',' + 'top=' + yPos;
sFeatures += ',scrollbars=' + (scroll == 0 ? '0' : '1');

var oDialog = oParentWindow.open('', sName, sFeatures, false);
if ( oDialog )
{
oDialog.document.writeln(
'<html><head><title>Console</title></head><body>'
+'<Form action="/campaign/updateArticle.do">'
+'<input type="hidden" name="campaignNumbersInput" value="'+document.getElementById("campaignNumbersInput").value+'">'
+'<input type="hidden" name="projectType" value="'+document.getElementById("projectType").value+'">'
+'</Form></body></html>')

oDialog.document.forms[0].submit();
}

Please help,
Thanks in advance.
Sachin.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6



Eric
sachin pachpute
Ranch Hand

Joined: Nov 04, 2004
Posts: 38
Hi Eric,

I am a bit confused. Could you elaborate on it please.

My concern is same code is working on local machine. but when i deplyed it's war file on test server, pop-up window is not able to find jsp page.

Thanks for help.
Sachin.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I have no clue what you mean that it can not find the jsp. What JSP? The form location where it is submitting? why are you using JavaScript to write this form?

Why don't you just use a get url (querystring), no form needed. Why don;t you use ajax instead. No pop up needed.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: opening new window