Re: T5.06 Project tree
Have you started using the project archetype? This is the easiest way to have a correct directory srtucture. Anyway, I think the paths should be MyProject/src/papo/pages/ MyProject/src/papo/services/ Kind regards, Joachim Michael Bernagou wrote: I have something strange and it made me asking this question : What are the mandatory project tree elements? (sorry for my english I don't now how to write it differently). So, my project is : MyProject/src/papo.pages/[all pages such as Start.java and Start.properties] MyProject/src/papo.services/[ioc stuff] MyProject/webroot/[all template such as Start.tml and Start_fr.tml] But I have this error : java.lang.RuntimeException Page Start did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering. Start.tml: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titlePaper and Pen Online/title /head body form t:type=BeanEditForm object=login t:parameter name=password label t:type=Label for=password/label input t:type=PasswordField t:id=password t:validate=required t:value=login.password / /t:parameter /form pSi vous n'avez pas encore de compte, t:pagelink page=Registercrees-en un!!/t:pagelink/p p color=red${message}/p /body /html *** Start.java: package papo.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.ioc.annotations.Inject; import papo.data.Login; import papo.data.UserLite; import papo.exception.PapoException; import papo.model.User; import papo.services.ApplicationService; import papo.services.UserService; /** * Start page of application papo. */ public class Start { private static final String SUCCESS = Home; private static final String FAILURE = Start; @Persist private Login login; public Login getLogin() { return login; } public void setLogin(Login login) { this.login = login; } private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = Login ou Password inconnue. L'identification a échoué.; return FAILURE; } } catch (PapoException pe) { message = La procedure d'identification a rencontré un probleme !!; return null; } return SUCCESS; } } It didn't enter in Start.java (I put a debug point) because it was not able to compile or find the Start.tml. Usually, when it found a compilation problem, the error message explicitely explain where is the line in the template, but in my case, I have only a stack trace. When I see the Snapshot for the typicall project, there is something else as Project tree, and I don't want to follow the architecture. Having the webroot folder in the src/main and the java in the src/main/java is not logic for me. A web application is not defined like that usually, why to change the way? But this is another subject... -- Joachim Van der Auwera PROGS bvba, progs.be, blog.progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5.06 Project tree
No I didn't because I don't understand why the webroot should be in the src directory. About that : MyProject/src/papo/pages/ MyProject/src/papo/services/ It is what I have but I wrote in my message MyProject/src/papo.pages/ MyProject/src/papo.services/ instead, just to show it is packages in the point of view of eclipse and java. The debug mode show me the Start.java is normally compiled and Tapestry describe what it did with at runtime : replacing method, etc... 2007/11/14, Joachim Van der Auwera [EMAIL PROTECTED]: Have you started using the project archetype? This is the easiest way to have a correct directory srtucture. Anyway, I think the paths should be MyProject/src/papo/pages/ MyProject/src/papo/services/ Kind regards, Joachim Michael Bernagou wrote: I have something strange and it made me asking this question : What are the mandatory project tree elements? (sorry for my english I don't now how to write it differently). So, my project is : MyProject/src/papo.pages/[all pages such as Start.java and Start.properties] MyProject/src/papo.services/[ioc stuff] MyProject/webroot/[all template such as Start.tml and Start_fr.tml] But I have this error : java.lang.RuntimeException Page Start did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering. Start.tml: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titlePaper and Pen Online/title /head body form t:type=BeanEditForm object=login t:parameter name=password label t:type=Label for=password/label input t:type=PasswordField t:id=password t:validate=required t:value=login.password / /t:parameter /form pSi vous n'avez pas encore de compte, t:pagelink page=Registercrees-en un!!/t:pagelink/p p color=red${message}/p /body /html *** Start.java: package papo.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.ioc.annotations.Inject; import papo.data.Login; import papo.data.UserLite; import papo.exception.PapoException; import papo.model.User; import papo.services.ApplicationService; import papo.services.UserService; /** * Start page of application papo. */ public class Start { private static final String SUCCESS = Home; private static final String FAILURE = Start; @Persist private Login login; public Login getLogin() { return login; } public void setLogin(Login login) { this.login = login; } private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = Login ou Password inconnue. L'identification a échoué.; return FAILURE; } } catch (PapoException pe) { message = La procedure d'identification a rencontré un probleme !!; return null; } return SUCCESS; } } It didn't enter in Start.java (I put a debug point) because it was not able to compile or find the Start.tml. Usually, when it found a compilation problem, the error message explicitely explain where is the line in the template, but in my case, I have only a stack trace. When I see the Snapshot for the typicall project, there is something else as Project tree, and I don't want to follow the architecture. Having the webroot folder in the src/main and the java in the src/main/java is not logic for me. A web application is not defined like that usually, why to change the way? But this is another subject... -- Joachim Van der Auwera PROGS bvba, progs.be, blog.progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michael Bernagou Java Developper
Re: T5.06 Project tree
Well it's a matter of convention When maven build the project, things are in the place they have to be. Michael Bernagou a écrit : No I didn't because I don't understand why the webroot should be in the src directory. About that : MyProject/src/papo/pages/ MyProject/src/papo/services/ It is what I have but I wrote in my message MyProject/src/papo.pages/ MyProject/src/papo.services/ instead, just to show it is packages in the point of view of eclipse and java. The debug mode show me the Start.java is normally compiled and Tapestry describe what it did with at runtime : replacing method, etc... 2007/11/14, Joachim Van der Auwera [EMAIL PROTECTED]: Have you started using the project archetype? This is the easiest way to have a correct directory srtucture. Anyway, I think the paths should be MyProject/src/papo/pages/ MyProject/src/papo/services/ Kind regards, Joachim Michael Bernagou wrote: I have something strange and it made me asking this question : What are the mandatory project tree elements? (sorry for my english I don't now how to write it differently). So, my project is : MyProject/src/papo.pages/[all pages such as Start.java and Start.properties] MyProject/src/papo.services/[ioc stuff] MyProject/webroot/[all template such as Start.tml and Start_fr.tml] But I have this error : java.lang.RuntimeException Page Start did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering. Start.tml: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titlePaper and Pen Online/title /head body form t:type=BeanEditForm object=login t:parameter name=password label t:type=Label for=password/label input t:type=PasswordField t:id=password t:validate=required t:value=login.password / /t:parameter /form pSi vous n'avez pas encore de compte, t:pagelink page=Registercrees-en un!!/t:pagelink/p p color=red${message}/p /body /html *** Start.java: package papo.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.ioc.annotations.Inject; import papo.data.Login; import papo.data.UserLite; import papo.exception.PapoException; import papo.model.User; import papo.services.ApplicationService; import papo.services.UserService; /** * Start page of application papo. */ public class Start { private static final String SUCCESS = Home; private static final String FAILURE = Start; @Persist private Login login; public Login getLogin() { return login; } public void setLogin(Login login) { this.login = login; } private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = Login ou Password inconnue. L'identification a échoué.; return FAILURE; } } catch (PapoException pe) { message = La procedure d'identification a rencontré un probleme !!; return null; } return SUCCESS; } } It didn't enter in Start.java (I put a debug point) because it was not able to compile or find the Start.tml. Usually, when it found a compilation problem, the error message explicitely explain where is the line in the template, but in my case, I have only a stack trace. When I see the Snapshot for the typicall project, there is something else as Project tree, and I don't want to follow the architecture. Having the webroot folder in the src/main and the java in the src/main/java is not logic for me. A web application is not defined like that usually, why to change the way? But this is another subject... -- Joachim Van der Auwera PROGS bvba, progs.be, blog.progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5.06 Project tree
So is it why my start.tml is not found?? If yes (I'm really not sure), I'm very surprised about the miss of flexibility T5 have... For an existing project build in the usual way (Project/src, Project/webroot), having to change this just for T5 is veru bad... 2007/11/14, Michael Courcy [EMAIL PROTECTED]: Well it's a matter of convention When maven build the project, things are in the place they have to be. Michael Bernagou a écrit : No I didn't because I don't understand why the webroot should be in the src directory. About that : MyProject/src/papo/pages/ MyProject/src/papo/services/ It is what I have but I wrote in my message MyProject/src/papo.pages/ MyProject/src/papo.services/ instead, just to show it is packages in the point of view of eclipse and java. The debug mode show me the Start.java is normally compiled and Tapestry describe what it did with at runtime : replacing method, etc... 2007/11/14, Joachim Van der Auwera [EMAIL PROTECTED]: Have you started using the project archetype? This is the easiest way to have a correct directory srtucture. Anyway, I think the paths should be MyProject/src/papo/pages/ MyProject/src/papo/services/ Kind regards, Joachim Michael Bernagou wrote: I have something strange and it made me asking this question : What are the mandatory project tree elements? (sorry for my english I don't now how to write it differently). So, my project is : MyProject/src/papo.pages/[all pages such as Start.java and Start.properties] MyProject/src/papo.services/[ioc stuff] MyProject/webroot/[all template such as Start.tml and Start_fr.tml] But I have this error : java.lang.RuntimeException Page Start did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering. Start.tml: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titlePaper and Pen Online/title /head body form t:type=BeanEditForm object=login t:parameter name=password label t:type=Label for=password/label input t:type=PasswordField t:id=password t:validate=required t:value=login.password / /t:parameter /form pSi vous n'avez pas encore de compte, t:pagelink page=Registercrees-en un!!/t:pagelink/p p color=red${message}/p /body /html *** Start.java: package papo.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.ioc.annotations.Inject; import papo.data.Login; import papo.data.UserLite; import papo.exception.PapoException; import papo.model.User; import papo.services.ApplicationService; import papo.services.UserService; /** * Start page of application papo. */ public class Start { private static final String SUCCESS = Home; private static final String FAILURE = Start; @Persist private Login login; public Login getLogin() { return login; } public void setLogin(Login login) { this.login = login; } private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = Login ou Password inconnue. L'identification a échoué.; return FAILURE; } } catch (PapoException pe) { message = La procedure d'identification a rencontré un probleme !!; return null; } return SUCCESS; } } It didn't enter in Start.java (I put a debug point) because it was not able to compile or find the Start.tml. Usually, when it found a compilation problem, the error message explicitely explain where is the line in the template, but in my case, I have only a stack trace. When I see the Snapshot for the typicall project, there is something else as Project tree, and I don't want to follow the architecture. Having the webroot folder in the src/main and the java in the src/main/java is not logic for me. A
Re: T5.06 Project tree
The main requirement for folder structure is based on on Tapestry but on the servlet specification. Web accessible files in a .war cannot but in the WEB-INF folder. Tapestry lets you put .tml files either in the the regular place for web accessible files or in the WEB-INF at the same location (folder/package) as the corresponding .class file. How one chooses to layout a folder during dev is, for my money, 100% up to the developer. That said, there are certain layouts that work very well with certain tools. For example, I use Eclipse. I start with a Dynamic Web Project type, stick all the .tml files in the WebRoot folder, all the .java files in the src folder and everything works fine and I can launch the app without packaging a .war file. I can launch it via either Tomcat or Jetty too. HTH Michael Bernagou [EMAIL PROTECTED] wrote: I have something strange and it made me asking this question : What are the mandatory project tree elements? (sorry for my english I don't now how to write it differently). So, my project is : MyProject/src/papo.pages/[all pages such as Start.java and Start.properties] MyProject/src/papo.services/[ioc stuff] MyProject/webroot/[all template such as Start.tml and Start_fr.tml] But I have this error : java.lang.RuntimeException Page Start did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering. Start.tml: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; Paper and Pen Online [input] t:value=login.password / Si vous n'avez pas encore de compte, crees-en un!! ${message} *** Start.java: package papo.pages; import org.apache.tapestry.annotations.ApplicationState; import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; import org.apache.tapestry.ioc.annotations.Inject; import papo.data.Login; import papo.data.UserLite; import papo.exception.PapoException; import papo.model.User; import papo.services.ApplicationService; import papo.services.UserService; /** * Start page of application papo. */ public class Start { private static final String SUCCESS = Home; private static final String FAILURE = Start; @Persist private Login login; public Login getLogin() { return login; } public void setLogin(Login login) { this.login = login; } private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } @ApplicationState private User user; @InjectPage private Home home; @Inject private UserService userService; @Inject private ApplicationService applicationService; String onSuccess() { try { user = userService.getAuthenticatedUser(login.getLogin(), login.getPassword()); if (user != null) { home.setUser(user); UserLite userLite = new UserLite(user.getLogin()); applicationService.makeOnline(userLite); home.setUsers(applicationService.getUserList().getUserList()); } else { message = Login ou Password inconnue. L'identification a échoué.; return FAILURE; } } catch (PapoException pe) { message = La procedure d'identification a rencontré un probleme !!; return null; } return SUCCESS; } } It didn't enter in Start.java (I put a debug point) because it was not able to compile or find the Start.tml. Usually, when it found a compilation problem, the error message explicitely explain where is the line in the template, but in my case, I have only a stack trace. When I see the Snapshot for the typicall project, there is something else as Project tree, and I don't want to follow the architecture. Having the webroot folder in the src/main and the java in the src/main/java is not logic for me. A web application is not defined like that usually, why to change the way? But this is another subject... -- Michael Bernagou Java Developper