Re: Invalid URLPatternSpec for Ajax Calls in Wicket Portlet
Do you know what is send differently to the server in FF2 vs IE (WireShark?) And where the error is thrown, why it says that the URLPatternSpec is invalid... Thijs On 18-11-2008 22:57, prasana wrote: Hi all, We are running Wicket Portlet in Jetspeed Portal deployed in Glassfish. But whenever we make a Ajax calls, it results in There are some problems in the request: invalid URLPatternSpec|# in the server log file and Ajax Debug windows shows ERROR: Received Ajax response with code: 400 The above error happens only in Firefox 2 and not in IE 6/7 I greatly appreciate any help regarding on what I need to do to see the workflow actions for assets. Thanks Prasanna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
null lastPage at restoreAfterSerialization
Hi all, as I've a requirement to maintain long lived sessions (~120s) I'm using tomcat's PersistentManager to avoid keeping lots of sessions in memory, each one with its own lastPage. I'm observing, specially in a heavy loaded production environment, permanent errors with a trace like Nov 19, 2008 1:56:20 AM org.apache.catalina.session.StoreBase processExpires SEVERE: Session: 115F3CD5A33E7D941AF8971FA62DE270; java.lang.IllegalArgumentException: Unknown object type null at org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1214) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:409) at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942) at org.apache.catalina.session.FileStore.load(FileStore.java:296) at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:195) at org.apache.catalina.session.PersistentManagerBase.processExpires(PersistentManagerBase.java:553) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667) I've managed myself to reproduced this error in a more controlled environment and I discovered that tomcat's manager background thread is swapping out the session at a moment where lastPage == null. SecondLevelCacheSessionStore$SecondLevelCachePageMap [line: 380] if (sessionId != null store instanceof IClusteredPageStore == false) { Object page = lastPage; if (store instanceof ISerializationAwarePageStore)--- conditional breakpoint if page == null { Daemon Thread [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (Suspended (breakpoint at line 380 in SecondLevelCacheSessionStore$SecondLevelCachePageMap)) SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(ObjectOutputStream) line: 380 GeneratedMethodAccessor139.invoke(Object, Object[]) line: not available DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 ObjectStreamClass.invokeWriteObject(Object, ObjectOutputStream) line: 945 ObjectOutputStream.writeSerialData(Object, ObjectStreamClass) line: 1461 ObjectOutputStream.writeOrdinaryObject(Object, ObjectStreamClass, boolean) line: 1392 ObjectOutputStream.writeObject0(Object, boolean) line: 1150 ObjectOutputStream.writeObject(Object) line: 326 StandardSession.writeObject(ObjectOutputStream) line: 1517 StandardSession.writeObjectData(ObjectOutputStream) line: 959 FileStore.save(Session) line: 372 PersistentManager(PersistentManagerBase).writeSession(Session) line: 868 PersistentManager(PersistentManagerBase).swapOut(Session) line: 839 PersistentManager(PersistentManagerBase).processMaxIdleSwaps() line: 1058 PersistentManager(PersistentManagerBase).processPersistenceChecks() line: 570 PersistentManager(PersistentManagerBase).processExpires() line: 551 PersistentManager(ManagerBase).backgroundProcess() line: 667 StandardContext(ContainerBase).backgroundProcess() line: 1316 ContainerBase$ContainerBackgroundProcessor.processChildren(Container, ClassLoader) line: 1601 ContainerBase$ContainerBackgroundProcessor.processChildren(Container, ClassLoader) line: 1610 ContainerBase$ContainerBackgroundProcessor.processChildren(Container, ClassLoader) line: 1610 ContainerBase$ContainerBackgroundProcessor.run() line: 1590 Thread.run() line: 619 I've configured a minIdleTime of 120 seconds so I don't think tomcat swaps the session out while it's still being accessed, in an invalid intermediate state. The code for processMaxIdleSwaps looks fine: protected void processMaxIdleSwaps() { if (!isStarted() || maxIdleSwap 0) return; Session sessions[] = findSessions(); long timeNow =
Re: null lastPage at restoreAfterSerialization
Another fact that could be relevant is that this only happens upon processexpires, but never for swapin, which seems to suggest that the span of the sessions that fail to restore is just one request (maybe the ones coming from bots that don't support cookies). Best regards -Carlos On Wed, Nov 19, 2008 at 7:13 AM, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, as I've a requirement to maintain long lived sessions (~120s) I'm using tomcat's PersistentManager to avoid keeping lots of sessions in memory, each one with its own lastPage. I'm observing, specially in a heavy loaded production environment, permanent errors with a trace like Nov 19, 2008 1:56:20 AM org.apache.catalina.session.StoreBase processExpires SEVERE: Session: 115F3CD5A33E7D941AF8971FA62DE270; java.lang.IllegalArgumentException: Unknown object type null at org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1214) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:409) at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942) at org.apache.catalina.session.FileStore.load(FileStore.java:296) at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:195) at org.apache.catalina.session.PersistentManagerBase.processExpires(PersistentManagerBase.java:553) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667) I've managed myself to reproduced this error in a more controlled environment and I discovered that tomcat's manager background thread is swapping out the session at a moment where lastPage == null. SecondLevelCacheSessionStore$SecondLevelCachePageMap [line: 380] if (sessionId != null store instanceof IClusteredPageStore == false) { Object page = lastPage; if (store instanceof ISerializationAwarePageStore)--- conditional breakpoint if page == null { Daemon Thread [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (Suspended (breakpoint at line 380 in SecondLevelCacheSessionStore$SecondLevelCachePageMap)) SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(ObjectOutputStream) line: 380 GeneratedMethodAccessor139.invoke(Object, Object[]) line: not available DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 ObjectStreamClass.invokeWriteObject(Object, ObjectOutputStream) line: 945 ObjectOutputStream.writeSerialData(Object, ObjectStreamClass) line: 1461 ObjectOutputStream.writeOrdinaryObject(Object, ObjectStreamClass, boolean) line: 1392 ObjectOutputStream.writeObject0(Object, boolean) line: 1150 ObjectOutputStream.writeObject(Object) line: 326 StandardSession.writeObject(ObjectOutputStream) line: 1517 StandardSession.writeObjectData(ObjectOutputStream) line: 959 FileStore.save(Session) line: 372 PersistentManager(PersistentManagerBase).writeSession(Session) line: 868 PersistentManager(PersistentManagerBase).swapOut(Session) line: 839 PersistentManager(PersistentManagerBase).processMaxIdleSwaps() line: 1058 PersistentManager(PersistentManagerBase).processPersistenceChecks() line: 570 PersistentManager(PersistentManagerBase).processExpires() line: 551 PersistentManager(ManagerBase).backgroundProcess() line: 667 StandardContext(ContainerBase).backgroundProcess() line: 1316 ContainerBase$ContainerBackgroundProcessor.processChildren(Container, ClassLoader) line: 1601 ContainerBase$ContainerBackgroundProcessor.processChildren(Container, ClassLoader) line: 1610 ContainerBase$ContainerBackgroundProcessor.processChildren(Container, ClassLoader) line: 1610 ContainerBase$ContainerBackgroundProcessor.run() line: 1590 Thread.run() line: 619 I've configured a minIdleTime of 120 seconds so I don't think tomcat swaps the session out
Help with load-balancing and fail-over in a Hibernate, Spring, Wicket 3-tier architecture
Hi, I have this 3-tier architecture in mind: 1. Persistence: Hibernate with MySQL 2. Business: Spring 2.5 3. Presentation: Wicket I want my application to have high availability and scalability, so I want to cluster it with load-balancing, fail-over and synchronization. I wonder if you know of any nice tutorial which will educate me on the subject? And if not, if you can give me some pointers of what I need to do. I have some questions below, if you know of something I haven't thought to ask about feel free to educate me further. I've found it hard to find concrete information regarding this topic. 1. Do I have to run this inside a Java EE server or is it possible using Tomcat? 2. Should I run this inside a Java EE server? I have used JBoss 4.x, maybe I should use it? I have seen suggestions for deployment architectures similar to this one: [Active load balancer] - [Backup load balancer] | [WebServer1] , [WebServer2] , ... [WebServerN] | [MySqlServer1] , [MySqlServer2] , ... [MySqlServerN] 3. What should I use for load balancer? (I know there are multiple load balancing strategies.) 4. I've heard that WebServer1, ... , WebServerN should be synchronized, use fail-over and be load-balanced. Exactly what do I have to synchronize? How is that achieved? 5. I've also heard that MySqlServer1, ... , MySqlServerN should be synchronized, use fail-over and be load-balanced. Exactly what do I have to synchronize? How is that achieved? 6. In the past I've only a 3-tier architecture based on JPA, EJB (Stateless session beans) and JSP+Servlet for Persistence, Business and the Presentation layers. Pure Hibernate (I've used JPA with Hibernate as persistence provider) is new to me, Spring 2.5 is new and Wicket is new. Also creating a clustered solution like this is new to me. :-) I'm a bit afraid that there are too many new components for me to handle. Wicket seems easy enough, I'm reading Wicket in Action. Do you think I should change any of the other components into components I've used before, as the new components requires a high learning investment? (I should also make a note of that I am not entirely satisfied with Java EE in its current version.) If you've read this far, thank you! I'm a bit lost at the moment as solutions with high availability and scalability are new to me, I would really appreciate any help I can get. Best regards, Kent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Wicket 1.3.5 behind a front-end proxy
Hi, http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html shows this configuration: VirtualHost ordering.company.com ProxyPass / http://appserver.company.com:8080/ordering/ ProxyPassReverse / http://appserver.company.com:8080/ordering/ # Apache 2.2+ only ProxyPassReverseCookiePath /ordering / /VirtualHost as impossible until getApplicationSettings().setContextPath(/); But it says in 1.3 it must work because it uses relative paths. My experience shows that contextPath is still added in URL in links and I don't know why. Was anyone successfull in deploing Wicket 1.3.5 when Tomcat is used by Apache through mod_proxy? If yes, please, send me example of configuration. What I need to do in web.xml? Thank you, Tony. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Model never called
you should rather add an IModel to the link e.g. new Link(foobar, myModel); than letting a component implement IModel. the way you did it, the model is never recognised as a model, as it wasn't set as a model of a component. hope that makes sense regards, Michael Leucht, Axel wrote: Hi, I do have a link class which should render different icons when clicked. So I decided to implement IModel and return different icons depending on the state of the object. But to my surprise getObject() never get called! Does anyone give me a clue where to look next or give me a hint as to how to render the object with a different icon? The object is used in a 10x10 board game where a player can shoot at different squares which are rendered as links in the output. The board is constructed as: ListView listview = new ListView(rows, list) { private static final long serialVersionUID = 1L; protected void populateItem(ListItem item) { Row row = (Row) item.getModelObject(); final Square[] squares = new Square[10]; for (int col=0; col10; col++) { squares[col] = row.getCells(col); } Square square = row.getCells(0); item.add(new Label(row,new Model(square.getRow(; for (int col=0; col10; col++) { final Square aSquare = row.getCells(col); item.add(aSquare); } } }; And the Square-Object is: public class Square extends Link implements IModel { @Override public void onClick() { System.out.println(Click: + ident); } @Override public Object getObject() { System.out.println(GetObject); if (someState) return icon1; return icon2; } } /Axel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Model-never-called-tp20577931p20578051.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: null lastPage at restoreAfterSerialization
The last one of the saga for now, I badly need to sleep. I've been sampling tomcat work dir every second: i=0; while [[ i -le 300 ]]; do echo $i; ls -lt /u01/tomcatWork/_ /tmp/work$i; sleep 1; i=$((i + 1)); done Then I greped a number of session ids corresponding to restoreAfterSerialization errors and every one of them appears in zero or one samples at most. With maxIdleTime = 120 secs the pattern is this: /u01/tomcatWork/_/wicketServlet-fileStore/sessionid created at T - 120 secs /u01/tomcatWork/_/sessionid.session swapped out at T - serialized restoreAfterSerialization error expired at ~T - deserialized The life span of /u01/tomcatWork/_/sessionid.session is of a fraction of a second. So the problem seems to be definitely related to short lived sessions that are removed immediately after being swapped out. The session is removed sooner than expected because of the exception that is thrown attempting to deserialize the lastPage. This is clear from inspection of tomcat's StoreBase.processExpires: try { StandardSession session = (StandardSession) load(keys[i]); -- load fails . if (session.isValid()) { continue; -- ideally we should be here } . remove(session.getIdInternal()); } catch (Exception e) { . remove(keys[i]); -- but instead /u01/tomcatWork/_/sessionid.session is prematurely removed here } HIH -Carlos On Wed, Nov 19, 2008 at 7:34 AM, Carlos Pita [EMAIL PROTECTED] wrote: Another fact that could be relevant is that this only happens upon processexpires, but never for swapin, which seems to suggest that the span of the sessions that fail to restore is just one request (maybe the ones coming from bots that don't support cookies). Best regards -Carlos On Wed, Nov 19, 2008 at 7:13 AM, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, as I've a requirement to maintain long lived sessions (~120s) I'm using tomcat's PersistentManager to avoid keeping lots of sessions in memory, each one with its own lastPage. I'm observing, specially in a heavy loaded production environment, permanent errors with a trace like Nov 19, 2008 1:56:20 AM org.apache.catalina.session.StoreBase processExpires SEVERE: Session: 115F3CD5A33E7D941AF8971FA62DE270; java.lang.IllegalArgumentException: Unknown object type null at org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1214) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:409) at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942) at org.apache.catalina.session.FileStore.load(FileStore.java:296) at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:195) at org.apache.catalina.session.PersistentManagerBase.processExpires(PersistentManagerBase.java:553) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667) I've managed myself to reproduced this error in a more controlled environment and I discovered that tomcat's manager background thread is swapping out the session at a moment where lastPage == null. SecondLevelCacheSessionStore$SecondLevelCachePageMap [line: 380] if (sessionId != null store instanceof IClusteredPageStore == false) { Object page = lastPage; if (store instanceof ISerializationAwarePageStore)--- conditional breakpoint if page == null { Daemon Thread [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (Suspended (breakpoint at line 380 in SecondLevelCacheSessionStore$SecondLevelCachePageMap)) SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(ObjectOutputStream) line: 380 GeneratedMethodAccessor139.invoke(Object, Object[]) line: not available DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 ObjectStreamClass.invokeWriteObject(Object,
Border invalidates browser preview
As a designer I like to edit the visual design of pages in Dreamweaver and use eclipse for dynamic behaviour. I have not found any way of doing this using Border: Original static page design: div id=outer div id=inner div id=content wicket:id=content pDynamic content goes here/p /div /div /div I want the outer, inner and content div's to be the border but still be able to edit in Dreamweaver. I cannot add wicket:remove like this since it breaks the xml: wicket:remove div id=outer div id=inner div id=content wicket:id=content /wicket:remove wicket:border wicket:body/ /wicket:border wicket:remove /div /div /div /wicket:remove So how do I do this?? -- View this message in context: http://www.nabble.com/Border-invalidates-browser-preview-tp20578445p20578445.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Field value null on Submit after onUpdate()
Hi, Everyone! I wrot this Ajax Event Handler for a AutoCompleteTextField: @Override protected void onUpdate(AjaxRequestTarget target) { ChildObj co = (ChildObj)AutoCompleteTextField.findChoice(); if(null != co ) { ((Obj)Form.getModelObject()).setChildObject(co); ((Obj)Form.getModelObject()).setPrice(co.getPrice()); if(co.isBoolAttribute()) { ((Obj)Form.getModelObject()).setAmount(new Float(1)); TextInput.setEnabled(false); target.addComponent(TextInput); } else { ((Obj)Form.getModelObject()).setAmount(new Float(1)); obj.setAmount(new Float(1)); TextInput.setModelObject(new Float(1)); TextInput.setEnabled(true); target.addComponent(TextInput); } } } This is working as long as the else-block is not executed bu when I submit the Form including the AutoCompleteTextField and the TextInput both AutoCompleteTextField and TextInput have a NULL value. Someone please help me what's wrong. -- View this message in context: http://www.nabble.com/Field-value-null-on-Submit-after-onUpdate%28%29-tp20579000p20579000.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Model never called
Nope, doesn't work either. I've created a new class MySquare implementing IModel but the getObject() never get called either. I'm stumped. In populateItem I do: for (int col=0; col10; col++) { MySquare mySquare = new MySquare(); Link link = new Link(cols+col, mySquare) { public void onClick() { System.out.println(clicked); } }; link.add(new Image(icon+col,Square.emptyResource)); item.add(link); /Axel -Ursprüngliche Nachricht- Von: Michael Sparer [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 19. November 2008 12:37 An: users@wicket.apache.org Betreff: Re: Model never called you should rather add an IModel to the link e.g. new Link(foobar, myModel); than letting a component implement IModel. the way you did it, the model is never recognised as a model, as it wasn't set as a model of a component. hope that makes sense regards, Michael Leucht, Axel wrote: Hi, I do have a link class which should render different icons when clicked. So I decided to implement IModel and return different icons depending on the state of the object. But to my surprise getObject() never get called! Does anyone give me a clue where to look next or give me a hint as to how to render the object with a different icon? The object is used in a 10x10 board game where a player can shoot at different squares which are rendered as links in the output. The board is constructed as: ListView listview = new ListView(rows, list) { private static final long serialVersionUID = 1L; protected void populateItem(ListItem item) { Row row = (Row) item.getModelObject(); final Square[] squares = new Square[10]; for (int col=0; col10; col++) { squares[col] = row.getCells(col); } Square square = row.getCells(0); item.add(new Label(row,new Model(square.getRow(; for (int col=0; col10; col++) { final Square aSquare = row.getCells(col); item.add(aSquare); } } }; And the Square-Object is: public class Square extends Link implements IModel { @Override public void onClick() { System.out.println(Click: + ident); } @Override public Object getObject() { System.out.println(GetObject); if (someState) return icon1; return icon2; } } /Axel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Model-never-called-tp20577931p20578051.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Model never called
Hi, I do have a link class which should render different icons when clicked. So I decided to implement IModel and return different icons depending on the state of the object. But to my surprise getObject() never get called! Does anyone give me a clue where to look next or give me a hint as to how to render the object with a different icon? The object is used in a 10x10 board game where a player can shoot at different squares which are rendered as links in the output. The board is constructed as: ListView listview = new ListView(rows, list) { private static final long serialVersionUID = 1L; protected void populateItem(ListItem item) { Row row = (Row) item.getModelObject(); final Square[] squares = new Square[10]; for (int col=0; col10; col++) { squares[col] = row.getCells(col); } Square square = row.getCells(0); item.add(new Label(row,new Model(square.getRow(; for (int col=0; col10; col++) { final Square aSquare = row.getCells(col); item.add(aSquare); } } }; And the Square-Object is: public class Square extends Link implements IModel { @Override public void onClick() { System.out.println(Click: + ident); } @Override public Object getObject() { System.out.println(GetObject); if (someState) return icon1; return icon2; } } /Axel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AjaxUpdate broken after showing feedback in ModalWindow
Hi all, I have a ModalWindow with some radios in it. Everytime a Radio is selected, an AjaxEventBehavior(onclick) is called which updates a special RadioGroup in that page. Everything works fine, as long as there are no errors and no feedback is shown. If I produce an Error, in that case it´s a RadioGroup where none of the Radios is selected, the feedback shows up. Now, when I select a Radio, the AjaxEventBehavior(onclick) is called, works through the code, but does not refresh the target(-radios). Debugging shows that the values are set correctly, but they won´t be shown. Is this a bug, or am I doing something terribly wrong? Any clues? -- View this message in context: http://www.nabble.com/AjaxUpdate-broken-after-showing-feedback-in-ModalWindow-tp20578065p20578065.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: Model never called
I couldn't understand the part about the icon, but what I know is that 'getObject()' will *never* be called until you set the Square object into itself as the model: public Square() { setModel(this); } Regards, Bruno -Mensagem original- De: Leucht, Axel [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 19 de novembro de 2008 09:28 Para: [EMAIL PROTECTED] Apache. Org (E-Mail) Assunto: Model never called Hi, I do have a link class which should render different icons when clicked. So I decided to implement IModel and return different icons depending on the state of the object. But to my surprise getObject() never get called! Does anyone give me a clue where to look next or give me a hint as to how to render the object with a different icon? The object is used in a 10x10 board game where a player can shoot at different squares which are rendered as links in the output. The board is constructed as: ListView listview = new ListView(rows, list) { private static final long serialVersionUID = 1L; protected void populateItem(ListItem item) { Row row = (Row) item.getModelObject(); final Square[] squares = new Square[10]; for (int col=0; col10; col++) { squares[col] = row.getCells(col); } Square square = row.getCells(0); item.add(new Label(row,new Model(square.getRow(; for (int col=0; col10; col++) { final Square aSquare = row.getCells(col); item.add(aSquare); } } }; And the Square-Object is: public class Square extends Link implements IModel { @Override public void onClick() { System.out.println(Click: + ident); } @Override public Object getObject() { System.out.println(GetObject); if (someState) return icon1; return icon2; } } /Axel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas. Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with load-balancing and fail-over in a Hibernate, Spring, Wicket 3-tier architecture
Can mysql really load balance like that? How does it work with transactions and so on? Normally you scale the webservers and have 1 big database server thats serves all of them. For wicket you just need tomcat with sticky sessions. Then you only have to take care of the hibernate caching on each tomcat instance On 11/19/08, Kent Larsson [EMAIL PROTECTED] wrote: Hi, I have this 3-tier architecture in mind: 1. Persistence: Hibernate with MySQL 2. Business: Spring 2.5 3. Presentation: Wicket I want my application to have high availability and scalability, so I want to cluster it with load-balancing, fail-over and synchronization. I wonder if you know of any nice tutorial which will educate me on the subject? And if not, if you can give me some pointers of what I need to do. I have some questions below, if you know of something I haven't thought to ask about feel free to educate me further. I've found it hard to find concrete information regarding this topic. 1. Do I have to run this inside a Java EE server or is it possible using Tomcat? 2. Should I run this inside a Java EE server? I have used JBoss 4.x, maybe I should use it? I have seen suggestions for deployment architectures similar to this one: [Active load balancer] - [Backup load balancer] | [WebServer1] , [WebServer2] , ... [WebServerN] | [MySqlServer1] , [MySqlServer2] , ... [MySqlServerN] 3. What should I use for load balancer? (I know there are multiple load balancing strategies.) 4. I've heard that WebServer1, ... , WebServerN should be synchronized, use fail-over and be load-balanced. Exactly what do I have to synchronize? How is that achieved? 5. I've also heard that MySqlServer1, ... , MySqlServerN should be synchronized, use fail-over and be load-balanced. Exactly what do I have to synchronize? How is that achieved? 6. In the past I've only a 3-tier architecture based on JPA, EJB (Stateless session beans) and JSP+Servlet for Persistence, Business and the Presentation layers. Pure Hibernate (I've used JPA with Hibernate as persistence provider) is new to me, Spring 2.5 is new and Wicket is new. Also creating a clustered solution like this is new to me. :-) I'm a bit afraid that there are too many new components for me to handle. Wicket seems easy enough, I'm reading Wicket in Action. Do you think I should change any of the other components into components I've used before, as the new components requires a high learning investment? (I should also make a note of that I am not entirely satisfied with Java EE in its current version.) If you've read this far, thank you! I'm a bit lost at the moment as solutions with high availability and scalability are new to me, I would really appreciate any help I can get. Best regards, Kent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Noob question: Wicket and statefull/stateless
Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LinkTree Add Children on Node Expansion
Hi, I want to use LinkTree and I want to add a node's children on its expansion in server side (like what we can do in Swing). I also want the junction link show the '+' icon on every node which its 'allowsChildren' is true, and on its expansion if no child provided, its junction link changes to a junction corner (like Swing). How can I do that?
Re: ajax busy indicator never stops in IE
I observed this behaviour too, but currently that issue doesn't have the highest priority for me. I just wanted to give you a hint: I know it was working in some wicket versions before 1.3.5 maybe it'll be a good start to have a look at the JS involved and compare it with different wicket versions ... and then come up with a patch :-) regards, michael miro wrote: i gave the wrong code here again code to add link add(new IndicatingAjaxLink(test_link){ public void onClick(AjaxRequestTarget target) { System.out.println(link clicked); target.addComponent(this); } }); html to show link html xmlns:wicket=http://wicket.apache.org/; head/head body # increment /body /html output from ajax debug INFO: focus removed from wicket-generated-id-0 INFO: focus set on test__link2 INFO: INFO: Initiating Ajax GET request on ?wicket:interface=:3:test_link::IBehaviorListener:0:-1random=0.39759167481818924 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (1562 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript !--/*--![CDATA[/*!--*/ var e = Wicket.$('test__link2--ajax-indicator'); if (e != null typeof(e.parentNode) != 'undefined') e.parentNode.removeChild(e); /*--]^]^*//script /head]]/header-contributioncomponent id=test__link2 ![CDATA[ # increment resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif ]]/component/ajax-response INFO: Response parsed. Now invoking steps... ERROR: [object Error] INFO: Response processed successfully. INFO: Invoking post-call handler(s)... INFO: Calling focus on test__link2 INFO: focus set on test__link2 INFO: focus removed from test__link2 please tell me why am i getting ERROR: [object Error] ? miro wrote: did a simple test of this problem java code for adding a link add(new IndicatingAjaxLink(test_link){ public void onClick(AjaxRequestTarget target) { System.out.println(link clicked); target.addComponent(this); } }.add(new Label(test,click here))); } here is the html html head/head body label wicket:id=test/ /body /html ajax debug console INFO: Using ActiveX transport INFO: INFO: Initiating Ajax GET request on ?wicket:interface=:1:test_link::IBehaviorListener:0:random=0.018303795903651054 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (1584 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-responseheader-contribution encoding=wicket1 ![CDATA[head xmlns:wicket=http://wicket.apache.org;script type=text/javascript src=resources/org.apache.wicket.markup.html.WicketEventReference/wicket-event.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.WicketAjaxReference/wicket-ajax.js/script script type=text/javascript src=resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/wicket-ajax-debug.js/script script type=text/javascript id=wicket-ajax-debug-enable!--/*--![CDATA[/*!--*/ wicketAjaxDebugEnable=true; /*--]^]^*//script script type=text/javascript !--/*--![CDATA[/*!--*/ var e = Wicket.$('test__link2--ajax-indicator'); if (e != null typeof(e.parentNode) != 'undefined') e.parentNode.removeChild(e); /*--]^]^*//script /head]]/header-contributioncomponent id=test__link2 ![CDATA[ labelclick here/label resources/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif ]]/component/ajax-response INFO: Response parsed. Now invoking steps... ERROR: [object Error] INFO: Response processed successfully. INFO: Invoking post-call handler(s)... INFO: last focus id was not set please help me understand what is going wrong . Nino.Martinez wrote: Hi Xhelas, you could try installing firefox lite, or the microsoft script debugger.. That should help you pickup whats wrong... You could also try the good old alert debug technique:) Xhelas wrote: Thank you for the clue on the clue! There are indeed some likely usefull information (with errors on IE7) in the ajax console,
Re: Wicket 1.3.5 behind a front-end proxy
Hello Anton, Have a look at: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Proxy%20Support maybe this helps? Regards, Martin Hi, http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html shows this configuration: VirtualHost ordering.company.com ProxyPass / http://appserver.company.com:8080/ordering/ ProxyPassReverse / http://appserver.company.com:8080/ordering/ # Apache 2.2+ only ProxyPassReverseCookiePath /ordering / /VirtualHost as impossible until getApplicationSettings().setContextPath(/); But it says in 1.3 it must work because it uses relative paths. My experience shows that contextPath is still added in URL in links and I don't know why. Was anyone successfull in deploing Wicket 1.3.5 when Tomcat is used by Apache through mod_proxy? If yes, please, send me example of configuration. What I need to do in web.xml? Thank you, Tony. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Martin Tilma Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: resource mapping and dot in url
The problem is with security procedures set forth by IIS admin folks. Please follow this link for more nicer explanation. http://forums.iis.net/p/1150133/1872812.aspx Hope I am making myself clear. Any ideas ? Thanks, Andy -- View this message in context: http://www.nabble.com/resource-mapping-and-dot-in-url-tp20569065p20580635.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: resource mapping and dot in url
Andy, If I read this correctly, this is not a security precaution, but a don't shoot yourself in the foot switch. (Note the 'yourself'.) So if set up the right way, you don't need this at all. You certainly don't need it for a Wicket site. You'll have to do some heavy URL rewriting (or Wicket patching) to get around this one. Regards, Erik. ak wrote: The problem is with security procedures set forth by IIS admin folks. Please follow this link for more nicer explanation. http://forums.iis.net/p/1150133/1872812.aspx Hope I am making myself clear. Any ideas ? Thanks, Andy -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Model never called
A model is only in a link as a convenience for YOU to use. It's not used by default - what about a link needs a model? Rather, it's for something like: new Link(deleteUser, modelContainingUser) { onClick() { userDAO.delete(getModelObject()); } } It's for YOU to use. For instance, let's make a simpler example supposing that you were changing the state of a label (rather than an image) with your link. You could do something like this: ModelString model = new ModelString(default value); Link link = new Link(link, model) { public void onClick() { System.out.println(clicked); setModelObject(I've been clicked); } } link.add(new Label(label, model)); item.add(link); The Label calls getObject() on its model because it needs data to print. Since you share the model between the two, changing it in the link will change it in the label. Now, back to your image example - images use image resources, not models, and I don't think this will work like you have it drawn. You need to experiment with image resources for that. Hopefully this gives you a better understanding of models, though. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:57 AM, Leucht, Axel [EMAIL PROTECTED] wrote: Nope, doesn't work either. I've created a new class MySquare implementing IModel but the getObject() never get called either. I'm stumped. In populateItem I do: for (int col=0; col10; col++) { MySquare mySquare = new MySquare(); Link link = new Link(cols+col, mySquare) { public void onClick() { System.out.println(clicked); } }; link.add(new Image(icon+col,Square.emptyResource)); item.add(link); /Axel -Ursprüngliche Nachricht- Von: Michael Sparer [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 19. November 2008 12:37 An: users@wicket.apache.org Betreff: Re: Model never called you should rather add an IModel to the link e.g. new Link(foobar, myModel); than letting a component implement IModel. the way you did it, the model is never recognised as a model, as it wasn't set as a model of a component. hope that makes sense regards, Michael Leucht, Axel wrote: Hi, I do have a link class which should render different icons when clicked. So I decided to implement IModel and return different icons depending on the state of the object. But to my surprise getObject() never get called! Does anyone give me a clue where to look next or give me a hint as to how to render the object with a different icon? The object is used in a 10x10 board game where a player can shoot at different squares which are rendered as links in the output. The board is constructed as: ListView listview = new ListView(rows, list) { private static final long serialVersionUID = 1L; protected void populateItem(ListItem item) { Row row = (Row) item.getModelObject(); final Square[] squares = new Square[10]; for (int col=0; col10; col++) { squares[col] = row.getCells(col); } Square square = row.getCells(0); item.add(new Label(row,new Model(square.getRow(; for (int col=0; col10; col++) { final Square aSquare = row.getCells(col); item.add(aSquare); } } }; And the Square-Object is: public class Square extends Link implements IModel { @Override public void onClick() { System.out.println(Click: + ident); } @Override public Object getObject() { System.out.println(GetObject); if (someState) return icon1; return icon2; } } /Axel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Michael Sparer http://talk-on-tech.blogspot.com -- View this message in context: http://www.nabble.com/Model-never-called-tp20577931p20578051.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: resource mapping and dot in url
That has only to do with how IIS looks up which script to execute, and nothing to do with security. It certainly won't matter on a Wicket site - the script lookup is actually the Wicket filter. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 8:13 AM, ak [EMAIL PROTECTED] wrote: The problem is with security procedures set forth by IIS admin folks. Please follow this link for more nicer explanation. http://forums.iis.net/p/1150133/1872812.aspx Hope I am making myself clear. Any ideas ? Thanks, Andy -- View this message in context: http://www.nabble.com/resource-mapping-and-dot-in-url-tp20569065p20580635.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
Ok. It sounds like the general philosophy behind Wicket is server side statefulness. I was kind of hoping this was not the case. Just out of curiosity, haven't anyone tried serializing and embedding state out on the webpage that could then be POST'ed between requests - a kind of hybrid model between session and request scope? This homemade hybrid seems to work for JSF, though oddly not an official strategy. I actually just joined the mailinglist and posted, after not seeing my message show up after 24h I tried posting again - this time it worked. I apologize, now posting via Napple - latency and behavior somewhat more deterministic. /Casper Jeremy Thomerson-5 wrote: Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20581578.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
No worries - you're right - Wicket is designed to manage state for you, so it's strength is not statelessness. But, you should really evaluate if you have the need for stateless before constraining yourself to it. As long as you use models correctly, you can support thousands of concurrent sessions on a server simultaneously, and you can use the strength of Wicket - letting it handle state for you. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 8:57 AM, Casper Bang [EMAIL PROTECTED] wrote: Ok. It sounds like the general philosophy behind Wicket is server side statefulness. I was kind of hoping this was not the case. Just out of curiosity, haven't anyone tried serializing and embedding state out on the webpage that could then be POST'ed between requests - a kind of hybrid model between session and request scope? This homemade hybrid seems to work for JSF, though oddly not an official strategy. I actually just joined the mailinglist and posted, after not seeing my message show up after 24h I tried posting again - this time it worked. I apologize, now posting via Napple - latency and behavior somewhat more deterministic. /Casper Jeremy Thomerson-5 wrote: Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20581578.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
He's not suggesting going stateless. He's suggesting an alternate way of maintaining state (by pushing it to the client in hidden fields). Tapestry supports (or supported) this as an option, but it made for some pretty gnarly URLs (all the state had to be appended to the end) for links. On forms, though, it wasn't that bad. The user never knew it. To use this methodology effectively, I believe you have to go into the everything is a POST land. Of course, I guess you could get creative with redirect-after-post and using flash memory. On Wed, Nov 19, 2008 at 10:01 AM, Jeremy Thomerson [EMAIL PROTECTED] wrote: No worries - you're right - Wicket is designed to manage state for you, so it's strength is not statelessness. But, you should really evaluate if you have the need for stateless before constraining yourself to it. As long as you use models correctly, you can support thousands of concurrent sessions on a server simultaneously, and you can use the strength of Wicket - letting it handle state for you. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 8:57 AM, Casper Bang [EMAIL PROTECTED] wrote: Ok. It sounds like the general philosophy behind Wicket is server side statefulness. I was kind of hoping this was not the case. Just out of curiosity, haven't anyone tried serializing and embedding state out on the webpage that could then be POST'ed between requests - a kind of hybrid model between session and request scope? This homemade hybrid seems to work for JSF, though oddly not an official strategy. I actually just joined the mailinglist and posted, after not seeing my message show up after 24h I tried posting again - this time it worked. I apologize, now posting via Napple - latency and behavior somewhat more deterministic. /Casper Jeremy Thomerson-5 wrote: Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20581578.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with load-balancing and fail-over in a Hibernate, Spring, Wicket 3-tier architecture
Can mysql really load balance like that? How does it work with transactions and so on? I think so, but I don't know much about it as I haven't read the white paper yet. Here is a link: http://www.mysql.com/products/database/cluster/ Normally you scale the webservers and have 1 big database server thats serves all of them. But I would really like some fail-over on the database side as well. If I can help it I don't want any single point of failure. For wicket you just need tomcat with sticky sessions. Then you only have to take care of the hibernate caching on each tomcat instance Thank you! I'll read up on tomcat with sticky sessions. What do you mean with take care of hibernate caching on each tomcat instance? To have them synchronized as well? On 11/19/08, Kent Larsson [EMAIL PROTECTED] wrote: Hi, I have this 3-tier architecture in mind: 1. Persistence: Hibernate with MySQL 2. Business: Spring 2.5t. 3. Presentation: Wicket I want my application to have high availability and scalability, so I want to cluster it with load-balancing, fail-over and synchronization. I wonder if you know of any nice tutorial which will educate me on the subject? And if not, if you can give me some pointers of what I need to do. I have some questions below, if you know of something I haven't thought to ask about feel free to educate me further. I've found it hard to find concrete information regarding this topic. 1. Do I have to run this inside a Java EE server or is it possible using Tomcat? 2. Should I run this inside a Java EE server? I have used JBoss 4.x, maybe I should use it? I have seen suggestions for deployment architectures similar to this one: [Active load balancer] - [Backup load balancer] | [WebServer1] , [WebServer2] , ... [WebServerN] | [MySqlServer1] , [MySqlServer2] , ... [MySqlServerN] 3. What should I use for load balancer? (I know there are multiple load balancing strategies.) 4. I've heard that WebServer1, ... , WebServerN should be synchronized, use fail-over and be load-balanced. Exactly what do I have to synchronize? How is that achieved? 5. I've also heard that MySqlServer1, ... , MySqlServerN should be synchronized, use fail-over and be load-balanced. Exactly what do I have to synchronize? How is that achieved? 6. In the past I've only a 3-tier architecture based on JPA, EJB (Stateless session beans) and JSP+Servlet for Persistence, Business and the Presentation layers. Pure Hibernate (I've used JPA with Hibernate as persistence provider) is new to me, Spring 2.5 is new and Wicket is new. Also creating a clustered solution like this is new to me. :-) I'm a bit afraid that there are too many new components for me to handle. Wicket seems easy enough, I'm reading Wicket in Action. Do you think I should change any of the other components into components I've used before, as the new components requires a high learning investment? (I should also make a note of that I am not entirely satisfied with Java EE in its current version.) If you've read this far, thank you! I'm a bit lost at the moment as solutions with high availability and scalability are new to me, I would really appreciate any help I can get. Best regards, Kent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: swarm wicket 1.4
Hi, we've not decided here whether we'll use SWARM for our security needs for our super duper new online app (!). I think next month will be taking a long look at this as see if it fits the needs etc. I was also looking at jsecurity but theres no documentation and Les has yet to fully integrate into wicket. Getting SWARM to work with 1.4 m3 was no problem, just a couple of code changes, and it works as expected. If we commit to swarm then of course we can try and keep it more up to date. Wayne On Tue, Nov 18, 2008 at 5:46 PM, danelav [EMAIL PROTECTED] wrote: I am wondering the same thing. The most information I've found is here: http://www.nabble.com/WASP-SWARM-status-td20318330.html . It sounds like Wayne Pope may be taking up the torch. Marc Ende-2 wrote: Hi, currently I'm using swarm securing some webpages build on wicket. Now, that's wicket 1.4 is getting nearer, I would like to know if there is something planned with swarm for wicket 1.4. Do you know if it's compatible or is there a new release needed? yours Marc -- View this message in context: http://www.nabble.com/swarm---wicket-1.4-tp20549342p20563418.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
We tried that once, to have state transfered to the client, we didnt like it (where it did go to) and we dropped it. Cpu time and bandtwidth is way more expensive then memory. Wicket takes now memory on the server but the overhead it would generate by serializing and base64 every page into the result and the other way around is just way way to expensive. Did you encounter any real issues with state on the server or is this again premature optimization?? On 11/19/08, Casper Bang [EMAIL PROTECTED] wrote: Ok. It sounds like the general philosophy behind Wicket is server side statefulness. I was kind of hoping this was not the case. Just out of curiosity, haven't anyone tried serializing and embedding state out on the webpage that could then be POST'ed between requests - a kind of hybrid model between session and request scope? This homemade hybrid seems to work for JSF, though oddly not an official strategy. I actually just joined the mailinglist and posted, after not seeing my message show up after 24h I tried posting again - this time it worked. I apologize, now posting via Napple - latency and behavior somewhat more deterministic. /Casper Jeremy Thomerson-5 wrote: Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20581578.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FileUploadField usage changed in 1.4 rc-1?
Hi! My FileUploadField worked fine before: dataForm.add(fileUploadField = new FileUploadField(COMPANY_LOGO)); After upgrading to 1.4 rc-1 (from 1.4-m1) the upload crashes. Am I doing something wrong or is there a bug in rc-1? Caused by: java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1149) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) ERROR - RequestCycle - there was an error cleaning up target java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1647) at org.apache.wicket.markup.html.form.upload.FileUploadField.onDetach(FileUploadField.java:175) at org.apache.wicket.Component.detach(Component.java:1119) The 1.4-m-3 code avoided the nullpointer like this: @Override public void updateModel() { // Only update the model if one was passed in if (hasExplicitModel) { setDefaultModelObject(getConvertedInput()); } } However, this hasExplicitModel is not there anymore in 1.4-rc1 No documentation seems to have changed.. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: FileUploadField usage changed in 1.4 rc-1?
Yes, you need to set a Model object into FileUploadField. :-) Bruno -Mensagem original- De: Martin Makundi [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 19 de novembro de 2008 14:33 Para: users@wicket.apache.org Assunto: FileUploadField usage changed in 1.4 rc-1? Hi! My FileUploadField worked fine before: dataForm.add(fileUploadField = new FileUploadField(COMPANY_LOGO)); After upgrading to 1.4 rc-1 (from 1.4-m1) the upload crashes. Am I doing something wrong or is there a bug in rc-1? Caused by: java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1149) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) ERROR - RequestCycle - there was an error cleaning up target java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1647) at org.apache.wicket.markup.html.form.upload.FileUploadField.onDetach(FileUploadField.java:175) at org.apache.wicket.Component.detach(Component.java:1119) The 1.4-m-3 code avoided the nullpointer like this: @Override public void updateModel() { // Only update the model if one was passed in if (hasExplicitModel) { setDefaultModelObject(getConvertedInput()); } } However, this hasExplicitModel is not there anymore in 1.4-rc1 No documentation seems to have changed.. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas. Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUploadField usage changed in 1.4 rc-1?
How? It accepts only FileUpload, which cannot be constructed as a dummy. Or can it? ** Martin 2008/11/19 Bruno Cesar Borges [EMAIL PROTECTED]: Yes, you need to set a Model object into FileUploadField. :-) Bruno -Mensagem original- De: Martin Makundi [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 19 de novembro de 2008 14:33 Para: users@wicket.apache.org Assunto: FileUploadField usage changed in 1.4 rc-1? Hi! My FileUploadField worked fine before: dataForm.add(fileUploadField = new FileUploadField(COMPANY_LOGO)); After upgrading to 1.4 rc-1 (from 1.4-m1) the upload crashes. Am I doing something wrong or is there a bug in rc-1? Caused by: java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1149) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) ERROR - RequestCycle - there was an error cleaning up target java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1647) at org.apache.wicket.markup.html.form.upload.FileUploadField.onDetach(FileUploadField.java:175) at org.apache.wicket.Component.detach(Component.java:1119) The 1.4-m-3 code avoided the nullpointer like this: @Override public void updateModel() { // Only update the model if one was passed in if (hasExplicitModel) { setDefaultModelObject(getConvertedInput()); } } However, this hasExplicitModel is not there anymore in 1.4-rc1 No documentation seems to have changed.. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas. Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
Yes we've experienced issues with multiple browser windows as well as synchronization of shared session resources. Again, this has nothing to do with optimization but everything to do with craving a solid, simple programming model for frontend developers. /Casper Johan Compagner wrote: We tried that once, to have state transfered to the client, we didnt like it (where it did go to) and we dropped it. Cpu time and bandtwidth is way more expensive then memory. Wicket takes now memory on the server but the overhead it would generate by serializing and base64 every page into the result and the other way around is just way way to expensive. Did you encounter any real issues with state on the server or is this again premature optimization?? On 11/19/08, Casper Bang [EMAIL PROTECTED] wrote: Ok. It sounds like the general philosophy behind Wicket is server side statefulness. I was kind of hoping this was not the case. Just out of curiosity, haven't anyone tried serializing and embedding state out on the webpage that could then be POST'ed between requests - a kind of hybrid model between session and request scope? This homemade hybrid seems to work for JSF, though oddly not an official strategy. I actually just joined the mailinglist and posted, after not seeing my message show up after 24h I tried posting again - this time it worked. I apologize, now posting via Napple - latency and behavior somewhat more deterministic. /Casper Jeremy Thomerson-5 wrote: Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20581578.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20584228.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob question: Wicket and statefull/stateless
It might be good to try to ask specific questions about those issues that you've seen. You will get good help here on the list, and from my experience, you won't get a much better / simpler programming model than what Wicket gives you. I've used Tapestry, where everything was stuffed into the urls and it was a nightmare creating truly reusable components that could be used anywhere. With Wicket, it's just not that way. Anyway, your use case sounds intriguing - what issues are you seeing? Probably something simple that you could do different - must simpler than managing state yourself. On Wed, Nov 19, 2008 at 10:58 AM, Casper Bang [EMAIL PROTECTED] wrote: Yes we've experienced issues with multiple browser windows as well as synchronization of shared session resources. Again, this has nothing to do with optimization but everything to do with craving a solid, simple programming model for frontend developers. /Casper Johan Compagner wrote: We tried that once, to have state transfered to the client, we didnt like it (where it did go to) and we dropped it. Cpu time and bandtwidth is way more expensive then memory. Wicket takes now memory on the server but the overhead it would generate by serializing and base64 every page into the result and the other way around is just way way to expensive. Did you encounter any real issues with state on the server or is this again premature optimization?? On 11/19/08, Casper Bang [EMAIL PROTECTED] wrote: Ok. It sounds like the general philosophy behind Wicket is server side statefulness. I was kind of hoping this was not the case. Just out of curiosity, haven't anyone tried serializing and embedding state out on the webpage that could then be POST'ed between requests - a kind of hybrid model between session and request scope? This homemade hybrid seems to work for JSF, though oddly not an official strategy. I actually just joined the mailinglist and posted, after not seeing my message show up after 24h I tried posting again - this time it worked. I apologize, now posting via Napple - latency and behavior somewhat more deterministic. /Casper Jeremy Thomerson-5 wrote: Tip: don't double post or some people will jump on you - it doesn't help you get a good answer. Anyway, for completely stateless page transitions, etc, and how to put data into the URL rather than session, you need to use BookmarkablePageLink, which will invoke the YourPage(PageParameters) constructor. Give those a shot. For forms that put their data in the URL, search the list on nabble - there's been two threads this week dealing with it. Basically, mount a bookmarkable page, don't use a Wicket form, just use an HTML form, and make it do a GET to the bookmarkable page URL. You can then use the YourPage(PageParameters) constructor again. -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 19, 2008 at 6:30 AM, [EMAIL PROTECTED] wrote: Pardon the (possible stupid) question, I'm new to Wicket but is quite excited about the simplicity it seems to promote over JSF. What's the usual way of pushing context on to a website and have it passed along, such as to remain stateless? In JSF you would typically create a request scoped backing bean and create some hidden inputs on the webpages which can hold relevant id's or even base64 encoded and encrypted model data. I thought perhaps Wicket were able to do this transparantly, as suggested by the following example: // LetterChoice.java final ListString someLetters = Arrays.asList(A, D, C); final DropDownChoice letter = new DropDownChoice(letter, new ModelString(), someLetters); StatelessForm form = new StatelessForm(keyForm) { @Override protected void onSubmit() { setResponsePage( new LetterResult( someLetters, Integer.parseInt( letter.getValue() ) ) ); } }; // LetterResult.java public LetterResult(ListString someLetters, int letterId) { String selectedLetter = someLetters.get( letterId ); } It appears you can pass both the model as well as the selection on to a new page, but there's no special/hidden content in the generated LetterChoice webpage. Does this simply mean what I am doing i tied to my session by Wicket? Is there a way ensure there's no (or just a bare minimum) of session state between each request? In general, what is the mission goal when it comes to statefullness/statelessness of Wicket? Thanks in advance, Casper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Noob-question%3A-Wicket-and-statefull-stateless-tp20578870p20581578.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Wicket 1.3.5 behind a front-end proxy
What is the problem you are having, we use mod_proxy in several environments with wicket / tomcat. Jeremy I have several apps on one hosting and several domains (aliases) that must be directly connected to corresponding Web App/. Configuration is this: ServerAlias wicket.ru ProxyPass /stats/ ! ProxyPass /webmail/ ! ProxyPass /lxadmin/ ! ProxyPass / ajp://localhost:8858/WicketRu/ ProxyPassReverse / ajp://localhost:8858/WicketRu/ ProxyPassReverseCookiePath /WicketRu / The problem is with mapping domain alias directly to Web Application so that context name is invisible. Index page is shown but Links still contain contex name. Test: open wicket.ru and click it's title it shows HTTP Status 404 - /WicketRu/WicketRu/ type Status report message /WicketRu/WicketRu/ description The requested resource (/WicketRu/WicketRu/) is not available. Apache Tomcat/6.0.18 Filter mapping is filter-mapping filter-namewicket.ru/filter-name url-pattern/*/url-pattern /filter-mapping Wicket 1.3.5 is used. Tony. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUploadField usage changed in 1.4 rc-1?
Where is such method? ** Martin 2008/11/19 Igor Vaynberg [EMAIL PROTECTED]: call hasexplicitmodel(false) -igor On Wed, Nov 19, 2008 at 8:43 AM, Martin Makundi [EMAIL PROTECTED] wrote: How? It accepts only FileUpload, which cannot be constructed as a dummy. Or can it? ** Martin 2008/11/19 Bruno Cesar Borges [EMAIL PROTECTED]: Yes, you need to set a Model object into FileUploadField. :-) Bruno -Mensagem original- De: Martin Makundi [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 19 de novembro de 2008 14:33 Para: users@wicket.apache.org Assunto: FileUploadField usage changed in 1.4 rc-1? Hi! My FileUploadField worked fine before: dataForm.add(fileUploadField = new FileUploadField(COMPANY_LOGO)); After upgrading to 1.4 rc-1 (from 1.4-m1) the upload crashes. Am I doing something wrong or is there a bug in rc-1? Caused by: java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1149) at org.apache.wicket.markup.html.form.Form$FormModelUpdateVisitor.component(Form.java:223) ERROR - RequestCycle - there was an error cleaning up target java.lang.IllegalStateException: Attempt to set model object on null model of component: mainTabs:panel:innerTabs:panel:dataForm:company_logo at org.apache.wicket.Component.setDefaultModelObject(Component.java:2933) at org.apache.wicket.markup.html.form.FormComponent.setModelObject(FormComponent.java:1647) at org.apache.wicket.markup.html.form.upload.FileUploadField.onDetach(FileUploadField.java:175) at org.apache.wicket.Component.detach(Component.java:1119) The 1.4-m-3 code avoided the nullpointer like this: @Override public void updateModel() { // Only update the model if one was passed in if (hasExplicitModel) { setDefaultModelObject(getConvertedInput()); } } However, this hasExplicitModel is not there anymore in 1.4-rc1 No documentation seems to have changed.. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) acima identificado(s), podendo conter informações e/ou documentos confidencias/privilegiados e seu sigilo é protegido por lei. Caso você tenha recebido por engano, por favor, informe o remetente e apague-a de seu sistema. Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, cópia ou uso sem expressa autorização do remetente. Opiniões pessoais do remetente não refletem, necessariamente, o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas. Warning: This message was sent for exclusive use of the addressees above identified, possibly containing information and or privileged/confidential documents whose content is protected by law. In case you have mistakenly received it, please notify the sender and delete it from your system. Be noticed that the law forbids the retention, dissemination, distribution, copy or use without express authorization from the sender. Personal opinions of the sender do not necessarily reflect CETIP's point of view, which is only divulged by authorized personnel. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Wicket 1.3.5 behind a front-end proxy
To get Apache 2.2 to proxy around Wicket, I have the following defined: IfDefine PROXY ProxyPass / http://localhost:8080/cware/ ProxyPassReverse/ http://localhost:8080/cware/ ProxyPassReverseCookieDomainlocalhost .laccetti.com ProxyPassReverseCookiePath /cware / /IfDefine Nothing special required in the web.xml, Tomcat doesn't know that it is being proxied, etc. HTH, Mike -Original Message- From: Anton Veretennikov [mailto:[EMAIL PROTECTED] Sent: November-19-08 6:34 AM To: users@wicket.apache.org Subject: Wicket 1.3.5 behind a front-end proxy Hi, http://cwiki.apache.org/WICKET/wicket-behind-a-front-end-proxy.html shows this configuration: VirtualHost ordering.company.com ProxyPass / http://appserver.company.com:8080/ordering/ ProxyPassReverse / http://appserver.company.com:8080/ordering/ # Apache 2.2+ only ProxyPassReverseCookiePath /ordering / /VirtualHost as impossible until getApplicationSettings().setContextPath(/); But it says in 1.3 it must work because it uses relative paths. My experience shows that contextPath is still added in URL in links and I don't know why. Was anyone successfull in deploing Wicket 1.3.5 when Tomcat is used by Apache through mod_proxy? If yes, please, send me example of configuration. What I need to do in web.xml? Thank you, Tony. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reading an attribute that is set in a CSS file as a class
Well, I came up with a way to do it. I wrote a new class called TextTemplateResourceReference, which you can use along with a StyleSheetReference. Basically, you just pass it in a model for the variables to plugin. I don't know about that lastModifiedTime() implementation, but its overridable if anyone wants to do something different. If anyone wants the code to turn a java.awt.Color object into a hex string appropriate for CSS stylesheets, let me know. I've got that floating around somewhere. import org.apache.wicket.IClusterable; import org.apache.wicket.Resource; import org.apache.wicket.ResourceReference; import org.apache.wicket.model.IDetachable; import org.apache.wicket.model.IModel; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; import org.apache.wicket.util.template.PackagedTextTemplate; import org.apache.wicket.util.template.TextTemplate; import org.apache.wicket.util.time.Time; import java.util.Map; /** * @author James Carman */ public class TextTemplateResourceReference extends ResourceReference implements IClusterable, IDetachable { //** // Fields //** private static final long serialVersionUID = 1L; private final TextTemplate textTemplate; private final IModelMapString,Object variablesModel; //** // Constructors //** public TextTemplateResourceReference(final Class? scope, final String name, IModelMapString,Object variablesModel) { super(scope, name); this.textTemplate = new PackagedTextTemplate(scope, name); this.variablesModel = variablesModel; } public TextTemplateResourceReference(final Class? scope, final String name, final String contentType, IModelMapString,Object variablesModel) { super(scope, name); this.textTemplate = new PackagedTextTemplate(scope, name, contentType); this.variablesModel = variablesModel; } public TextTemplateResourceReference(final Class? scope, final String name, final String contentType, final String encoding, IModelMapString,Object variablesModel) { super(scope, name); this.textTemplate = new PackagedTextTemplate(scope, name, contentType, encoding); this.variablesModel = variablesModel; } //** // IDetachable Implementation //** public void detach() { variablesModel.detach(); } //** // Other Methods //** protected Resource newResource() { return new Resource() { private static final long serialVersionUID = 1L; public IResourceStream getResourceStream() { return new StringResourceStream(textTemplate.asString(variablesModel.getObject())); } }; } public Time lastModifiedTime() { return textTemplate.lastModifiedTime(); } } jwcarman wrote: Perhaps if it's that beneficial to folks, I'll put a wiki page out there in the how to section. On Mon, Nov 17, 2008 at 6:40 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Tanks James! At the moment I do not need that code myself but maybe it could be useful to others... Best, Ernesto On Mon, Nov 17, 2008 at 12:20 PM, James Carman [EMAIL PROTECTED]wrote: We're going to go with the generate the CSS route. I'm going to implement that today. If you want me to send you some code after I'm done, I can do that. On Mon, Nov 17, 2008 at 5:27 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Why don't you just generate the CSS or parse it if that's not possible... With the former approach you will have the color before hand, with the latter you will have to locate it somewhere on the CSS. So, what is the best solution will depend on how you manage CSS on your application... Best, Ernesto On Mon, Nov 17, 2008 at 9:21 AM, Eyal Golan [EMAIL PROTECTED] wrote: Stephen, I need this the same reason James needs it. We generate an image (a JFreeChart image) and we want it to have the same background
Re: Reading an attribute that is set in a CSS file as a class
And, in case anyone's interested, here's a new WIKI page for it: http://cwiki.apache.org/confluence/display/WICKET/Dynamically+Generate+a+CSS+Stylesheet On Wed, Nov 19, 2008 at 12:48 PM, jwcarman [EMAIL PROTECTED] wrote: Well, I came up with a way to do it. I wrote a new class called TextTemplateResourceReference, which you can use along with a StyleSheetReference. Basically, you just pass it in a model for the variables to plugin. I don't know about that lastModifiedTime() implementation, but its overridable if anyone wants to do something different. If anyone wants the code to turn a java.awt.Color object into a hex string appropriate for CSS stylesheets, let me know. I've got that floating around somewhere. import org.apache.wicket.IClusterable; import org.apache.wicket.Resource; import org.apache.wicket.ResourceReference; import org.apache.wicket.model.IDetachable; import org.apache.wicket.model.IModel; import org.apache.wicket.util.resource.IResourceStream; import org.apache.wicket.util.resource.StringResourceStream; import org.apache.wicket.util.template.PackagedTextTemplate; import org.apache.wicket.util.template.TextTemplate; import org.apache.wicket.util.time.Time; import java.util.Map; /** * @author James Carman */ public class TextTemplateResourceReference extends ResourceReference implements IClusterable, IDetachable { //** // Fields //** private static final long serialVersionUID = 1L; private final TextTemplate textTemplate; private final IModelMapString,Object variablesModel; //** // Constructors //** public TextTemplateResourceReference(final Class? scope, final String name, IModelMapString,Object variablesModel) { super(scope, name); this.textTemplate = new PackagedTextTemplate(scope, name); this.variablesModel = variablesModel; } public TextTemplateResourceReference(final Class? scope, final String name, final String contentType, IModelMapString,Object variablesModel) { super(scope, name); this.textTemplate = new PackagedTextTemplate(scope, name, contentType); this.variablesModel = variablesModel; } public TextTemplateResourceReference(final Class? scope, final String name, final String contentType, final String encoding, IModelMapString,Object variablesModel) { super(scope, name); this.textTemplate = new PackagedTextTemplate(scope, name, contentType, encoding); this.variablesModel = variablesModel; } //** // IDetachable Implementation //** public void detach() { variablesModel.detach(); } //** // Other Methods //** protected Resource newResource() { return new Resource() { private static final long serialVersionUID = 1L; public IResourceStream getResourceStream() { return new StringResourceStream(textTemplate.asString(variablesModel.getObject())); } }; } public Time lastModifiedTime() { return textTemplate.lastModifiedTime(); } } jwcarman wrote: Perhaps if it's that beneficial to folks, I'll put a wiki page out there in the how to section. On Mon, Nov 17, 2008 at 6:40 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Tanks James! At the moment I do not need that code myself but maybe it could be useful to others... Best, Ernesto On Mon, Nov 17, 2008 at 12:20 PM, James Carman [EMAIL PROTECTED]wrote: We're going to go with the generate the CSS route. I'm going to implement that today. If you want me to send you some code after I'm done, I can do that. On Mon, Nov 17, 2008 at 5:27 AM, Ernesto Reinaldo Barreiro [EMAIL PROTECTED] wrote: Why don't you just generate the CSS or parse it if that's not possible... With the former approach you will have the color before hand, with the latter you will have to locate it somewhere on the CSS. So, what is the best solution will depend on how you manage CSS on your
Ajax Indicator Example?
I am having problems understanding Ajax Indicators. I have search high/low for a working example and have been unsuccessful. Is there any examples that shows what I need to do get an AjaxLink or DropDownChoice w/ an AjaxFormChoiceComponentUpdatingBehavior to utilize an indicator to show something is working? Thanks - Doug -- View this message in context: http://www.nabble.com/Ajax-Indicator-Example--tp20586418p20586418.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: FileUploadField usage changed in 1.4 rc-1?
Yeah, I run into the same thing. Just pass FileUploadField an empty model: new ModelFileUpload() Regards, Erik. Bruno Cesar Borges schreef: Yes, you need to set a Model object into FileUploadField. :-) Bruno -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: FileUploadField usage changed in 1.4 rc-1?
Strange quirk.. someone removed the preceding hack from within. Is there some flaw in the FileUploadFIeld design? ** Martin 2008/11/19 Erik van Oosten [EMAIL PROTECTED]: Yeah, I run into the same thing. Just pass FileUploadField an empty model: new ModelFileUpload() Regards, Erik. Bruno Cesar Borges schreef: Yes, you need to set a Model object into FileUploadField. :-) Bruno -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Very custom URL mapping
Hello I would like to achieve the following url space: / redirects to /form /form - home page with a from /form?something - followup of a home page's form /resources/*.css /resources/*.jpg - resources served from webapp root/resources /id - SomePage with id in PageParamters I know it would be a lot easier if I could do /somePage/id but unfortunately the requirement is different. How can I achieve something like this without rewritng 90% of wicket's url matching logic ? lg -- Leszek Gawron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Invalid URLPatternSpec for Ajax Calls in Wicket Portlet
The difference appears to be : vs %3A (the URL encoded : ) in urls. For example wicket seems to be creating test:test2 in Firefox and test%3Atest2 in IE. Glassfish doesn't like the : Thijs wrote: Do you know what is send differently to the server in FF2 vs IE (WireShark?) And where the error is thrown, why it says that the URLPatternSpec is invalid... Thijs On 18-11-2008 22:57, prasana wrote: Hi all, We are running Wicket Portlet in Jetspeed Portal deployed in Glassfish. But whenever we make a Ajax calls, it results in There are some problems in the request: invalid URLPatternSpec|# in the server log file and Ajax Debug windows shows ERROR: Received Ajax response with code: 400 The above error happens only in Firefox 2 and not in IE 6/7 I greatly appreciate any help regarding on what I need to do to see the workflow actions for assets. Thanks Prasanna - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Invalid-URLPatternSpec-for-Ajax-Calls-in-Wicket-Portlet-tp20569102p20587745.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: null lastPage at restoreAfterSerialization
This really is weird. I added couple of warnings and null check to 1.4 trunk. I wonder if that helps it though. -Matej On Wed, Nov 19, 2008 at 12:44 PM, Carlos Pita [EMAIL PROTECTED] wrote: The last one of the saga for now, I badly need to sleep. I've been sampling tomcat work dir every second: i=0; while [[ i -le 300 ]]; do echo $i; ls -lt /u01/tomcatWork/_ /tmp/work$i; sleep 1; i=$((i + 1)); done Then I greped a number of session ids corresponding to restoreAfterSerialization errors and every one of them appears in zero or one samples at most. With maxIdleTime = 120 secs the pattern is this: /u01/tomcatWork/_/wicketServlet-fileStore/sessionid created at T - 120 secs /u01/tomcatWork/_/sessionid.session swapped out at T - serialized restoreAfterSerialization error expired at ~T - deserialized The life span of /u01/tomcatWork/_/sessionid.session is of a fraction of a second. So the problem seems to be definitely related to short lived sessions that are removed immediately after being swapped out. The session is removed sooner than expected because of the exception that is thrown attempting to deserialize the lastPage. This is clear from inspection of tomcat's StoreBase.processExpires: try { StandardSession session = (StandardSession) load(keys[i]); -- load fails . if (session.isValid()) { continue; -- ideally we should be here } . remove(session.getIdInternal()); } catch (Exception e) { . remove(keys[i]); -- but instead /u01/tomcatWork/_/sessionid.session is prematurely removed here } HIH -Carlos On Wed, Nov 19, 2008 at 7:34 AM, Carlos Pita [EMAIL PROTECTED] wrote: Another fact that could be relevant is that this only happens upon processexpires, but never for swapin, which seems to suggest that the span of the sessions that fail to restore is just one request (maybe the ones coming from bots that don't support cookies). Best regards -Carlos On Wed, Nov 19, 2008 at 7:13 AM, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, as I've a requirement to maintain long lived sessions (~120s) I'm using tomcat's PersistentManager to avoid keeping lots of sessions in memory, each one with its own lastPage. I'm observing, specially in a heavy loaded production environment, permanent errors with a trace like Nov 19, 2008 1:56:20 AM org.apache.catalina.session.StoreBase processExpires SEVERE: Session: 115F3CD5A33E7D941AF8971FA62DE270; java.lang.IllegalArgumentException: Unknown object type null at org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1214) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:409) at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942) at org.apache.catalina.session.FileStore.load(FileStore.java:296) at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:195) at org.apache.catalina.session.PersistentManagerBase.processExpires(PersistentManagerBase.java:553) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667) I've managed myself to reproduced this error in a more controlled environment and I discovered that tomcat's manager background thread is swapping out the session at a moment where lastPage == null. SecondLevelCacheSessionStore$SecondLevelCachePageMap [line: 380] if (sessionId != null store instanceof IClusteredPageStore == false) { Object page = lastPage; if (store instanceof ISerializationAwarePageStore)--- conditional breakpoint if page == null { Daemon Thread [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (Suspended (breakpoint at line 380 in SecondLevelCacheSessionStore$SecondLevelCachePageMap)) SecondLevelCacheSessionStore$SecondLevelCachePageMap.writeObject(ObjectOutputStream) line: 380
Validation Question
Hi all, I am trying to get some validations to work using the FeedbackPanel. My form has a Textfield and I am trying to use a NumberValidator to check if it is in a given range. The code that I have used is : TextField pgLongLimit = new TextField(pgLongLimit, new PropertyModel( pglimit, longLimit)); pgLongLimit.setRequired(false); pgLongLimit.setLabel(new Model(Long Limit)); validator.addNumberRange(pgLongLimit, 0, Integer.MAX_VALUE); My classname.properties file looks has following code: NumberValidator.range = ${label} should have a positive integer value Now whenever I put in a negative input I get the correct error i.e Long Limit should have a positive integer value. However if I put in a char value as an input (say 'a') then the error is a is not a valid int. I want to change this error to something like Invalid input. Any ideas about how I can do that. I don't know which resource key I would have to use here. Thanks, vishy -- View this message in context: http://www.nabble.com/Validation-Question-tp20590141p20590141.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Question
Vishy, Add IConverter=Invalid Input to a properties file in, for example, MyApplication.properties for your whole application or in MyPage.properties if you want this custom message on a particular page only ... etc, in the same package as the class with the same name. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk vishy_sb wrote: Hi all, I am trying to get some validations to work using the FeedbackPanel. My form has a Textfield and I am trying to use a NumberValidator to check if it is in a given range. The code that I have used is : TextField pgLongLimit = new TextField(pgLongLimit, new PropertyModel( pglimit, longLimit)); pgLongLimit.setRequired(false); pgLongLimit.setLabel(new Model(Long Limit)); validator.addNumberRange(pgLongLimit, 0, Integer.MAX_VALUE); My classname.properties file looks has following code: NumberValidator.range = ${label} should have a positive integer value Now whenever I put in a negative input I get the correct error i.e Long Limit should have a positive integer value. However if I put in a char value as an input (say 'a') then the error is a is not a valid int. I want to change this error to something like Invalid input. Any ideas about how I can do that. I don't know which resource key I would have to use here. Thanks, vishy -- View this message in context: http://www.nabble.com/Validation-Question-tp20590141p20593050.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: null lastPage at restoreAfterSerialization
Hi Matej, I'm browsing your changes. Please notice that according to my own debugging it's lastPage itself that is null and not only the result of prepareForSerialization. So I don't think the warning PageStore prepared non-null page as null for serialization will ever be reached. Anyway, I will add other warnings and keep you informed of the output as soon as I can. This is really tricky to debug because up til today I'm only able to reproduce it at full scale in a production environment. Do you have any idea why a lastPage would be null after 120 secs of the request that created the session? Specially for sessions that don't survive that first request. An exception that could avoid request cycle to detach the session maybe? Thanks! -Carlos On Wed, Nov 19, 2008 at 7:18 PM, Matej Knopp [EMAIL PROTECTED] wrote: This really is weird. I added couple of warnings and null check to 1.4 trunk. I wonder if that helps it though. -Matej On Wed, Nov 19, 2008 at 12:44 PM, Carlos Pita [EMAIL PROTECTED] wrote: The last one of the saga for now, I badly need to sleep. I've been sampling tomcat work dir every second: i=0; while [[ i -le 300 ]]; do echo $i; ls -lt /u01/tomcatWork/_ /tmp/work$i; sleep 1; i=$((i + 1)); done Then I greped a number of session ids corresponding to restoreAfterSerialization errors and every one of them appears in zero or one samples at most. With maxIdleTime = 120 secs the pattern is this: /u01/tomcatWork/_/wicketServlet-fileStore/sessionid created at T - 120 secs /u01/tomcatWork/_/sessionid.session swapped out at T - serialized restoreAfterSerialization error expired at ~T - deserialized The life span of /u01/tomcatWork/_/sessionid.session is of a fraction of a second. So the problem seems to be definitely related to short lived sessions that are removed immediately after being swapped out. The session is removed sooner than expected because of the exception that is thrown attempting to deserialize the lastPage. This is clear from inspection of tomcat's StoreBase.processExpires: try { StandardSession session = (StandardSession) load(keys[i]); -- load fails . if (session.isValid()) { continue; -- ideally we should be here } . remove(session.getIdInternal()); } catch (Exception e) { . remove(keys[i]); -- but instead /u01/tomcatWork/_/sessionid.session is prematurely removed here } HIH -Carlos On Wed, Nov 19, 2008 at 7:34 AM, Carlos Pita [EMAIL PROTECTED] wrote: Another fact that could be relevant is that this only happens upon processexpires, but never for swapin, which seems to suggest that the span of the sessions that fail to restore is just one request (maybe the ones coming from bots that don't support cookies). Best regards -Carlos On Wed, Nov 19, 2008 at 7:13 AM, Carlos Pita [EMAIL PROTECTED] wrote: Hi all, as I've a requirement to maintain long lived sessions (~120s) I'm using tomcat's PersistentManager to avoid keeping lots of sessions in memory, each one with its own lastPage. I'm observing, specially in a heavy loaded production environment, permanent errors with a trace like Nov 19, 2008 1:56:20 AM org.apache.catalina.session.StoreBase processExpires SEVERE: Session: 115F3CD5A33E7D941AF8971FA62DE270; java.lang.IllegalArgumentException: Unknown object type null at org.apache.wicket.protocol.http.pagestore.DiskPageStore.restoreAfterSerialization(DiskPageStore.java:1214) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.readObject(SecondLevelCacheSessionStore.java:409) at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942) at org.apache.catalina.session.FileStore.load(FileStore.java:296) at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:195) at org.apache.catalina.session.PersistentManagerBase.processExpires(PersistentManagerBase.java:553) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:667) I've managed myself to reproduced this error in a more controlled environment and I
Re: Compoundpropertymodel with shadow map?
BTW this is a flawed approch.. We need something a little more intelligent.. I'll return on the subject.. Nino Saturnino Martinez Vazquez Wael wrote: heres the raw and completely untested version of it. probably with a whole bunch of issues...: package zeuzgroup.web.model; import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import org.apache.wicket.Component; import org.apache.wicket.WicketRuntimeException; import org.apache.wicket.model.AbstractPropertyModel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.IWrapModel; public class EditorModelT extends CompoundPropertyModelT { private final MapString, Object newValues = new HashMapString, Object(); public EditorModel(IModelT underlyingModel) { super(underlyingModel); } public void fillOriginal() { Class? c = this.getObject().getClass(); for (EntryString, Object entry : newValues.entrySet()) { try { Field t = c.getDeclaredField(entry.getKey()); t.set(this.getObject(), entry.getValue()); } catch (Exception e) { throw new WicketRuntimeException(Could not set + entry.getKey(), e); } } } public C IWrapModelC wrapOnInheritance(Component component) { return new AttachedCompoundPropertyModelC(component, newValues); } private class AttachedCompoundPropertyModelC extends AbstractPropertyModelC implements IWrapModelC { private static final long serialVersionUID = 1L; private final Component owner; private final MapString, Object newValues; /** * Constructor * * @param owner *component that this model has been attached to */ public AttachedCompoundPropertyModel(Component owner, MapString,Object map) { super(EditorModel.this); this.owner = owner; this.newValues = map; } @Override public C getObject() { if (EditorModel.this.newValues.containsKey(owner.getId())) { return (C) newValues.get(owner.getId()); } else { return super.getObject(); } } @Override public void setObject(C object) { newValues.put(owner.getId(), object); } /** * @see org.apache.wicket.model.AbstractPropertyModel#propertyExpression() */ @Override protected String propertyExpression() { return EditorModel.this.propertyExpression(owner); } /** * @see org.apache.wicket.model.IWrapModel#getWrappedModel() */ public IModelT getWrappedModel() { return EditorModel.this; } /** * @see org.apache.wicket.model.AbstractPropertyModel#detach() */ @Override public void detach() { super.detach(); EditorModel.this.detach(); } } } // IComponentAssignedModel / IWrapModel Francisco Diaz Trepat - gmail wrote: Nice, I was up to something similar. On Tue, Nov 18, 2008 at 9:43 AM, Nino Saturnino Martinez Vazquez Wael [EMAIL PROTECTED] wrote: Hi Im trying todo a compoundpropertymodel which does not change original values in the original model. I need this since I am updating some stuff in a wizard but I first want to commit when the user confirms in the end of the wizard, and if the model are changed directly the transaction are automatically committed to the database So my idea were to todo a shadowCompoundPropertyModel something like this: class EditorModel extends CompoundPropertyModel { private Map newValues=new HashMapString, Object(); public EditorModel(CompoundPropertyModel underlyingModel, String propertyName) { super(underlyingModel); } public getObject (String property){ check if there are something in the map if so return it, otherwise fall back to the underlying model } public setObject (String prop, Value){ put changes in the map... } public UpdateOriginal(){ iterate over the map and use reflection to set values on the original model.. } } Does anybody have something similar floating around, in a more complete state..? Or could it be done in a easier way? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: Wicket 1.3.5 behind a front-end proxy
To get Apache 2.2 to proxy around Wicket, I have the following defined: IfDefine PROXY ProxyPass / http://localhost:8080/cware/ ProxyPassReverse/ http://localhost:8080/cware/ ProxyPassReverseCookieDomainlocalhost .laccetti.com ProxyPassReverseCookiePath /cware / /IfDefine Nothing special required in the web.xml, Tomcat doesn't know that it is being proxied, etc. HTH, Mike My configuration is about the same. ServerAlias wicket.ru ProxyPass /stats/ ! ProxyPass /webmail/ ! ProxyPass /lxadmin/ ! ProxyPass / ajp://localhost:8858/WicketRu/ ProxyPassReverse / ajp://localhost:8858/WicketRu/ ProxyPassReverseCookiePath /WicketRu / Only AJP protocol is different, cookies work OK - domain and path are set correctly, session id is not generated again after every GET. I'll repeat the problem: Application is WicketRu. It works correctly when accessed through full URL. Alias is wicket.ru http://wicket.ru opens. But links don't work. wicket.ru on the top is a Link with onClick() and setResponsePage(Index.class). Click on it shows 404 with ***strange*** ***double WicketRu. I think something wrong with relative path. Wicket 1.3.5 Tony. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]