AFAIK you should not use String for ApplicationsStateObjects nor other primitive types at all .. only complex types with a no arg constructor. if you must use a different constructor you have to contribute to the ApplicationStateManager to tell the service how to create the instances properly
g, kris Baptiste Meurant <[EMAIL PROTECTED]> 18.03.2008 12:18 Bitte antworten an "Tapestry users" <users@tapestry.apache.org> An users@tapestry.apache.org Kopie Thema Re: ApplicationState annotation problem since 5.0.11 Hi Thank you for your quick answer. If I understand well, I have to create a custom ApplicationStateContribution to handle ApplicationState on String class ? Do you have some tips or instructions to do this ? I will try and tell you the result. I am just surprised that this configurations was working well before 5.0.11 version ... Thanks, Regards, Alec Leamas-2 wrote: > > Hi! > > What are you really trying to do here? For me, this looks like a typo. > Have you contributed an ApplicationStateObject? Then you need to refer > to this. I'm pretty sure Tapestry doen't have a String ApplicationState > object in place... > > I would expect something like > > @ApplicationState > private MyClass myInstance; > > Where MyClass is contributed to ApplicationStateManager in AppModule.java. > > Hope this helps.. > > --alec > > Baptiste Meurant wrote: >> Hello, >> >> I am currently upgrading my Tapestry version from 5.0.6 to 5.0.11 and I >> have >> a problem with @ApplicationState annotation. >> >> Here are my files: >> >> Login.tml : >> >> <?xml version="1.0" encoding="UTF-8"?> >> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> >> <head> >> <title>Login</title> >> </head> >> <body> >> <div id="login_box"> >> <t:form> >> <t:errors /> >> <table> >> <tr> >> <td><label t:type="Label" for="login" class="login_label"/></td> >> <td><input t:type="TextField" t:id="login" t:value="login" >> t:label="login " >> class="login_input" /></td> >> </tr> >> <tr> >> <td><label t:type="Label" for="password" >> class="login_label"/></td> >> <td><input t:type="PasswordField" t:id="password" t:value="password" >> t:label="password " >> class="login_input" /></td> >> </tr> >> <tr> >> <td><input t:id="submitform" t:type="Submit" t:value="submit" >> class="login_submit"/></td> >> </tr> >> </table> >> </t:form> >> </div> >> </body> >> </html> >> >> >> Login.java : >> >> package tutos.web.pages; >> >> import org.apache.tapestry.annotations.ApplicationState; >> import org.apache.tapestry.beaneditor.Validate; >> >> public class Login { >> >> @ApplicationState >> private String login; >> >> private String password; >> >> public String getLogin() { >> return login; >> } >> >> @Validate("required") >> public void setLogin(String login) { >> this.login = login; >> } >> >> public String getPassword() { >> return password; >> } >> >> @Validate("required") >> public void setPassword(String password) { >> this.password = password; >> } >> >> String onSuccess() { >> //my business coder >> String ret = "Home"; >> return ret; >> } >> } >> >> >> I get the error - no exception in stacktrace : >> >> Render queue error in BeginRender[Login:login]: Failure reading parameter >> 'value' of component Login:login: Error invoking constructor >> java.lang.String(byte[], int, int, int) (at null:-1) (for service >> 'ApplicationStateManager'): No service implements the interface [B. >> >> When I delete @ApplicationState annotation, everything works. >> >> I have made some tests on different Tapestry versions and it seems that >> @ApplicationState is correctly working until 5.0.10. I get the exception >> on >> 5.0.11 and 5.0.12-SNAPSHOT. >> >> Is it a bug or @ApplicationState implementation has changed since 5.0.11 >> ? >> In this case can someone give me the correct configuration ? >> >> Thanks, regards, >> >> Baptiste Meurant > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/ApplicationState-annotation-problem-since-5.0.11-tp16118051p16118858.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]