On 2018-01-12 23:26, Yasser Zamani <yasserzam...@apache.org> wrote: 
> 
> 
> On 1/11/2018 11:13 AM, sim4...@gmail.com wrote:
> > My question is originally posted here:
> > https://stackoverflow.com/questions/48166761/struts-2-multiple-configuration-files-and-global-results-for-different-namespace
> > 
> > But it is incorrectly marked as duplicate. Due to less formatting options, 
> > I'll be brief.
> > I'm migrating a big struts1 application to struts2. Basically, I have a 
> > package in config file A with namespace="/" and some global-results. I want 
> > to access those global-results with config file A package namespace="/" in 
> > other config file X with package namespace="/Xname".
> > 
> > My current solution extends config file A package in config file X package. 
> > I want to access global result jsp at the url: /common/global-test.jsp as a 
> > result forwarded from config file X action class.
> > However, it is incorrectly adding config file X package namespace in 
> > fetching the jsp file as /Xname/common/global-test.jsp.
> > 
> > Any suggestions?
> 
> Do you have a slash (/) at beginning of your result value? I get same 
> error like you when I don't haven that slash but works with a starting 
> slash. My working example:
> 
>       <package name="default" namespace="/" extends="struts-default">
> 
>               <global-results>
>                       <result 
> name="globalResult1">/WEB-INF/content/hello.jsp</result><!-- 
> starts with slash -->
>               </global-results>
> ...
> 
> ...
>       <package name="commerce" extends="default" namespace="/commerce">
> 
>               <action name="knobhead"
>                               
> class="me.zamani.yasser.ww_convention.actions.CategoriesAction">
>                       <result name="success" 
> type="tiles">commerce.categories</result>
>               </action>
> </struts>
> 
> ...
> 
> package me.zamani.yasser.ww_convention.actions;
> 
> public class CategoriesAction {
>      public String execute()
>      {
>          return "globalResult1";
>      }
> }
> 

Yes, that was the problem. Huge thanks, Yasser!!!
I prepended a '/' for the global-result and it worked.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to