AnsweredAssumed Answered

Get Request url inside rule action

Question asked by blc on Jun 10, 2009
Hi,

I have a problem to get the request url (http://hostname/) from within a java action. I have created an action which extends ActionExecuterAbstractBase. Within the java code, I want to get the request url so that I can pass the hostname to external program using Runtime class. I have tried using the


public class MyActionExecuter extends ActionExecuterAbstractBase
…….
…….
   protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
   {
      ……
      FacesContext fc = FacesContext.getCurrentInstance();
      HttpServletRequest request = (HttpServletRequest)fc.getExternalContext().getRequest();
      ……
   }

   protected void addParameterDefinitions(List<ParameterDefinition> paramList)
   {
   }
}

but it return null for fc reference.

Outcomes