Hi guys - one more wicket question :) I got a form and some text thats shown, after you submit the form. At the moment it does the following:
User1 types some text and submit the form -> get some result User2 enters the site and see the input from User1 -> has to delete the input and types his own -> get a new result ...
I think you get the problem, User2 should not see the input of User1! Additional I want to store the entered input for User1. So if he returns to the site he should be able to see his own data and nothing else!
I think I have to deal with sessions here - I heared Wicket is doing well with sessions, but I'm not able to get it working. I tryed something like that:
public class MainStartApplication extends WebApplication {
@Override
public Session newSession(final Request request, final Response response) {
return new MySession(request);
}
@Override
public Class<? extends WebPage> getHomePage() {
MySession.get().setUserId(user);
}
}
public class MySession extends WebSession {
private static final long serialVersionUID = 1L;
private String userId;
public MySession(final Request request) {
super(request);
}
public static MySession get() {
return (MySession) WebSession.get();
}
public void setUserId(final String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
}
But it doens't work. (No errors)
Maybe you can give me some hints? Thx a lot
Best regards Sylvus
P.S. Im working with Tomcat v6!