Hi Rebecca,
Sorry for the lack of info on the JSFT site. Emailing here or asking on
the JSFTemplating IRC channel is your best bet.
The jsftemplating-dt.jar is only needed during compilation and doesn't
need to go into your .war file (although it won't hurt anything if it is
there -- it's just not needed).
The JSFT debug flag is does not effect the logging levels. To change
the logging level, set the "com.sun.jsftemplating" JUL debug level to
the desired level. JSFTemplating does not log as much useful
information as you probably hope to find, though... that's something
that can be improved. Mostly just more detailed exception messages,
which won't help you with this issue.
The first place to check when your handler is not getting called is the
"info.jsf" page:
http://localhost:8080/context/info.jsf
Replace "localhost", "8080", and "context" with appropriate values for
your deployed web application. If JSFTemplating's debug mode is enabled
(you said it is), this page will show you a list of all the Handler and
component factories that JSFTemplating is aware of. If you do not see
your "getMepUserInfo" handler in the list, this means you missed a step
(probably the apt compile step). If you do see it, then the event that
uses the handler is not getting fired.
It's good that you found information on the Handler.map file, this is
indeed the file that "configures" your handler so that it can get
found. It will not exist in the war file directly, but should be
packaged in your .jar file with your Handler (in
META-INF/jsftemplating/Handler.map inside the .jar). If you look at the
admin.jar (in GF v2) or one of several jar files in v3 (console-core,
console-web-plugin, console-updatecenter-plugin,
console-security-plugin, or console-common), you will find they each
have a Handler.map file.
If you find that your .jar file does not, this is either because it is
not being packaged w/ the .jar file when you build it, or you did not
compile with "apt" (instead of javac). I think there are instructions
on the jsftemplating website for building with apt, and there are
example "ant" build.xml files in jsftemplating (the "demo" folder
contains a good example). However, if you're building with mvn, I don't
know of a good example unless you're using an environment similar to
what we use in v3. In v3, our pom.xml looks like the attached pom.xml
(taken from v3/admingui/common/pom.xml).
When you run your page, do you get an error? If your handler is
unknown, I would expect that you get an error message.
Thanks,
Ken Paulsen
Rebecca Searls wrote:
>
>
> I need advise on how to debug the MEP admin screens. It does not
> appear my
> jsftemplate handler method is ever getting called. I'm trying to
> track down
> the problem. I've looked for advise on the jsftemplate project
> site but have
> not found any helpful information. What do you suggest?
>
> I'm using NB 6.1. I created a maven2 project. I defined a couple of
> screens using the GF jdbcConnectionPool.jsf and JdbcHandlers.java
> as the model.
> I created a UserHandlers.java class with a single annotated
> method, getMepUserInfo.
> As in jdbcConnectionPool.jsf right after the setResourceBundle
> stmt method
> getJDBCConnectionPoolMaps is called, I instead call
> getMepUserInfo. The code
> compiles cleanly and the war deploys and runs without exceptions
> (i.e. the defined
> screen components display successfully). I have the following
> jsftemplating files
> in my local maven repository and they get pulled into the war file.
>
>
> jsf-api-1.2_07.jar
> admin.jar jsf-impl-1.2_07.jar
> admin-en.jar jsftemplating.jar
> admin-jsf.jar jsftemplating-dt.jar
> jsftemplating-dynafaces-0.1.jar
>
>
> In my web.xml file I set com.sun.jsftemplating.DEBUG to true. I
> though I would see
> debugging information in the server.log file but didn't. I added
> print stmts to
> my method getMepUserInfo but see no output to server.log either.
>
> I found on the jsftemplating site that a UserHandlers.map file
> should get generated
> at build time but I don't see one. I looked for a
> JdbcHandlers.map file in the
> adminGUI_war but did not find one. Not sure how to interpert this.
>
>
> The only method in UserHandlers.java
>
> @Handler(id="getMepUserInfo",
> input={
> @HandlerInput(name="selectedRows", type=List.class)},
> output={
> @HandlerOutput(name="result", type=java.util.List.class)}
> )
>
> public static void getMepUserInfo(HandlerContext handlerCtx) {
> System.out.println("Entered getUserInfo");
> List<Map> selectedList =
> (List)handlerCtx.getInputValue("selectedRows");
> }
>
>
>
> The call to getMepUserInfo in userAccountsGeneral.jsf
>
> <sun:page id="page1">
> <!beforeCreate
> setResourceBundle(key="i18n"
> bundle="com.sun.enterprise.tools.admingui.resources.Strings");
> setResourceBundle(key="msg" bundle="com.sun.i18n.adminResources")
>
> getMepUserInfo(selectedRows="$attribute{selectedRows}"
> result=>$attribute{listOfRows} );
>
> setPageSessionAttribute(key="editLink"
> value="/userAccts/userEdit.jsf");
> setPageSessionAttribute(key="createLink" value="userNew.jsf");
> setPageSessionAttribute(key="listPageLink"
> value="/userAccts/userAccountsGeneral.jsf");
> setPageSessionAttribute(key="resourceType"
> value="userAccountsGeneral");
> />
>