Re: Reload Wicket classes/markup without reloading Servlet Container
At € day job we pay a lot to use jrebel. Not perfect but does the job reasonably well. Unfortunately their new licensing model made it about 4 times more expensive for us to use it. Martijn On Friday, 2 September 2016, Tobias Soloschenko < tobiassolosche...@googlemail.com> wrote: > Hi, > > you could use Jetty and run it in debug mode within your IDE. See > StartExamples Java-Class > > https://github.com/apache/wicket/blob/master/wicket- > examples/src/test/java/org/apache/wicket/examples/StartExamples.java > > kind regards > > Tobias > > > Am 02.09.2016 um 03:19 schrieb James Selvakumar >: > > > > Dear Wicket community, > > > > May I know what techniques/tools are used by the community to reload > Wicket > > classes and markup without reloading Servlet Container to speed up > > development? > > > > -- > > Thanks & regards > > James Selvakumar > > mCruncher > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com
Re: Reload Wicket classes/markup without reloading Servlet Container
Hi, you could use Jetty and run it in debug mode within your IDE. See StartExamples Java-Class https://github.com/apache/wicket/blob/master/wicket-examples/src/test/java/org/apache/wicket/examples/StartExamples.java kind regards Tobias > Am 02.09.2016 um 03:19 schrieb James Selvakumar : > > Dear Wicket community, > > May I know what techniques/tools are used by the community to reload Wicket > classes and markup without reloading Servlet Container to speed up > development? > > -- > Thanks & regards > James Selvakumar > mCruncher - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Reload Wicket classes/markup without reloading Servlet Container
Dear Wicket community, May I know what techniques/tools are used by the community to reload Wicket classes and markup without reloading Servlet Container to speed up development? -- Thanks & regards James Selvakumar mCruncher
Re: Border code works in 6.21 but failed in 6.22
I finally pinpoint where goes wrong. In my page's renderHead() method , I remove this line , and everything is fine again. @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(FixBootstrapStylesCssResourceReference.INSTANCE)); //response.render(new FilteredHeaderItem(JavaScriptHeaderItem.forReference(ApplicationJavaScript.INSTANCE), "footer-container")); if ("google".equalsIgnoreCase(activeTheme().name())) { response.render(CssHeaderItem.forReference(DocsCssResourceReference.GOOGLE)); } } I already forgot why I added this *FilteredHeaderItem* to my renderHead() , but it seems it is the culprit that causes the problem. After comment out this line , it works well in 6.22 , and 6.24 The referenced ApplicationJavaScript.java content : public class ApplicationJavaScript extends JavaScriptResourceReference { public static final ApplicationJavaScript INSTANCE = new ApplicationJavaScript(); private ApplicationJavaScript() { super(ApplicationJavaScript.class, "application.js"); } @Override public Iterable getDependencies() { final List dependencies = Lists.newArrayList(super.getDependencies()); dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); dependencies.add(JavaScriptHeaderItem.forReference(Bootstrap.getSettings().getJsResourceReference())); return dependencies; } } It seems this file is safe to delete too. 2016-09-02 1:52 GMT+08:00 Martin Grigorov : > Please create a demo app and attach it to a ticket at JIRA. > Thanks! > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Thu, Sep 1, 2016 at 6:38 PM, smallufo wrote: > > > no. > > > > > > > > > > > > > > > > */*** 6.19 ok* 6.21 ok* 6.22 failed* 6.23 failed* 6.24 failed*/* > > > > > > 2016-09-01 22:06 GMT+08:00 Martin Grigorov : > > > > > Hi, > > > > > > Does it work in 6.24.0 ? > > > > > > Martin Grigorov > > > Wicket Training and Consulting > > > https://twitter.com/mtgrigorov > > > > > > On Thu, Sep 1, 2016 at 1:53 PM, smallufo wrote: > > > > > > > Hi > > > > This border code works in 6.21 but failed in 6.22 > > > > > > > > It is a traditional 'portlet-like' border , with a 'title' and an > ajax > > > link > > > > ( which will collapse/expand when clicked ) > > > > > > > > I lookup up the change log > > > > http://archive.apache.org/dist/wicket/6.24.0/CHANGELOG-6.x > > > > but didn't find anything related to Border. > > > > > > > > > > > > > > > > import org.apache.wicket.MarkupContainer; > > > > import org.apache.wicket.ajax.AjaxRequestTarget; > > > > import org.apache.wicket.ajax.markup.html.AjaxLink; > > > > import org.apache.wicket.markup.html.WebMarkupContainer; > > > > import org.apache.wicket.markup.html.basic.Label; > > > > import org.apache.wicket.markup.html.border.Border; > > > > import org.apache.wicket.model.StringResourceModel; > > > > > > > > public class PulldownBorder extends Border { > > > > > > > > private final WebMarkupContainer content; > > > > > > > > /** is content expanded ? */ > > > > private boolean expanded; > > > > > > > > /** is content visible ? */ > > > > public boolean contentVisible() { > > > > return content.isVisible(); > > > > } > > > > > > > > public PulldownBorder(String id, String title, boolean > > > defaultExpanded) { > > > > super(id); > > > > > > > > setOutputMarkupPlaceholderTag(true); > > > > setRenderBodyOnly(false); > > > > > > > > Label titleLabel = new Label("title", title); > > > > expanded = defaultExpanded; > > > > > > > > content = new WebMarkupContainer("content"); > > > > > > > > content.setOutputMarkupPlaceholderTag(true); > > > > content.setVisible(defaultExpanded); > > > > content.setRenderBodyOnly(false); > > > > add(content); > > > > //content.add(getBodyContainer()); > > > > addToBorder(content); > > > > > > > > //collapse / expand , text > > > > final Label collapseExpandText = new Label("collapseExpandText"); > > > > collapseExpandText.setOutputMarkupPlaceholderTag(true); > > > > if (content.isVisible()) > > > > collapseExpandText.setDefaultModel(new > > > > StringResourceModel("collapse", this, null)); > > > > else > > > > collapseExpandText.setDefaultModel(new > > > > StringResourceModel("expand", this, null)); > > > > > > > > > > > > //this link failed in 6.22 > > > > AjaxLink collapseExpandLink = new > > > > AjaxLink("collapseExpandLink") { > > > > @Override > > > > public void onClick(AjaxRequestTarget target) { > > > > expanded = !expanded; > > > > content.setVisible(expanded); > > > > target.add(content); > > > > > > > > MarkupContainer mc = (MarkupContainer) > > > > findParent(ExpandCollapseListener.class); > > > > if (mc != null) { > > > > if (mc instanceof Expand
Re: Border code works in 6.21 but failed in 6.22
Please create a demo app and attach it to a ticket at JIRA. Thanks! Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 1, 2016 at 6:38 PM, smallufo wrote: > no. > > > > > > > > */*** 6.19 ok* 6.21 ok* 6.22 failed* 6.23 failed* 6.24 failed*/* > > > 2016-09-01 22:06 GMT+08:00 Martin Grigorov : > > > Hi, > > > > Does it work in 6.24.0 ? > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Thu, Sep 1, 2016 at 1:53 PM, smallufo wrote: > > > > > Hi > > > This border code works in 6.21 but failed in 6.22 > > > > > > It is a traditional 'portlet-like' border , with a 'title' and an ajax > > link > > > ( which will collapse/expand when clicked ) > > > > > > I lookup up the change log > > > http://archive.apache.org/dist/wicket/6.24.0/CHANGELOG-6.x > > > but didn't find anything related to Border. > > > > > > > > > > > > import org.apache.wicket.MarkupContainer; > > > import org.apache.wicket.ajax.AjaxRequestTarget; > > > import org.apache.wicket.ajax.markup.html.AjaxLink; > > > import org.apache.wicket.markup.html.WebMarkupContainer; > > > import org.apache.wicket.markup.html.basic.Label; > > > import org.apache.wicket.markup.html.border.Border; > > > import org.apache.wicket.model.StringResourceModel; > > > > > > public class PulldownBorder extends Border { > > > > > > private final WebMarkupContainer content; > > > > > > /** is content expanded ? */ > > > private boolean expanded; > > > > > > /** is content visible ? */ > > > public boolean contentVisible() { > > > return content.isVisible(); > > > } > > > > > > public PulldownBorder(String id, String title, boolean > > defaultExpanded) { > > > super(id); > > > > > > setOutputMarkupPlaceholderTag(true); > > > setRenderBodyOnly(false); > > > > > > Label titleLabel = new Label("title", title); > > > expanded = defaultExpanded; > > > > > > content = new WebMarkupContainer("content"); > > > > > > content.setOutputMarkupPlaceholderTag(true); > > > content.setVisible(defaultExpanded); > > > content.setRenderBodyOnly(false); > > > add(content); > > > //content.add(getBodyContainer()); > > > addToBorder(content); > > > > > > //collapse / expand , text > > > final Label collapseExpandText = new Label("collapseExpandText"); > > > collapseExpandText.setOutputMarkupPlaceholderTag(true); > > > if (content.isVisible()) > > > collapseExpandText.setDefaultModel(new > > > StringResourceModel("collapse", this, null)); > > > else > > > collapseExpandText.setDefaultModel(new > > > StringResourceModel("expand", this, null)); > > > > > > > > > //this link failed in 6.22 > > > AjaxLink collapseExpandLink = new > > > AjaxLink("collapseExpandLink") { > > > @Override > > > public void onClick(AjaxRequestTarget target) { > > > expanded = !expanded; > > > content.setVisible(expanded); > > > target.add(content); > > > > > > MarkupContainer mc = (MarkupContainer) > > > findParent(ExpandCollapseListener.class); > > > if (mc != null) { > > > if (mc instanceof ExpandCollapseListener) { > > > ExpandCollapseListener listener = (ExpandCollapseListener) > > mc; > > > listener.setExpanded(expanded); > > > } > > > } > > > > > > if (!expanded) { > > > target.add(collapseExpandText.setDefaultModel(new > > > StringResourceModel("expand", this, null))); > > > } > > > else { > > > target.add(collapseExpandText.setDefaultModel(new > > > StringResourceModel("collapse", this, null))); > > > } > > > } > > > }; > > > addToBorder(collapseExpandLink); > > > collapseExpandLink.add(collapseExpandText); > > > collapseExpandLink.add(titleLabel); > > > } > > > } > > > > > > > > > public interface ExpandCollapseListener { > > > > > > void setExpanded(boolean value); > > > } > > > > > > > > > The problem comes from *collapseExpandLink* , which works in 6.21 , but > > > failed in 6.22 > > > > > > I cannot find where goes wrong. > > > Can somebody give me some hint ? > > > > > > Thanks. > > > > > >
Re: Border code works in 6.21 but failed in 6.22
no. */*** 6.19 ok* 6.21 ok* 6.22 failed* 6.23 failed* 6.24 failed*/* 2016-09-01 22:06 GMT+08:00 Martin Grigorov : > Hi, > > Does it work in 6.24.0 ? > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Thu, Sep 1, 2016 at 1:53 PM, smallufo wrote: > > > Hi > > This border code works in 6.21 but failed in 6.22 > > > > It is a traditional 'portlet-like' border , with a 'title' and an ajax > link > > ( which will collapse/expand when clicked ) > > > > I lookup up the change log > > http://archive.apache.org/dist/wicket/6.24.0/CHANGELOG-6.x > > but didn't find anything related to Border. > > > > > > > > import org.apache.wicket.MarkupContainer; > > import org.apache.wicket.ajax.AjaxRequestTarget; > > import org.apache.wicket.ajax.markup.html.AjaxLink; > > import org.apache.wicket.markup.html.WebMarkupContainer; > > import org.apache.wicket.markup.html.basic.Label; > > import org.apache.wicket.markup.html.border.Border; > > import org.apache.wicket.model.StringResourceModel; > > > > public class PulldownBorder extends Border { > > > > private final WebMarkupContainer content; > > > > /** is content expanded ? */ > > private boolean expanded; > > > > /** is content visible ? */ > > public boolean contentVisible() { > > return content.isVisible(); > > } > > > > public PulldownBorder(String id, String title, boolean > defaultExpanded) { > > super(id); > > > > setOutputMarkupPlaceholderTag(true); > > setRenderBodyOnly(false); > > > > Label titleLabel = new Label("title", title); > > expanded = defaultExpanded; > > > > content = new WebMarkupContainer("content"); > > > > content.setOutputMarkupPlaceholderTag(true); > > content.setVisible(defaultExpanded); > > content.setRenderBodyOnly(false); > > add(content); > > //content.add(getBodyContainer()); > > addToBorder(content); > > > > //collapse / expand , text > > final Label collapseExpandText = new Label("collapseExpandText"); > > collapseExpandText.setOutputMarkupPlaceholderTag(true); > > if (content.isVisible()) > > collapseExpandText.setDefaultModel(new > > StringResourceModel("collapse", this, null)); > > else > > collapseExpandText.setDefaultModel(new > > StringResourceModel("expand", this, null)); > > > > > > //this link failed in 6.22 > > AjaxLink collapseExpandLink = new > > AjaxLink("collapseExpandLink") { > > @Override > > public void onClick(AjaxRequestTarget target) { > > expanded = !expanded; > > content.setVisible(expanded); > > target.add(content); > > > > MarkupContainer mc = (MarkupContainer) > > findParent(ExpandCollapseListener.class); > > if (mc != null) { > > if (mc instanceof ExpandCollapseListener) { > > ExpandCollapseListener listener = (ExpandCollapseListener) > mc; > > listener.setExpanded(expanded); > > } > > } > > > > if (!expanded) { > > target.add(collapseExpandText.setDefaultModel(new > > StringResourceModel("expand", this, null))); > > } > > else { > > target.add(collapseExpandText.setDefaultModel(new > > StringResourceModel("collapse", this, null))); > > } > > } > > }; > > addToBorder(collapseExpandLink); > > collapseExpandLink.add(collapseExpandText); > > collapseExpandLink.add(titleLabel); > > } > > } > > > > > > public interface ExpandCollapseListener { > > > > void setExpanded(boolean value); > > } > > > > > > The problem comes from *collapseExpandLink* , which works in 6.21 , but > > failed in 6.22 > > > > I cannot find where goes wrong. > > Can somebody give me some hint ? > > > > Thanks. > > >
Re: Border code works in 6.21 but failed in 6.22
Hi, Does it work in 6.24.0 ? Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 1, 2016 at 1:53 PM, smallufo wrote: > Hi > This border code works in 6.21 but failed in 6.22 > > It is a traditional 'portlet-like' border , with a 'title' and an ajax link > ( which will collapse/expand when clicked ) > > I lookup up the change log > http://archive.apache.org/dist/wicket/6.24.0/CHANGELOG-6.x > but didn't find anything related to Border. > > > > import org.apache.wicket.MarkupContainer; > import org.apache.wicket.ajax.AjaxRequestTarget; > import org.apache.wicket.ajax.markup.html.AjaxLink; > import org.apache.wicket.markup.html.WebMarkupContainer; > import org.apache.wicket.markup.html.basic.Label; > import org.apache.wicket.markup.html.border.Border; > import org.apache.wicket.model.StringResourceModel; > > public class PulldownBorder extends Border { > > private final WebMarkupContainer content; > > /** is content expanded ? */ > private boolean expanded; > > /** is content visible ? */ > public boolean contentVisible() { > return content.isVisible(); > } > > public PulldownBorder(String id, String title, boolean defaultExpanded) { > super(id); > > setOutputMarkupPlaceholderTag(true); > setRenderBodyOnly(false); > > Label titleLabel = new Label("title", title); > expanded = defaultExpanded; > > content = new WebMarkupContainer("content"); > > content.setOutputMarkupPlaceholderTag(true); > content.setVisible(defaultExpanded); > content.setRenderBodyOnly(false); > add(content); > //content.add(getBodyContainer()); > addToBorder(content); > > //collapse / expand , text > final Label collapseExpandText = new Label("collapseExpandText"); > collapseExpandText.setOutputMarkupPlaceholderTag(true); > if (content.isVisible()) > collapseExpandText.setDefaultModel(new > StringResourceModel("collapse", this, null)); > else > collapseExpandText.setDefaultModel(new > StringResourceModel("expand", this, null)); > > > //this link failed in 6.22 > AjaxLink collapseExpandLink = new > AjaxLink("collapseExpandLink") { > @Override > public void onClick(AjaxRequestTarget target) { > expanded = !expanded; > content.setVisible(expanded); > target.add(content); > > MarkupContainer mc = (MarkupContainer) > findParent(ExpandCollapseListener.class); > if (mc != null) { > if (mc instanceof ExpandCollapseListener) { > ExpandCollapseListener listener = (ExpandCollapseListener) mc; > listener.setExpanded(expanded); > } > } > > if (!expanded) { > target.add(collapseExpandText.setDefaultModel(new > StringResourceModel("expand", this, null))); > } > else { > target.add(collapseExpandText.setDefaultModel(new > StringResourceModel("collapse", this, null))); > } > } > }; > addToBorder(collapseExpandLink); > collapseExpandLink.add(collapseExpandText); > collapseExpandLink.add(titleLabel); > } > } > > > public interface ExpandCollapseListener { > > void setExpanded(boolean value); > } > > > The problem comes from *collapseExpandLink* , which works in 6.21 , but > failed in 6.22 > > I cannot find where goes wrong. > Can somebody give me some hint ? > > Thanks. >
Border code works in 6.21 but failed in 6.22
Hi This border code works in 6.21 but failed in 6.22 It is a traditional 'portlet-like' border , with a 'title' and an ajax link ( which will collapse/expand when clicked ) I lookup up the change log http://archive.apache.org/dist/wicket/6.24.0/CHANGELOG-6.x but didn't find anything related to Border. import org.apache.wicket.MarkupContainer; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.AjaxLink; import org.apache.wicket.markup.html.WebMarkupContainer; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.border.Border; import org.apache.wicket.model.StringResourceModel; public class PulldownBorder extends Border { private final WebMarkupContainer content; /** is content expanded ? */ private boolean expanded; /** is content visible ? */ public boolean contentVisible() { return content.isVisible(); } public PulldownBorder(String id, String title, boolean defaultExpanded) { super(id); setOutputMarkupPlaceholderTag(true); setRenderBodyOnly(false); Label titleLabel = new Label("title", title); expanded = defaultExpanded; content = new WebMarkupContainer("content"); content.setOutputMarkupPlaceholderTag(true); content.setVisible(defaultExpanded); content.setRenderBodyOnly(false); add(content); //content.add(getBodyContainer()); addToBorder(content); //collapse / expand , text final Label collapseExpandText = new Label("collapseExpandText"); collapseExpandText.setOutputMarkupPlaceholderTag(true); if (content.isVisible()) collapseExpandText.setDefaultModel(new StringResourceModel("collapse", this, null)); else collapseExpandText.setDefaultModel(new StringResourceModel("expand", this, null)); //this link failed in 6.22 AjaxLink collapseExpandLink = new AjaxLink("collapseExpandLink") { @Override public void onClick(AjaxRequestTarget target) { expanded = !expanded; content.setVisible(expanded); target.add(content); MarkupContainer mc = (MarkupContainer) findParent(ExpandCollapseListener.class); if (mc != null) { if (mc instanceof ExpandCollapseListener) { ExpandCollapseListener listener = (ExpandCollapseListener) mc; listener.setExpanded(expanded); } } if (!expanded) { target.add(collapseExpandText.setDefaultModel(new StringResourceModel("expand", this, null))); } else { target.add(collapseExpandText.setDefaultModel(new StringResourceModel("collapse", this, null))); } } }; addToBorder(collapseExpandLink); collapseExpandLink.add(collapseExpandText); collapseExpandLink.add(titleLabel); } } public interface ExpandCollapseListener { void setExpanded(boolean value); } The problem comes from *collapseExpandLink* , which works in 6.21 , but failed in 6.22 I cannot find where goes wrong. Can somebody give me some hint ? Thanks.
Re: Question regarding WebSocketBehavior::onConnect message
The WebSocket connection is closed and a new one is opened at page reload. Check whether you have JSESSIONID cookie before reloading the page. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 1, 2016 at 9:53 AM, Maxim Solodovnik wrote: > The situation is weird and I don't know how it can be investigated > > everything works as expected in case NoVersionMapper is not used. > > If I'm using NoVersionMapper page is loaded and work as expected if loaded > via URL > But if after that I'll reload it using Shift+F5 I got continuous reloading, > URL polluting and NPE because Session is NULL. > > Maybe you can suggest how this can be debugged? > > On Thu, Sep 1, 2016 at 2:44 PM, Martin Grigorov > wrote: > > > JavaxUpgradeHttpRequest is just a POJO that stores the data from the > > original upgrade request. > > WebSocket requests are not normal HTTP requests so they cannot create an > > http session. > > > > So, if there was an existing HTTP session when the WebSocket connection > is > > established then we store the data that is available at that time. > > But if there is no session at that time then this WebSocket connection > > cannot a reference to a newly created one at later point of time. > > > > Martin Grigorov > > Wicket Training and Consulting > > https://twitter.com/mtgrigorov > > > > On Thu, Sep 1, 2016 at 9:25 AM, Maxim Solodovnik > > wrote: > > > > > This only happen in case I'm using NoVersion page mapper > > > > > > On Thu, Sep 1, 2016 at 2:24 PM, Maxim Solodovnik > > > > wrote: > > > > > > > It works as expected with one minor change: > > > > -- Wicket.Event.WebSocket.Opened > > > > ++ Wicket.Event.Topic.WebSocket.Opened > > > > > > > > Thanks :) > > > > > > > > Another question: > > > > Why org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest. > > > getSession(boolean) > > > > does not creates the session even if boolean parameter is true? > > > > I have weird behavior because of this: on Shift+F5 page continuously > > > > reloading > > > > all page parameters are duplicated in the URL until I got Bad Request > > > > > > > > > > > > > > > On Thu, Sep 1, 2016 at 12:56 PM, Maxim Solodovnik < > > solomax...@gmail.com> > > > > wrote: > > > > > > > >> OK > > > >> Will try :) > > > >> > > > >> I had an idea like this, but hoping there is some other way :) > > > >> > > > >> On Thu, Sep 1, 2016 at 12:54 PM, Martin Grigorov < > > mgrigo...@apache.org> > > > >> wrote: > > > >> > > > >>> I think you should listen for the "open" message on the client side > > and > > > >>> once it comes then send a message to ask for the initial update. > > > >>> Something like: Wicket.Event.subscribe(Wicket. > > Event.WebSocket.Opened, > > > >>> function() { Wicket.WebSocket.send("initialRepaint") }) > > > >>> > > > >>> Martin Grigorov > > > >>> Wicket Training and Consulting > > > >>> https://twitter.com/mtgrigorov > > > >>> > > > >>> On Thu, Sep 1, 2016 at 7:41 AM, Maxim Solodovnik < > > solomax...@gmail.com > > > > > > > >>> wrote: > > > >>> > > > >>> > It is technically possible ... but with no effect : > > > >>> > What should be the steps to send component tree update on > websocket > > > >>> client > > > >>> > connect? > > > >>> > > > > >>> > On Thu, Sep 1, 2016 at 12:35 PM, Martin Grigorov < > > > mgrigo...@apache.org > > > >>> > > > > >>> > wrote: > > > >>> > > > > >>> > > Hi Maxim, > > > >>> > > > > > >>> > > If I remember correctly it is not yet possible to write to the > > > >>> client at > > > >>> > > that point. > > > >>> > > But I might be wrong. > > > >>> > > > > > >>> > > Martin Grigorov > > > >>> > > Wicket Training and Consulting > > > >>> > > https://twitter.com/mtgrigorov > > > >>> > > > > > >>> > > On Thu, Sep 1, 2016 at 7:11 AM, Maxim Solodovnik < > > > >>> solomax...@gmail.com> > > > >>> > > wrote: > > > >>> > > > > > >>> > > > Hello, > > > >>> > > > > > > >>> > > > I wonder why we don't have WebSocketRequestHandler in > onConnect > > > >>> message > > > >>> > > > handler. > > > >>> > > > I would like to perform markup update on client connect, and > it > > > >>> seems > > > >>> > to > > > >>> > > be > > > >>> > > > impossible without copy/pasting onEvent method code > > > >>> > > > > > > >>> > > > -- > > > >>> > > > WBR > > > >>> > > > Maxim aka solomax > > > >>> > > > > > > >>> > > > > > >>> > > > > >>> > > > > >>> > > > > >>> > -- > > > >>> > WBR > > > >>> > Maxim aka solomax > > > >>> > > > > >>> > > > >> > > > >> > > > >> > > > >> -- > > > >> WBR > > > >> Maxim aka solomax > > > >> > > > > > > > > > > > > > > > > -- > > > > WBR > > > > Maxim aka solomax > > > > > > > > > > > > > > > > -- > > > WBR > > > Maxim aka solomax > > > > > > > > > -- > WBR > Maxim aka solomax >
Re: Question regarding WebSocketBehavior::onConnect message
The situation is weird and I don't know how it can be investigated everything works as expected in case NoVersionMapper is not used. If I'm using NoVersionMapper page is loaded and work as expected if loaded via URL But if after that I'll reload it using Shift+F5 I got continuous reloading, URL polluting and NPE because Session is NULL. Maybe you can suggest how this can be debugged? On Thu, Sep 1, 2016 at 2:44 PM, Martin Grigorov wrote: > JavaxUpgradeHttpRequest is just a POJO that stores the data from the > original upgrade request. > WebSocket requests are not normal HTTP requests so they cannot create an > http session. > > So, if there was an existing HTTP session when the WebSocket connection is > established then we store the data that is available at that time. > But if there is no session at that time then this WebSocket connection > cannot a reference to a newly created one at later point of time. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Thu, Sep 1, 2016 at 9:25 AM, Maxim Solodovnik > wrote: > > > This only happen in case I'm using NoVersion page mapper > > > > On Thu, Sep 1, 2016 at 2:24 PM, Maxim Solodovnik > > wrote: > > > > > It works as expected with one minor change: > > > -- Wicket.Event.WebSocket.Opened > > > ++ Wicket.Event.Topic.WebSocket.Opened > > > > > > Thanks :) > > > > > > Another question: > > > Why org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest. > > getSession(boolean) > > > does not creates the session even if boolean parameter is true? > > > I have weird behavior because of this: on Shift+F5 page continuously > > > reloading > > > all page parameters are duplicated in the URL until I got Bad Request > > > > > > > > > > > On Thu, Sep 1, 2016 at 12:56 PM, Maxim Solodovnik < > solomax...@gmail.com> > > > wrote: > > > > > >> OK > > >> Will try :) > > >> > > >> I had an idea like this, but hoping there is some other way :) > > >> > > >> On Thu, Sep 1, 2016 at 12:54 PM, Martin Grigorov < > mgrigo...@apache.org> > > >> wrote: > > >> > > >>> I think you should listen for the "open" message on the client side > and > > >>> once it comes then send a message to ask for the initial update. > > >>> Something like: Wicket.Event.subscribe(Wicket. > Event.WebSocket.Opened, > > >>> function() { Wicket.WebSocket.send("initialRepaint") }) > > >>> > > >>> Martin Grigorov > > >>> Wicket Training and Consulting > > >>> https://twitter.com/mtgrigorov > > >>> > > >>> On Thu, Sep 1, 2016 at 7:41 AM, Maxim Solodovnik < > solomax...@gmail.com > > > > > >>> wrote: > > >>> > > >>> > It is technically possible ... but with no effect : > > >>> > What should be the steps to send component tree update on websocket > > >>> client > > >>> > connect? > > >>> > > > >>> > On Thu, Sep 1, 2016 at 12:35 PM, Martin Grigorov < > > mgrigo...@apache.org > > >>> > > > >>> > wrote: > > >>> > > > >>> > > Hi Maxim, > > >>> > > > > >>> > > If I remember correctly it is not yet possible to write to the > > >>> client at > > >>> > > that point. > > >>> > > But I might be wrong. > > >>> > > > > >>> > > Martin Grigorov > > >>> > > Wicket Training and Consulting > > >>> > > https://twitter.com/mtgrigorov > > >>> > > > > >>> > > On Thu, Sep 1, 2016 at 7:11 AM, Maxim Solodovnik < > > >>> solomax...@gmail.com> > > >>> > > wrote: > > >>> > > > > >>> > > > Hello, > > >>> > > > > > >>> > > > I wonder why we don't have WebSocketRequestHandler in onConnect > > >>> message > > >>> > > > handler. > > >>> > > > I would like to perform markup update on client connect, and it > > >>> seems > > >>> > to > > >>> > > be > > >>> > > > impossible without copy/pasting onEvent method code > > >>> > > > > > >>> > > > -- > > >>> > > > WBR > > >>> > > > Maxim aka solomax > > >>> > > > > > >>> > > > > >>> > > > >>> > > > >>> > > > >>> > -- > > >>> > WBR > > >>> > Maxim aka solomax > > >>> > > > >>> > > >> > > >> > > >> > > >> -- > > >> WBR > > >> Maxim aka solomax > > >> > > > > > > > > > > > > -- > > > WBR > > > Maxim aka solomax > > > > > > > > > > > -- > > WBR > > Maxim aka solomax > > > -- WBR Maxim aka solomax
Re: Question regarding WebSocketBehavior::onConnect message
JavaxUpgradeHttpRequest is just a POJO that stores the data from the original upgrade request. WebSocket requests are not normal HTTP requests so they cannot create an http session. So, if there was an existing HTTP session when the WebSocket connection is established then we store the data that is available at that time. But if there is no session at that time then this WebSocket connection cannot a reference to a newly created one at later point of time. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Sep 1, 2016 at 9:25 AM, Maxim Solodovnik wrote: > This only happen in case I'm using NoVersion page mapper > > On Thu, Sep 1, 2016 at 2:24 PM, Maxim Solodovnik > wrote: > > > It works as expected with one minor change: > > -- Wicket.Event.WebSocket.Opened > > ++ Wicket.Event.Topic.WebSocket.Opened > > > > Thanks :) > > > > Another question: > > Why org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest. > getSession(boolean) > > does not creates the session even if boolean parameter is true? > > I have weird behavior because of this: on Shift+F5 page continuously > > reloading > > all page parameters are duplicated in the URL until I got Bad Request > > > > > > > On Thu, Sep 1, 2016 at 12:56 PM, Maxim Solodovnik > > wrote: > > > >> OK > >> Will try :) > >> > >> I had an idea like this, but hoping there is some other way :) > >> > >> On Thu, Sep 1, 2016 at 12:54 PM, Martin Grigorov > >> wrote: > >> > >>> I think you should listen for the "open" message on the client side and > >>> once it comes then send a message to ask for the initial update. > >>> Something like: Wicket.Event.subscribe(Wicket.Event.WebSocket.Opened, > >>> function() { Wicket.WebSocket.send("initialRepaint") }) > >>> > >>> Martin Grigorov > >>> Wicket Training and Consulting > >>> https://twitter.com/mtgrigorov > >>> > >>> On Thu, Sep 1, 2016 at 7:41 AM, Maxim Solodovnik > > >>> wrote: > >>> > >>> > It is technically possible ... but with no effect : > >>> > What should be the steps to send component tree update on websocket > >>> client > >>> > connect? > >>> > > >>> > On Thu, Sep 1, 2016 at 12:35 PM, Martin Grigorov < > mgrigo...@apache.org > >>> > > >>> > wrote: > >>> > > >>> > > Hi Maxim, > >>> > > > >>> > > If I remember correctly it is not yet possible to write to the > >>> client at > >>> > > that point. > >>> > > But I might be wrong. > >>> > > > >>> > > Martin Grigorov > >>> > > Wicket Training and Consulting > >>> > > https://twitter.com/mtgrigorov > >>> > > > >>> > > On Thu, Sep 1, 2016 at 7:11 AM, Maxim Solodovnik < > >>> solomax...@gmail.com> > >>> > > wrote: > >>> > > > >>> > > > Hello, > >>> > > > > >>> > > > I wonder why we don't have WebSocketRequestHandler in onConnect > >>> message > >>> > > > handler. > >>> > > > I would like to perform markup update on client connect, and it > >>> seems > >>> > to > >>> > > be > >>> > > > impossible without copy/pasting onEvent method code > >>> > > > > >>> > > > -- > >>> > > > WBR > >>> > > > Maxim aka solomax > >>> > > > > >>> > > > >>> > > >>> > > >>> > > >>> > -- > >>> > WBR > >>> > Maxim aka solomax > >>> > > >>> > >> > >> > >> > >> -- > >> WBR > >> Maxim aka solomax > >> > > > > > > > > -- > > WBR > > Maxim aka solomax > > > > > > -- > WBR > Maxim aka solomax >
Re: Question regarding WebSocketBehavior::onConnect message
This only happen in case I'm using NoVersion page mapper On Thu, Sep 1, 2016 at 2:24 PM, Maxim Solodovnik wrote: > It works as expected with one minor change: > -- Wicket.Event.WebSocket.Opened > ++ Wicket.Event.Topic.WebSocket.Opened > > Thanks :) > > Another question: > Why > org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest.getSession(boolean) > does not creates the session even if boolean parameter is true? > I have weird behavior because of this: on Shift+F5 page continuously > reloading > all page parameters are duplicated in the URL until I got Bad Request > > > On Thu, Sep 1, 2016 at 12:56 PM, Maxim Solodovnik > wrote: > >> OK >> Will try :) >> >> I had an idea like this, but hoping there is some other way :) >> >> On Thu, Sep 1, 2016 at 12:54 PM, Martin Grigorov >> wrote: >> >>> I think you should listen for the "open" message on the client side and >>> once it comes then send a message to ask for the initial update. >>> Something like: Wicket.Event.subscribe(Wicket.Event.WebSocket.Opened, >>> function() { Wicket.WebSocket.send("initialRepaint") }) >>> >>> Martin Grigorov >>> Wicket Training and Consulting >>> https://twitter.com/mtgrigorov >>> >>> On Thu, Sep 1, 2016 at 7:41 AM, Maxim Solodovnik >>> wrote: >>> >>> > It is technically possible ... but with no effect : >>> > What should be the steps to send component tree update on websocket >>> client >>> > connect? >>> > >>> > On Thu, Sep 1, 2016 at 12:35 PM, Martin Grigorov >> > >>> > wrote: >>> > >>> > > Hi Maxim, >>> > > >>> > > If I remember correctly it is not yet possible to write to the >>> client at >>> > > that point. >>> > > But I might be wrong. >>> > > >>> > > Martin Grigorov >>> > > Wicket Training and Consulting >>> > > https://twitter.com/mtgrigorov >>> > > >>> > > On Thu, Sep 1, 2016 at 7:11 AM, Maxim Solodovnik < >>> solomax...@gmail.com> >>> > > wrote: >>> > > >>> > > > Hello, >>> > > > >>> > > > I wonder why we don't have WebSocketRequestHandler in onConnect >>> message >>> > > > handler. >>> > > > I would like to perform markup update on client connect, and it >>> seems >>> > to >>> > > be >>> > > > impossible without copy/pasting onEvent method code >>> > > > >>> > > > -- >>> > > > WBR >>> > > > Maxim aka solomax >>> > > > >>> > > >>> > >>> > >>> > >>> > -- >>> > WBR >>> > Maxim aka solomax >>> > >>> >> >> >> >> -- >> WBR >> Maxim aka solomax >> > > > > -- > WBR > Maxim aka solomax > -- WBR Maxim aka solomax
Re: Question regarding WebSocketBehavior::onConnect message
It works as expected with one minor change: -- Wicket.Event.WebSocket.Opened ++ Wicket.Event.Topic.WebSocket.Opened Thanks :) Another question: Why org.apache.wicket.protocol.ws.javax.JavaxUpgradeHttpRequest.getSession(boolean) does not creates the session even if boolean parameter is true? I have weird behavior because of this: on Shift+F5 page continuously reloading all page parameters are duplicated in the URL until I got Bad Request On Thu, Sep 1, 2016 at 12:56 PM, Maxim Solodovnik wrote: > OK > Will try :) > > I had an idea like this, but hoping there is some other way :) > > On Thu, Sep 1, 2016 at 12:54 PM, Martin Grigorov > wrote: > >> I think you should listen for the "open" message on the client side and >> once it comes then send a message to ask for the initial update. >> Something like: Wicket.Event.subscribe(Wicket.Event.WebSocket.Opened, >> function() { Wicket.WebSocket.send("initialRepaint") }) >> >> Martin Grigorov >> Wicket Training and Consulting >> https://twitter.com/mtgrigorov >> >> On Thu, Sep 1, 2016 at 7:41 AM, Maxim Solodovnik >> wrote: >> >> > It is technically possible ... but with no effect : >> > What should be the steps to send component tree update on websocket >> client >> > connect? >> > >> > On Thu, Sep 1, 2016 at 12:35 PM, Martin Grigorov >> > wrote: >> > >> > > Hi Maxim, >> > > >> > > If I remember correctly it is not yet possible to write to the client >> at >> > > that point. >> > > But I might be wrong. >> > > >> > > Martin Grigorov >> > > Wicket Training and Consulting >> > > https://twitter.com/mtgrigorov >> > > >> > > On Thu, Sep 1, 2016 at 7:11 AM, Maxim Solodovnik < >> solomax...@gmail.com> >> > > wrote: >> > > >> > > > Hello, >> > > > >> > > > I wonder why we don't have WebSocketRequestHandler in onConnect >> message >> > > > handler. >> > > > I would like to perform markup update on client connect, and it >> seems >> > to >> > > be >> > > > impossible without copy/pasting onEvent method code >> > > > >> > > > -- >> > > > WBR >> > > > Maxim aka solomax >> > > > >> > > >> > >> > >> > >> > -- >> > WBR >> > Maxim aka solomax >> > >> > > > > -- > WBR > Maxim aka solomax > -- WBR Maxim aka solomax