You should post this type of questions to the Tapestry user group, not the developers group.**

nobody22 wrote:
Hi,
I'm using tapestry.
I have a logon page with username and password input fields.
First time I submit form it works fine, if username and password are correct
I go on to Welcome page, otherwise I'm redirect on my logon page with an
error message.
Second time i submit form, if I enter invalid username or password, I don't
see my logon page, but I'm redirect to a page with message Your session has timed out.
Why tapestry see that session is timed out?
Here is my code:

Login.java

public abstract String getUserName();
public abstract String getPassword();
public abstract void setMessage(String message);

....

public void onFormSubmit(IRequestCycle cycle) {
  MyVisit visit = (MyVisit) getVisit();
  MyUserBean user = new MyUserBean();
  if(my_Method_to_validate(getUserName(), getPassword())) {
       visit.setUser(user);
cycle.activate("MainPage"); }
  else
      setMessage("invalid username or password");
}

Home.page


<page-specification class="it.mypackage.Login">
<description>add a description</description> <property-specification name="message" type="java.lang.String"/>
        <property-specification name="userName" type="java.lang.String"/>
        <property-specification name="password" type="java.lang.String"/>
        
<component id="loginForm" type="Form"> <binding name="listener" expression="listeners.onFormSubmit" /> </component> </page-specification>

Home.html

<form action="" jwcid="loginForm">    
<table>
<tr>
<th align="left">Utente:</th>
<td align="left">
   <input type="text" jwcid="@TextField" value="ognl:userName" />
</td>
</tr>                             
<tr>
<th align="left">Password:</th>
<td align="left">
    <input type="password" jwcid="@TextField" value="ognl:password"
hidden="ognl:true"/>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" value="Connetti" />
</td>
</tr>
</table>
</form>

Reply via email to