Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with Struts and AJAX  RSS feed

Fabio Massao
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/", accessing the new.vm without a problem, accessing modulos.vm again, the AJAX function should be "/admin/", but the URL that is returning is "/new/admin/", 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!