Struts URL problem with switching modules

O

oscar

I have an application that I converted from 1.0 to 1.1. It used to be
one single application and now I separated it into two modules. I am
able to switch from one module to another using the SwitchAction. But
I have an issue with my href in my JSP's.

I was using tiles to set the HREF of my menu items and such. The URLs
look like

/default.do?action=initialize


I have since created an action mapping called switchToModule of type
SwitchAction and replaced the URLs :

/switchToModule.do?prefix=/admin&page=/default.do?action=initialize


I am able to go from my default module to the admin module without any
problem. But since I do a forward and not a redirect, the address bar
is still http://localhost:8080/app/defaultmodule/default.do?action=initialize.

But if I have a hyperlinkn on a page in the admin module, with a URL
validateCustomer.do, the browser appends
http://localhost:8080/app/defaultmodule (where app is the application
context root and defaultmodule is the previous module) in front of it
even though I am already in the admin module.

if I click on the hyperlink, the wrong moduleConfig gets loaded
because of the wrong module name in the URL and I get an error saying
the actionmapping was not found.

How does the host name, application name and module name get prepended
to my hyperlink url? Is that caused by the browser?

How can I get around this so that my URLs point to the current module
I am in?

I would greatly appreciate your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top