jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Problems with Struts and AJAX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problems with Struts and AJAX" Watch "Problems with Struts and AJAX" New topic

Problems with Struts and AJAX

Fabio Massao

Joined: Jan 14, 2009
Posts: 1
Hello, Here is my problem, I'm bulding a modular aplication, and I'm using the SwitchAction in the struts-config.xml to change to another config file, eht problem is that when I change to the other module, and get back to the default config xml, I'm getting a error, because my page use a AJAX request to get some data from the DB, and I've found out that the prefix that I first send to change the module is getting back and its return the wrong url. following is a example to better undestanding:

Page modulos.vm, accessing the new's link, new's link have the prefix "new" so its acessing the page in the new module with this URL "/new/new.do", accessing the new.vm without a problem, accessing modulos.vm again, the AJAX function should be "/admin/modulos.do?somedata", but the URL that is returning is "/new/admin/modulos.do", and I dont know what to do, accordling withe the struts documentation "prefix - The module prefix (beginning with "/") of the module to which control should be switched. Use a zero-length string for the default module. The appropriate ModuleConfig object will be stored as a request attribute, so any subsequent logic will assume the new module."

So anyone have any idea why AJAX is including the "new" in the URL? or anyone have any idea on how to clear up the relative path os something that may help me?

Almost forget to mention I'm using JQuery to call the AJAX function.
I agree. Here's the link: http://aspose.com/file-tools
subject: Problems with Struts and AJAX
It's not a secret anymore!