dev@jsftemplating.java.net

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

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Fri, 16 Feb 2007 00:39:38 -0800

Yes, it sounds like your directory structure is fine. Here's what I'd
do first to try to debug it:

Find your GlassFish installation and goto domains/domain1/config and
look at the domain.xml to see where your app is deployed (it might not
be where you think it is). Then I'd goto that directory and double
check that in the WEB-INF/lib directory there is a .jar file w/ a
Handler.map file with the expected contents.

Hopefully that will show you the error... b/c there isn't much more to
it then that! :)

Ken

Jim Jiang wrote:
> I tried restart and redeploy, but they not works.
> How to make sure my change is in the classpath?
> As i said before, META-INF/jsftemplating/Handler.map is generated in
> the war WEB-INF/lib directory.
> I use Netbean jsf wizard to create project, does the war file
> structure it generated meet the requirement jsftemplate?
>
> Thanks,
> Jim
>
> Ken Paulsen wrote:
>
>>
>> If it's still showing "Test.getResponse" on the info.jsf page, then
>> one of the following must be happening:
>>
>> 1) Your changes aren't in the classpath.
>> 2) You haven't restarted the server (or redeployed the app)
>>
>> The container's classloader caches things in the classpath, so
>> redeploying or restarting the server is necessary. You can also use
>> the ".reload" feature, which essentially redeploys... I've had
>> problems w/ this feature in the past, but I think those problems have
>> been addressed.
>>
>> Good luck!
>>
>> Ken
>>
>>
>> Jim Jiang wrote:
>>
>>> Both answer is 'Yes'.
>>> I clean and build project , the Handler.map show the
>>> 'tt.getResponse' .
>>> The only difference between my step with the guide is that I copy
>>> all the needed jar to <glassfish>/lib, to reduce the war size for
>>> quicker deployment.
>>>
>>> Thanks,
>>> Jim
>>>
>>> Anissa Lam wrote:
>>>
>>>> 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
>>>>
>>>>