You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Bernagou <bl...@gmail.com> on 2007/11/14 11:48:00 UTC

T5.06 Project tree

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>
<title>Paper 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>
<p>Si vous n'avez pas encore de compte, <t:pagelink page="Register">crees-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...


-- 
Michael Bernagou
Java Developper

Re: T5.06 Project tree

Posted by Michael Bernagou <bl...@gmail.com>.
Hum, since 5.0.6 tml fles can go to the webapp root folder.
:(

2007/11/14, Chris Lewis <ch...@bellsouth.net>:
>
> Where is your template for the start page (Start.tml)? If I'm not
> mistaken the archetype sticks it in WEB-INF, which I believe is wrong. I
> didn't run into a bug until I contributed a LibraryMapping to the
> component class resolver...
>
> Michael Bernagou wrote:
> > 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 <mi...@gmail.com>:
> >
> >> 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 <jo...@progs.be>:
> >>>
> >>>
> >>>> 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>
> >>>>> <title>Paper 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>
> >>>>> <p>Si vous n'avez pas encore de compte, <t:pagelink
> >>>>>
> >>>>>
> >>>> page="Register">crees-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: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >
> >
> >
>
>


-- 
Michael Bernagou
Java Developper

Re: T5.06 Project tree

Posted by Chris Lewis <ch...@bellsouth.net>.
Where is your template for the start page (Start.tml)? If I'm not 
mistaken the archetype sticks it in WEB-INF, which I believe is wrong. I 
didn't run into a bug until I contributed a LibraryMapping to the 
component class resolver...

Michael Bernagou wrote:
> 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 <mi...@gmail.com>:
>   
>> 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 <jo...@progs.be>:
>>>
>>>       
>>>> 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>
>>>>> <title>Paper 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>
>>>>> <p>Si vous n'avez pas encore de compte, <t:pagelink
>>>>>
>>>>>           
>>>> page="Register">crees-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: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>         
>>>
>>>       
>>     
>
>
>   


Re: T5.06 Project tree

Posted by Michael Bernagou <bl...@gmail.com>.
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 <mi...@gmail.com>:
>
> 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 <jo...@progs.be>:
> >
> >> 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>
> >>> <title>Paper 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>
> >>> <p>Si vous n'avez pas encore de compte, <t:pagelink
> >>>
> >> page="Register">crees-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: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>


-- 
Michael Bernagou
Java Developper

Re: T5.06 Project tree

Posted by Michael Courcy <mi...@gmail.com>.
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 <jo...@progs.be>:
>   
>> 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>
>>> <title>Paper 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>
>>> <p>Si vous n'avez pas encore de compte, <t:pagelink
>>>       
>> page="Register">crees-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: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>   


Re: T5.06 Project tree

Posted by Michael Bernagou <bl...@gmail.com>.
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 <jo...@progs.be>:
>
> 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>
> > <title>Paper 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>
> > <p>Si vous n'avez pas encore de compte, <t:pagelink
> page="Register">crees-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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Michael Bernagou
Java Developper

Re: T5.06 Project tree

Posted by Joachim Van der Auwera <jo...@progs.be>.
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>
> <title>Paper 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>
> <p>Si vous n'avez pas encore de compte, <t:pagelink page="Register">crees-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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5.06 Project tree

Posted by Ezra Epstein <ez...@yahoo.com>.
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 <bl...@gmail.com> 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