views:

29

answers:

0

Hi guys,

I was hoping if anyone cud help me with struts SwitchAction. I am using struts 1.1 and scaffold.

I have two modules, customer and utilities. I am switching an action from * struts-config-utilities.xml* to struts-config-customer.xml , the jsp in customer module is loaded and the beans are executed.

But when I try to invoke another action (/listCustomerAdvancedProfile) from the JSP in customer, it says invalid path.

" HTTP Status 400 - Invalid path /listCustomerAdvancedProfile was requested "

The action path called is utilities/listCustomerAdvancedProfile.do actually it should call customer/listCustomerAdvancedProfile.do

The module name still remains as utilities , instead of customer.

I found out that my module is not switched. When i debugged , in the RequestProcessor class,the getModuleName returns utilities , it should have been customer as I have switched modules rt ? . So any action I invoke in customer JSP is taken as \utilities\action.do . I dont know why the module name switching is not happening although action is switched correctly.

here are my codes.

I am submitting the action thru Javascript from a JSP page in utilities module and here is action that I submit.

* /actionSwitcherScoreCommand.do?prefix=/customer&page=/customerRegistrationNew.do *

* * * * *struts-config-utilities.xml *

*struts-config-customer.xml * * * *

JSP

CustomerRegistration.jsp in the customer module gets loaded OK.

Now the problem is , from this JSP if i invoke an action , the action path is taken as utilities/action.do , instead of customer/action.do ,

As far as my understanding , it shud switch the module rt ? Can you help me out please ? Is there anything else I need to do to switch action. I tried a lot googling..but found no solution.