You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Hendrikx, John" <Jo...@bmw.nl> on 2006/02/24 16:48:06 UTC

InjectObject annotation for Component

I'm having a problem injecting a WebRequest into my Tapestry Component.
Here is the code I use:

 

public abstract class Menu extends BaseComponent {

  @InjectObject("infrastructure:request")

  protected abstract WebRequest getWebRequest();

}

 

When I load the page using this component I get the following:

 

org.apache.hivemind.ApplicationRuntimeException

Error at context:/com/bmw/tapestry/components/menu/Menu.jwc, line 6,
column 120: Method 'protected abstract
org.apache.tapestry.web.WebRequest
com.bmw.tapestry.components.menu.Menu.getWebRequest()' (declared in
class com.bmw.tapestry.components.menu.Menu) has no implementation in
class com.bmw.tapestry.components.menu.Menu (or enhanced subclass
$Menu_1).

 

Line 6 in Menu.jwc containts the component specification:

 

<component-specification class="com.bmw.tapestry.components.menu.Menu"
allow-body="no" allow-informal-parameters="yes">

 

I've looked through the mailing list archives, but cannot find a mention
of this specific problem.  I did find that the Tapestry annotation only
work for Pages and Components, but since I'm creating a Component I
think this should work.  For now I've worked around this by using the
deprecated method in IRequestCycle to get at the WebRequest /
HttpServletRequest.

 

Any help with this would be appreciated.

 

Another problem I'm having, but which isn't really that much of an issue
(just weird at the moment) is that it takes a full 30 seconds before
Tapestry renders the first page after I restart the BEA WebLogic server
I'm using; subsequent pages seem fast.  Is this normal for Tapestry 4.0
or is the issue likely to be somewhere else?

 

--John