tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdelanno <vincent.delan...@gmail.com>
Subject Re: null property
Date Sun, 06 Mar 2011 18:36:09 GMT
Sorry for double posting. But this time, the formatting should be ok

Hi all,

I'm new to Tapestry, and I have a problem with a simple Login form. When in
the OnSubmit callback of the form, the  login and pasword fields are empty.
Could someone help me at least understand why?
Here is my loginForm class:


vdelanno wrote:
> 
> 
> public class LoginForm {
> 	
> 	@Persist(PersistenceConstants.FLASH)
> 	private String loginMessage;
> 	
> 	@Property
> 	private String loginEmail;
> 	
> 	@Property
> 	private String loginPassword;
> 	
>     @Component
>     private Form loginForm;
> 
> 	@Inject
> 	private Authenticator authenticator;
> 
>    
>     public Object onActionFromLoginForm() {
>         try {
>             authenticator.login(loginEmail, loginPassword);
>             return Index.class;
>         } catch (AuthenticationException ex) {
>         	setLoginMessage("Invalid user name or password.");
>         }
>         return null;
>         
>     }
>     
> 	public void setLoginMessage(String loginMessage)
> 	{
> 		this.loginMessage = loginMessage;
> 	}
> 
> 	public String getLoginMessage() {
> 		if (loginMessage != null) {
> 			return loginMessage;
> 		} else {
> 			return " ";
> 		}
> 	}
> 	
> }
> 

here is the loginForm template


vdelanno wrote:
> 
> 
> 

>       
> 		

> 			${loginMessage}
> 		

> 		

> 			
> 			
> 		
		
> 		

> 			
> 			
> 		
		
> 		

> 			
> 		
		
> 	
> 

> 
> 
> 
> 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/null-property-tp3411636p3411646.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message