Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Struts and the fly likes Struts Action and javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Action and javascript" Watch "Struts Action and javascript" New topic

Struts Action and javascript

Perindevi Peramur

Joined: Dec 24, 2005
Posts: 10
I have one submit button A and one ordinary button B. On clicking B, control is transfered to javascript as below. But it says file not found. But it works fine, if its not a pop up window and goes into regular jsp and displays info.

Thanks for any help

function popUp(field, mytest) {
var printList ="31~21";
var url = '/misc/ Proof&printList='+printList;
var pop =, 'Create Proof', 'height=550,width=800,scrollbars=yes,resizable=yes');

Why is the struts action not recognized here ?

If I use rewrite, then I am not able to pass the parameter printList.
var pop ="<html:rewrite action="/misc/comSelectionSave?printButton=Create Proof"/>","Create Proof", "toolbar=0,scrollbars=0,status=1,resizable=0,menubar=0,width=400,height=500");
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The problem may be that you have a space in one of your parameters. You also have a space in the window name, which is not allowed.


var url = '/misc/ Proof&printList='+printList;


var url = '/misc/'+printList;


var pop =, 'Create Proof', 'height=550,width=800,scrollbars=yes,resizable=yes');


var pop =, 'Create_Proof', 'height=550,width=800,scrollbars=yes,resizable=yes');

Consultant, Sima Solutions
I agree. Here's the link:
subject: Struts Action and javascript
It's not a secret anymore!