beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlin Rogers <>
Subject Re: TagUtils.computeURL() and dynamic module registration
Date Tue, 31 May 2005 23:39:57 GMT

No, we don't have a general method such as that.

The original issue with the case that a given ModuleConfig is not
registered yet is due to the fact that we don't know all the
modules at start up.

As a work around, maybe you could create a utility for this
specific case, the first step being to ensure that the
ModuleConfig is registered for the given path.

You might try the following to see if this would work.
You could get the ActionServlet from the ServletContext...

( ActionServlet ) context.getAttribute( Globals.ACTION_SERVLET_KEY );

Then check to see if the ActionServlet is an instance of
If so, you could call the method ensureModuleRegistered()
with the module path. I don't think this method was really
designed for something like this but it is public.

Just a thought,

DeHamer, Brian wrote:

> Carlin,
> Thanks for the pointer -- that's pretty close, but not everything that I
> was hoping for.  The thing I like about the TagUtils.computeURL() method
> is that I can pass it, among other things, a forward, an href, a page,
> and an action and it will sort out all the details for me.  On any
> particular call all but one of those will likely be null, but I don't
> have to worry about which is which -- I just pass them all in and get
> back the appropriate URL.
> Brian
> -----Original Message-----
> From: Carlin Rogers [] 
> Sent: Tuesday, May 31, 2005 3:39 PM
> To: Beehive Users
> Subject: Re: TagUtils.computeURL() and dynamic module registration
> Hi Brian,
> Yes, The org.apache.beehive.netui.pageflow.PageFlowUtils class has a
> method that I think you're looking for.
>      getRewrittenActionURI()
> e/beehive/netui/pageflow/PageFlowUtils.html
> Hope this helps,
> Carlin
> DeHamer, Brian wrote:
>>As part of my application I have a number of custom tags that make use
>>of the org.apache.struts.taglib.TagUtils.computeURL() method to assist
>>in the rendering of URLs that are generated by my tags.  Among the 
>>parameters that can be specified for the computeURL() method are an 
>>action name and module name -- the resulting URI will be the 
>>context-relative path to the specified action in the specified module.
>>This was working fine for me under vanilla Struts, however it doesn't 
>>appear to work under JPF.  It appears that the problem is related to 
>>the dynamic module registration that is used by the
> PageFlowActionServlet.
>>When the TagUtils.computeURL() method attempts to generate the URL it 
>>checks to make sure that the named ModuleConfig object can be found in
>>application scope -- however, under JPF, if no request has yet been 
>>made against that module the ModuleConfig won't exist and computeURL()
> fails.
>>Does JPF provide something similar to the TagUtils.computeURL() method
>>that will work for me?  If not, is there some way to force all the 
>>modules to be loaded at start time?  Any suggestions/work-arounds are 
>>welcome.  Thanks.
>>Brian DeHamer
>>Hewlett-Packard Co.

View raw message