dev@jsftemplating.java.net

Re: JSFTemplating: The self-defined handler can not be found

From: Anissa Lam <Anissa.Lam_at_Sun.COM>
Date: Thu, 15 Feb 2007 18:05:52 -0800

Hi Jim,
After changing the name of the method, did you 'clean and build project' ?
When you look at the Handler.map, does it show 'tt.getResponse' or
'Test.getResponse' ?

Anissa

Jim Jiang wrote:
> I have a basic question about JSFTemplate.
> I followed the guide 'Templating for JavaServer™ Faces Technology --
> NetBeans Project Tutorial' , and deploy and run the demo successfully.
> But when I tried to modified the demo to change handler name from
> Test.getResponse to * tt.*getResponse, I got below error when running
> abc.jsf.
>
> /javax.servlet.ServletException: Handler 'tt*.*getResponse' in event
> 'beforeEncode' is not declared! Ensure the '_at_Handler' annotation has
> been defined on the handler Java method, that it has been compiled
> with the annotation processing tool, and that the resulting
> 'META-INF/jsftemplating/Handler.map' is located in your classpath (you
> may need to do a clean build)./
>
>
> I only changed 2 place:
> One is in abc.jsf: (the bold text)
> <!beforeEncode
> * tt.*getResponse(upper(userInput="#{in}" response=>$pageSession{foo});
> />
> Another is in ExampleHandlers.java
> @Handler(id="*tt*.getResponse",
> input={
> @HandlerInput(name="userInput", type=String.class)
> },
> output={
> @HandlerOutput(name="response", type=String.class)
> })
>
> I make sure that the file META-INF/jsftemplating/Handler.map is
> generated in the war WEB-INF/lib directory.
> but the info.jsf always show the handler I defined, it always show
> Test.getReponse.
>
> Any other place need to be changed for just renaming handler?
> BTW, I use Netbean 5.5.
>
> Thanks,
> Jim