[EMAIL PROTECTED] wrote:
The issue fixed centered on actions/modules with similar names - it doesn't sound like this is your problem, but I highly recommend you upgrade just the same.What makes you say this? Which build are you using? You probably want to be using a nightly build if you're using modules. There was a bug for a while that is fixed in the nightly build.My problem is when im in my module called "module1", it seems action mapping is schearching for actions in my default struts-congig.xml file?...
I'm not aware of this bug fix. I'm using struts 1.1b2.
I don't think this is what's going on. Globals.APPLICATION_KEY (or, in recent builds Globals.MODULE_KEY) will point to the default module config in application scope, and the current module config in request scope - the form tag uses the one from request scope.I think action mapping is schearching for actions in my default struts-config.xml file because when i put actions called in module1 in default struts-config.xml, it finds them...
Where are you executing the page from? ... your default module? That would be a special case. In the case that you could prepend the module prefix, because Struts isn't going to attempt to do this (that's not totally accurate. It will prepend the prefix, but the prefix for the default module is the empty string.), so you're safe to do it yourself. I can't imagine why you'd want a page in the default module to submit to a non-default module, but that's how you could go about it.When i put module1 actions in struts-module1.xml, it can't find any module1 action...
My approach to this is to use local/global forwards that set the contextRelative property to true - and typically redirect instead of forward (redirect="true"). Setting contextRelative="true" (and specifying a path relative to the application, instead of relative to the module) is another way to do this same thing. I'm not sure why SwitchAction isn't working for you - last I tried it it worked fine. I haven't messed with it for some time though.I also try to switch from my welcome page to my module1 and get : "Invalid sub-application prefix activiteReduite was specified" when using SwitchAction... :-(SwitchAction takes two request parameters: - prefix: the name of the module (module1 in your example) - page: the action you wish to invoke It sounds to me like you gave it an invalid module name.Yes. I agree. My problem is i gave the right module name. Perhaps, the page parameter is not good? I put a jsp page name in that parameter...
Yes i can.It sounds like you're setting things up right in your web.xml, etc. I don't have enough information about your two modules to formulate a hypothesis about what is going wrong. Could you elaborate?What did i do wrong? Thanks for help. Alexandre.
So, i have 2 modules : - default
- module1
I have my root directory for my default module and root/module1 directory for the other one.
In my web-inf directory, I have struts-config.xml file populated with action for default module and struts-module1.xml for module1 module.
my web.xml file declares my 2 module as i wrote in my first mail.
When trying to invoque an action in module1 i do :
<html:form action="myModule1Action.do">
That should work - or you should be able to say "/myModule1Action.do"
do in need to do : <html:form action="/module1/myModule1Action.do"> ???This shouldn't work. Struts will prepend the module prefix itself. Incidentally, this would make it rather difficult to submit to an action in one non-default module from another non-default module (that I can see) without possibly using a SwitchAction or defining a "go-between" action that would forward to a different module. I think things could get really hairy really quick if you did things like that though - I wouldn't suggest it.
You haven't really gotten terribly explicit about your config yet :-) I was kind of in hopes you would give me something so that I could construct a mental image of how your pieces are layed out. Hopefully I have guessed pretty well about how things are laid out. If you continue to have problems just post back again.Thank for trying to help me. Alexandre.
--
Eddie Bush
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>