Eider Iturbe wrote:

Hi!

I'm looking for a method in org.apache.struts.action.ActionMapping that
returns the name of the action or jsp that has
invoked my action (this action is the owner of the ActionMapping). Which is
this method ?

thanks in advance,


You can find all  forward names and paths {

String REQUEST_PATH  ="module/myaction";

ModuleConfig module = (ModuleConfig) actionServlet.getServletContext().getAttribute("org.apache.struts.action.MODULE");

ActionConfig thisConfig = module.findActionConfig(REQUEST_PATH);

forwardConfigs = thisConfig.findForwardConfigs();
       for(int i=0; i<forwardConfigs.length; i++)
       {
           ForwardConfig config = forwardConfigs[i];
           String actionForward = config.getName());
           String actionPath = config.getPath());
       }

I cannot find any variable that holds current action path returned from execute method. But can find the action path.
if you use tiles:

ComponentContext realMap = (ComponentContext) request.getAttribute("org.apache.struts.taglib.tiles.CompContext");

       Iterator realIter = realMap.getAttributeNames();
      while(realIter.hasNext())
      {
          String tileName = (String) realIter.next();
          String path  =  realMap.getAttribute(name);
      }


rukka






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to