You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Kolesnikov, Alexander GNI" <Al...@CIGNA.com> on 2007/09/19 12:45:17 UTC

[T5] Can't make custom library work

I am trying to create and use a trivial custom library.

Here is the component:

TestComp.java:

package com.test.components;

public class TestComp {
	public String getMessage() {
		return "Test message";
	}
}

TestComp.html:

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
	<p>${message}</p>
</html>

Here is its module:

package com.test;

import org.apache.tapestry.ioc.Configuration;
import org.apache.tapestry.services.LibraryMapping;

public class TestModule {
	public static void
contributeComponentClassResolver(Configuration<LibraryMapping>
configuration){
		configuration.add(new LibraryMapping("test",
"com.test"));
	} 
}

Here is the manifest:

Manifest-Version: 1.0
Tapestry-Module-Classes: com.test.TestModule


The testlib.jar is packaged like so:

META-INF/MANIFEST.MF
com/test/TestModule.class
com/test/components/TestComp.class
com/test/components/TestComp.html

This JAR is placed into WEB-INF/lib of a T5 application and I am trying
to display the test component like so:

<t:test.TestComp/>

The result is:

Unable to resolve component type 'test/TestComp' to a component class
name. Available component types: core/ActionLink, core/BeanEditForm,
core/Checkbox, core/ComponentMessages, core/Delegate, core/Errors,
core/Form, core/FormSupportImpl, core/Grid, core/GridCell,
core/GridColumns, core/GridPager, core/GridRows, core/If, core/Label,
core/Loop, core/Output, core/OutputRaw, core/PageLink, core/Palette,
core/PasswordField, core/Radio, core/RadioGroup, core/RenderObject,
core/Select, core/Submit, core/TextArea, core/TextField,
fckeditor/Editor, jscalendar/DatePicker.

Why Tapestry doesn't see my component I wonder?

------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown.  This email transmission may contain confidential information.  This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly.  Please delete it from your files if you are not the intended recipient.  Thank you for your compliance.  Copyright 2007 CIGNA
==============================================================================

Re: [T5] Can't make custom library work

Posted by Alex Shneyderman <a....@gmail.com>.
hmm, I am no tapestry expert but when you refer to component as

<t:test.TestComp/>

would not your class have to live under the FQN of

com.test.components.test.TestComp?

Yours looks like it is com.test.components.TestComp

Alex.

On 9/19/07, Kolesnikov, Alexander      GNI
<Al...@cigna.com> wrote:
> I am trying to create and use a trivial custom library.
>
> Here is the component:
>
> TestComp.java:
>
> package com.test.components;
>
> public class TestComp {
>         public String getMessage() {
>                 return "Test message";
>         }
> }
>
> TestComp.html:
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>         <p>${message}</p>
> </html>
>
> Here is its module:
>
> package com.test;
>
> import org.apache.tapestry.ioc.Configuration;
> import org.apache.tapestry.services.LibraryMapping;
>
> public class TestModule {
>         public static void
> contributeComponentClassResolver(Configuration<LibraryMapping>
> configuration){
>                 configuration.add(new LibraryMapping("test",
> "com.test"));
>         }
> }
>
> Here is the manifest:
>
> Manifest-Version: 1.0
> Tapestry-Module-Classes: com.test.TestModule
>
>
> The testlib.jar is packaged like so:
>
> META-INF/MANIFEST.MF
> com/test/TestModule.class
> com/test/components/TestComp.class
> com/test/components/TestComp.html
>
> This JAR is placed into WEB-INF/lib of a T5 application and I am trying
> to display the test component like so:
>
> <t:test.TestComp/>
>
> The result is:
>
> Unable to resolve component type 'test/TestComp' to a component class
> name. Available component types: core/ActionLink, core/BeanEditForm,
> core/Checkbox, core/ComponentMessages, core/Delegate, core/Errors,
> core/Form, core/FormSupportImpl, core/Grid, core/GridCell,
> core/GridColumns, core/GridPager, core/GridRows, core/If, core/Label,
> core/Loop, core/Output, core/OutputRaw, core/PageLink, core/Palette,
> core/PasswordField, core/Radio, core/RadioGroup, core/RenderObject,
> core/Select, core/Submit, core/TextArea, core/TextField,
> fckeditor/Editor, jscalendar/DatePicker.
>
> Why Tapestry doesn't see my component I wonder?
>
> ------------------------------------------------------------------------------
> CONFIDENTIALITY NOTICE: If you have received this email in error, please immediately notify the sender by e-mail at the address shown.  This email transmission may contain confidential information.  This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly.  Please delete it from your files if you are not the intended recipient.  Thank you for your compliance.  Copyright 2007 CIGNA
> ==============================================================================
>


-- 
Thanks,
Alex.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org