Access to non declared entity members not checked at build time
Actual behaviour:
- code contains:
var usr := User{};
form{
table{
row{ "Name: " input(usr.name) }
// …- User entity has no name declared
- no errors show up at build time.
- when accessing the form after subsion a 500 erro shows up:
java.lang.Error: Unresolved compilation problem:
The method setName(String) is undefined for the type Userexampleapp.beans.loginForm_Template.storeInputsInternal(loginForm_Template.java:1294)
exampleapp.beans.loginForm_Template.storeInputs(loginForm_Template.java:68)
exampleapp.beans.templateargument1_Template.storeInputsInternal(templateargument1_Template.java:477)
exampleapp.beans.templateargument1_Template.storeInputs(templateargument1_Template.java:68)
exampleapp.beans.mainString_Template.storeInputsInternal(mainString_Template.java:1652)
exampleapp.beans.mainString_Template.storeInputs(mainString_Template.java:70)
exampleapp.beans.login_Template.storeInputsInternal(login_Template.java:477)
exampleapp.beans.login_Template.storeInputs(login_Template.java:68)
exampleapp.beans.LoginPage.serve(LoginPage.java:80)
utils.DispatchServletHelper.handlePage(DispatchServletHelper.java:316)
utils.DispatchServletHelper.doServe(DispatchServletHelper.java:281)
utils.DispatchServlet.doPost(DispatchServlet.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)Expected behaviour:
Submitted by Tim on 26 February 2010 at 15:29
- Error at compile time
Issue Log
Possible duplicate of WebDSL/33.
Note that the ‘name’ property is special case, it is declared for each entity (default is the id if there is no name property, derived property, or property with name annotation). The name property is used as the reference to an entity in inputs, e.g. input of a Set. However, it is not always a real property that can be assigned to, and there should indeed be a check that ensures there are no inputs or assignments in that case.
Log in to post comments