I have created a stateless component in Wicket 1.5, by extending the component and giving the @StatelessComponent annotation,
I was trying to check the component being stateful/stateless with the StatelessChecker.
But i am not able to check, here is the code which i was trying .
@StatelessComponent
public class StatelessText extends TextField
//Client Class
StatelessText test = new StatelessText(“test”);
StatelessChecker sc = new StatelessChecker();
sc.onBeforeRender(test);
I dont see anything on console or any exceptions/errors.
Maybe i am not using the correct way, Can anybody please guide me here.
Appreciate the Help.
You dont need to explicitly call the Statelesschecker in your class. As Throsten said you need to add that in your WebApplications init and annotate your – class to be checked – as Statelesscomponent. If your Application is confidured to be in development mode in you web.xml you will get a runtime error when calling this page if it is Statefull.
Im not sure I understood what you are trying to do there. why are you holding an instance of your class in itself? are you trying to build a singleton? And what purpose does StatelessText has anyway? the Textfield in an usual form will be Stateless as long theres no explicitly added Ajax behaviour to it.