File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Problem while submitting action through JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem while submitting action through JavaScript" Watch "Problem while submitting action through JavaScript" New topic

Problem while submitting action through JavaScript

Anshul Jain

Joined: May 10, 2006
Posts: 12

I am facing a problem while submitting struts action through JavaScript.
I am submitting form using a JavaScring function which is called on Click of a link. function is like this:
function sf() {
document.forms[app].action = "/sub/app1/";

My web application name is "APP". Now when I click the link the action which is called on my IE browser is

which does not have application name after localhost and it gives me 404: resource not found error whereas the right action should be

Is there anything wrong in my weblogic application setup?
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
change this too

document.forms[app].action = "/sub/app1/";


document.forms[app].action = "sub/app1/";

This may work....i am not sure
I agree. Here's the link:
subject: Problem while submitting action through JavaScript
Similar Threads
child window parent window different domain
Relative Path
multiple URL mapping for one web app
DNS related problem and Tomcat
ActionForward to external application