Re: RangeValidator and BigDecimal
Sven, Thanks I hit send by mistake. It became clear that it was a BigDecimal instantiation issue and nothing to do with the RangeValidator. Thanks all. On Wed, Dec 20, 2023 at 9:25 AM Sven Meier wrote: > Hi Eric, > > you can read in the javadoc, why your first solution is 'unpredictable': > > > https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/math/BigDecimal.html#%3Cinit%3E(double) > > Sven > > On 20.12.23 15:18, Eric Hamel wrote: > > Hi Bas, > > > > Thanks for the response. > > > > I discovered the NumberTextField had its own RangeValidator 2 seconds > after posting. With that said, I’m getting the same issue when using it. > > > > To be clear, I’m not getting any Exceptions, everything seems to work > fine, but the form validation fails if the user types in 0.01. > > > > > > Form form = new Form<>(“form”, getModel()); > > add(form); > > > > NumberTextField testField = new > NumberTextField(“testField”, new > PropertyModel(form.getModel(), “testProp”)); > > form.add(testField); > > > > > > I’ve been digging and I found the oddity: > > > > If I set the min value as follows: > > > > testField.setMinimum(new BigDecimal(0.00)); > > > > When the user enters 0.01, the following feedback message is showed: > > > > The value of ’testField’ must be between 0.01 and 999,999.99. > > > > However, if I set the min value with: > > > > testField.setMinimum(BigDecimal.valueOf(0.00)); > > > > The user can enter 0.01 and NO feedback message is showed. > > > > > > > > - > > Eric H. > > > > > > > > > > > >> On Dec 20, 2023, at 8:48 AM, Bas Gooren wrote: > >> > >> Hi Eric, > >> > >> First off: according to the source of NumberTextField, it automatically > adds a RangeValidator (see NumberTextField#onConfigure). So you shouldn’t > need to add the RangeValidator yourself. > >> > >> Regarding your problem: what kind of error messages are you getting? > >> > >> The range validator (or more specifically: the AbstractRangeValidator > class) handles the comparison between min, max and actual values using > compareTo. So there should not be any issues with rounding. > >> > >> Please share the code you use to initialize the relevant field, perhaps > we can spot a mistake. > >> > >> Met vriendelijke groet, > >> Kind regards, > >> > >> Bas Gooren > >> > >> Op 20 december 2023 bij 14:38:53, Eric Hamel (eric.ha...@albanyitg.com > <mailto:eric.ha...@albanyitg.com>) schreef: > >> > >>> Good morning, > >>> > >>> We encountered an issue this morning with our use of > RangeValidator. > >>> > >>> The customer requested a validation for amounts between 0.01 and > 999,999.00. > >>> > >>> We have a NumberTextField to which we added the > RangeValidator. If the user enters 0.01 the validation fails. > >>> > >>> If I set the min value to 0.009 I can get it to work but the error > messages are off. > >>> > >>> I’m wondering if it’s a rounding or scale issue but I cannot figure > out how to make the RangeValidator work. > >>> > >>> Anyone have any insight on this ? > >>> > >>> Thank you. > >>> Eric H. > >>> > >>> > >>> - > >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org users-unsubscr...@wicket.apache.org> > >>> For additional commands, e-mail: users-h...@wicket.apache.org users-h...@wicket.apache.org> > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: RangeValidator and BigDecimal
Hi Bas, Thanks for the response. I discovered the NumberTextField had its own RangeValidator 2 seconds after posting. With that said, I’m getting the same issue when using it. To be clear, I’m not getting any Exceptions, everything seems to work fine, but the form validation fails if the user types in 0.01. Form form = new Form<>(“form”, getModel()); add(form); NumberTextField testField = new NumberTextField(“testField”, new PropertyModel(form.getModel(), “testProp”)); form.add(testField); I’ve been digging and I found the oddity: If I set the min value as follows: testField.setMinimum(new BigDecimal(0.00)); When the user enters 0.01, the following feedback message is showed: The value of ’testField’ must be between 0.01 and 999,999.99. However, if I set the min value with: testField.setMinimum(BigDecimal.valueOf(0.00)); The user can enter 0.01 and NO feedback message is showed. - Eric H. > On Dec 20, 2023, at 8:48 AM, Bas Gooren wrote: > > Hi Eric, > > First off: according to the source of NumberTextField, it automatically adds > a RangeValidator (see NumberTextField#onConfigure). So you shouldn’t need to > add the RangeValidator yourself. > > Regarding your problem: what kind of error messages are you getting? > > The range validator (or more specifically: the AbstractRangeValidator class) > handles the comparison between min, max and actual values using compareTo. So > there should not be any issues with rounding. > > Please share the code you use to initialize the relevant field, perhaps we > can spot a mistake. > > Met vriendelijke groet, > Kind regards, > > Bas Gooren > > Op 20 december 2023 bij 14:38:53, Eric Hamel (eric.ha...@albanyitg.com > <mailto:eric.ha...@albanyitg.com>) schreef: > >> Good morning, >> >> We encountered an issue this morning with our use of >> RangeValidator. >> >> The customer requested a validation for amounts between 0.01 and 999,999.00. >> >> We have a NumberTextField to which we added the RangeValidator. >> If the user enters 0.01 the validation fails. >> >> If I set the min value to 0.009 I can get it to work but the error messages >> are off. >> >> I’m wondering if it’s a rounding or scale issue but I cannot figure out how >> to make the RangeValidator work. >> >> Anyone have any insight on this ? >> >> Thank you. >> Eric H. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> <mailto:users-unsubscr...@wicket.apache.org> >> For additional commands, e-mail: users-h...@wicket.apache.org >> <mailto:users-h...@wicket.apache.org>
RangeValidator and BigDecimal
Good morning, We encountered an issue this morning with our use of RangeValidator. The customer requested a validation for amounts between 0.01 and 999,999.00. We have a NumberTextField to which we added the RangeValidator. If the user enters 0.01 the validation fails. If I set the min value to 0.009 I can get it to work but the error messages are off. I’m wondering if it’s a rounding or scale issue but I cannot figure out how to make the RangeValidator work. Anyone have any insight on this ? Thank you. Eric H. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FormComponent and FormComponentPanel ClassCast Issue
Good evening, Does anyone have any insight on this ? ———- Eric Hamel Senior Project Manager Albany ITG 528-697-4503 > On Jan 23, 2023, at 10:31 AM, Eric Hamel wrote: > > The hierarchy is DocumentSearchPanel extends BootstrapGenericPanel -> > BodyPanel extends GenericPanel -> BootstrapForm -> FormGroup -> > ClassificationPanel. > > > ClassificationPanel is an anonymous class of DocumentSearchPanel. > >> On Jan 23, 2023, at 10:19 AM, Martin Grigorov wrote: >> >> Hi, >> >>> On Mon, Jan 23, 2023 at 5:09 PM Eric Hamel wrote: >>> >>> Good morning, >>> >>> We are running into intermittent issues on our WebSphere 8.5 environment. >>> The server keeps crashing and we see no cause in our logs. With that said, >>> admins have seen the following error in our logs and I can’t make sense out >>> of it. >>> >>> 07:48:51.632 ERROR [CVIENS | 10.79.49.41 | 5uRaDK6Hu4gj0ABIXyNTo76] >>> o.a.wicket.DefaultExceptionMapper [DefaultExceptionMapper.java:170] - >>> Unexpected error occurred >>> java.lang.ClassCastException: >>> gov.osc.ouf.web.components.document.search.DocumentSearchPanel$ClassificationsPanel$1 >>> incompatible with org.apache.wicket.markup.html.form.FormComponent >>> at >>> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.findFormComponents(FormGroup.java:255) >>> ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] >>> at >>> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.onInitialize(FormGroup.java:175) >>> ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] >>> at >>> org.apache.wicket.Component.fireInitialize(Component.java:877) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:967) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:963) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:875) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:962) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at org.apache.wicket.Page.isPageStateless(Page.java:463) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.getPageInfo(AbstractBookmarkableMapper.java:465) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:409) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.core.request.mapper.MountedMapper.mapHandler(MountedMapper.java:395) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:215) >>> ~[wicket-request-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:429) >>> [wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:281) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175) >>> ~[wick
Re: FormComponent and FormComponentPanel ClassCast Issue
If it helps here is the full ClassificationPanel class: - class ClassificationsPanel extends FormComponentPanel { private static final long serialVersionUID = 1L; private static final String TOGGLE_CLASS = "list-group-item-warning"; public ClassificationsPanel(String id, IModel model, BootstrapFormform) { // super(id, model, Model.of("Classifications"), PanelType.Info); super(id, model); final CheckGroup documentCategoryCodes = new CheckGroup("documentCategoryCodes", new PropertyModel>(getModel(), "documentCategories")); add(documentCategoryCodes); ListView documentCategoryCode = new ListView("documentCategoryCode", IRISAuthenticatedWebSession.get().getDocumentCategoryforProcessingArea(getModelObject().getProcessingArea())) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem item) { item.setOutputMarkupId(true); Check check = new Check("check", item.getModel()); check.setMarkupId("check" + item.getMarkupId()); check.setOutputMarkupId(true); check.setLabel(Model.of(item.getModelObject().getDocumentCategoryDescription())); item.add(check); item.add(new Label("label", item.getModelObject().getDocumentCategoryDescription())); if(documentCategoryCodes.getModelObject().contains(item.getModelObject())){ item.add(new CssClassNameAppender(TOGGLE_CLASS)); } } }; // documentCategoryCode.setReuseItems(true); documentCategoryCodes.add(documentCategoryCode); } @Override protected void convertInput() { setConvertedInput(getModelObject()); } @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); String javascript ="$(function(){$(\"input[type=checkbox]\").on(\"change\", function() {var $chk = $(this),num = $chk.attr(\"id\").substring(7),$row = $(\"#id\" + num);$row.toggleClass(\"" + TOGGLE_CLASS+ "\");});});"; response.render(OnDomReadyHeaderItem.forScript(javascript)); } } > On Jan 23, 2023, at 10:31 AM, Eric Hamel wrote: > > The hierarchy is DocumentSearchPanel extends BootstrapGenericPanel -> > BodyPanel extends GenericPanel -> BootstrapForm -> FormGroup -> > ClassificationPanel. > > > ClassificationPanel is an anonymous class of DocumentSearchPanel. > >> On Jan 23, 2023, at 10:19 AM, Martin Grigorov wrote: >> >> Hi, >> >> On Mon, Jan 23, 2023 at 5:09 PM Eric Hamel wrote: >> >>> Good morning, >>> >>> We are running into intermittent issues on our WebSphere 8.5 environment. >>> The server keeps crashing and we see no cause in our logs. With that said, >>> admins have seen the following error in our logs and I can’t make sense out >>> of it. >>> >>> 07:48:51.632 ERROR [CVIENS | 10.79.49.41 | 5uRaDK6Hu4gj0ABIXyNTo76] >>> o.a.wicket.DefaultExceptionMapper [DefaultExceptionMapper.java:170] - >>> Unexpected error occurred >>> java.lang.ClassCastException: >>> gov.osc.ouf.web.components.document.search.DocumentSearchPanel$ClassificationsPanel$1 >>> incompatible with org.apache.wicket.markup.html.form.FormComponent >>> at >>> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.findFormComponents(FormGroup.java:255) >>> ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] >>> at >>> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.onInitialize(FormGroup.java:175) >>> ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] >>> at >>> org.apache.wicket.Component.fireInitialize(Component.java:877) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:967) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:963) >>> ~[wicket-core-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >>> ~[wicket-util-6.24.0.jar:6.24.0] >>> at >>> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123) >>> ~[wicket-util-6.24.0.jar:6.24.0]
Re: FormComponent and FormComponentPanel ClassCast Issue
The hierarchy is DocumentSearchPanel extends BootstrapGenericPanel -> BodyPanel extends GenericPanel -> BootstrapForm -> FormGroup -> ClassificationPanel. ClassificationPanel is an anonymous class of DocumentSearchPanel. > On Jan 23, 2023, at 10:19 AM, Martin Grigorov wrote: > > Hi, > > On Mon, Jan 23, 2023 at 5:09 PM Eric Hamel wrote: > >> Good morning, >> >> We are running into intermittent issues on our WebSphere 8.5 environment. >> The server keeps crashing and we see no cause in our logs. With that said, >> admins have seen the following error in our logs and I can’t make sense out >> of it. >> >> 07:48:51.632 ERROR [CVIENS | 10.79.49.41 | 5uRaDK6Hu4gj0ABIXyNTo76] >> o.a.wicket.DefaultExceptionMapper [DefaultExceptionMapper.java:170] - >> Unexpected error occurred >> java.lang.ClassCastException: >> gov.osc.ouf.web.components.document.search.DocumentSearchPanel$ClassificationsPanel$1 >> incompatible with org.apache.wicket.markup.html.form.FormComponent >> at >> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.findFormComponents(FormGroup.java:255) >> ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] >> at >> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.onInitialize(FormGroup.java:175) >> ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] >> at >> org.apache.wicket.Component.fireInitialize(Component.java:877) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:967) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:963) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144) >> ~[wicket-util-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >> ~[wicket-util-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >> ~[wicket-util-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) >> ~[wicket-util-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123) >> ~[wicket-util-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192) >> ~[wicket-util-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:875) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:962) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at org.apache.wicket.Page.isPageStateless(Page.java:463) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.getPageInfo(AbstractBookmarkableMapper.java:465) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:409) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.core.request.mapper.MountedMapper.mapHandler(MountedMapper.java:395) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:215) >> ~[wicket-request-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:429) >> [wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:281) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890) >> ~[wicket-core-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) >> ~[wicket-request-6.24.0.jar:6.24.0] >> at >> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261) >> [wicket-core-6.24.0.jar:6.24.0] >> at >> org.apa
FormComponent and FormComponentPanel ClassCast Issue
Good morning, We are running into intermittent issues on our WebSphere 8.5 environment. The server keeps crashing and we see no cause in our logs. With that said, admins have seen the following error in our logs and I can’t make sense out of it. 07:48:51.632 ERROR [CVIENS | 10.79.49.41 | 5uRaDK6Hu4gj0ABIXyNTo76] o.a.wicket.DefaultExceptionMapper [DefaultExceptionMapper.java:170] - Unexpected error occurred java.lang.ClassCastException: gov.osc.ouf.web.components.document.search.DocumentSearchPanel$ClassificationsPanel$1 incompatible with org.apache.wicket.markup.html.form.FormComponent at de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.findFormComponents(FormGroup.java:255) ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] at de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup.onInitialize(FormGroup.java:175) ~[wicket-bootstrap-core-0.9.22.jar:0.9.22] at org.apache.wicket.Component.fireInitialize(Component.java:877) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:967) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.MarkupContainer$3.component(MarkupContainer.java:963) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:144) ~[wicket-util-6.24.0.jar:6.24.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) ~[wicket-util-6.24.0.jar:6.24.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) ~[wicket-util-6.24.0.jar:6.24.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:162) ~[wicket-util-6.24.0.jar:6.24.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:123) ~[wicket-util-6.24.0.jar:6.24.0] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:192) ~[wicket-util-6.24.0.jar:6.24.0] at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:875) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:962) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.Page.isPageStateless(Page.java:463) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.getPageInfo(AbstractBookmarkableMapper.java:465) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:409) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.core.request.mapper.MountedMapper.mapHandler(MountedMapper.java:395) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:215) ~[wicket-request-6.24.0.jar:6.24.0] at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:429) [wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:281) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890) ~[wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) ~[wicket-request-6.24.0.jar:6.24.0] at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261) [wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218) [wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289) [wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259) [wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201) [wicket-core-6.24.0.jar:6.24.0] at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) [wicket-core-6.24.0.jar:6.24.0] at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na] at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967) [com.ibm.ws.webcontainer.jar:na] at
Re: FileNotFoundException
Martin, ViewerControls is a serializable class (pojo). I see it’s being referenced in a PackageResourceReference inside a behavior for loading different css files based on properties inside ViewerControls. If this is the culprit, I’m not sure how I would go about to solving this. — Eric Hamel Senior Project Manager Albany Information Technology Group C. 518-698-4503 > On May 18, 2021, at 9:38 AM, Martin Grigorov wrote: > > Hi, > > See inline! > >> On Tue, May 18, 2021 at 4:02 PM Eric Hamel wrote: >> >> Good morning, >> >> For the last month I’ve been struggling to find the root cause of the >> following exception. It is polluting our logs and I’m just not >> understanding what’s happening here. >> >> We’re on Wicket 6.24.0 >> >> Any help would be appreciated. >> >> Thank you >> >> E com.ibm.ws.webcontainer.filter.FilterInstanceWrapper doFilter SRVE8109W: >> Uncaught exception thrown by filter wicket: java.io.FileNotFoundException: >> SRVE0190E: File not found: >> /wicket/resource/gov.osc.ouf.web.components.viewer.controls.ViewerControls >> >> at >> >> com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor._processEDR(DefaultExtensionProcessor.java:976) >> >> at >> >> com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.processEDR(DefaultExtensionProcessor.java:957) >> >> at >> >> com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:485) >> >> at >> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) >> >> at >> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97) >> >> at >> >> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:267) >> > > https://github.com/apache/wicket/blob/rel/wicket-6.24.0/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java#L267 > - here we see that Wicket didn't process the request and let the next > Servlet Filter to do it, namely > com.ibm.ws.webcontainer.filter.WebAppFilterChain > Later it fails with "File not found". > > The question is why Wicket didn't handle the request to /wicket/resource/... > Wicket produces such urls for ResourceReferences like JavaScript and CSS, > but "gov.osc.ouf.web.components.viewer.controls.ViewerControls" has no > extension ... > You need to find out where this resource reference is contributed to the > page and why its url looks incomplete. > > >> >> at >> >> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201) > > >> at >> >> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) >> >> at >> >> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) >> >> at >> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) >> >> at >> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967) >> >> at >> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107) >> >> at >> com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3980) >> >> at >> com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) >> >> at >> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1016) >> >> at >> >> com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) >> >> at >> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200) >> >> at >> >> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463) >> >> at >> >> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530) >> >> at >> >> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316) >> >> at >> >> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpIC
FileNotFoundException
Good morning, For the last month I’ve been struggling to find the root cause of the following exception. It is polluting our logs and I’m just not understanding what’s happening here. We’re on Wicket 6.24.0 Any help would be appreciated. Thank you E com.ibm.ws.webcontainer.filter.FilterInstanceWrapper doFilter SRVE8109W: Uncaught exception thrown by filter wicket: java.io.FileNotFoundException: SRVE0190E: File not found: /wicket/resource/gov.osc.ouf.web.components.viewer.controls.ViewerControls at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor._processEDR(DefaultExtensionProcessor.java:976) at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.processEDR(DefaultExtensionProcessor.java:957) at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:485) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97) at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:267) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:967) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1107) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3980) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1016) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Re: Apache Wicket - Enforcing POST on Ajax calls
Looking at our implementation, we are using an AjaxFormComponentUpdatingBehavior to trigger our data save. Even though we do a have parent form the onSubmit is never called. Is there an alternative to the onMethodMismatch ? — Eric Hamel Senior Project Manager Albany Information Technology Group C. 518-698-4503 > On Oct 16, 2020, at 4:32 PM, Martin Grigorov wrote: > > On Fri, Oct 16, 2020, 23:27 Eric Hamel wrote: > >> I apologize in advance for my vague question. Our Wicket 8 based >> application was submitted to pen testing from our EISO. While I understand >> the finding, I'm not 100% sure I understand the problem nor do I know how >> to address it. >> >> In one of our complex forms that uses Ajax Calls to automatically update >> the DB when the fields lose focus, the tester made the following remark: >> >> Applications accepts GET requests for coded POST Ajax calls – parameters >> can be passed in URL >> >> It appears that through his "fuzzer", even though our requests are marked >> as POST, it still processes GET requests. Is there a way to enforce POST ? >> Is there any way to mitigate this issue globally from a configuration >> standpoint ? >> > > > See Form#onMethodMismatch() > >> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Apache Wicket - Enforcing POST on Ajax calls
Thanks I’ll try that ! — Eric Hamel Senior Project Manager Albany Information Technology Group C. 518-698-4503 > On Oct 16, 2020, at 4:32 PM, Martin Grigorov wrote: > > On Fri, Oct 16, 2020, 23:27 Eric Hamel wrote: > >> I apologize in advance for my vague question. Our Wicket 8 based >> application was submitted to pen testing from our EISO. While I understand >> the finding, I'm not 100% sure I understand the problem nor do I know how >> to address it. >> >> In one of our complex forms that uses Ajax Calls to automatically update >> the DB when the fields lose focus, the tester made the following remark: >> >> Applications accepts GET requests for coded POST Ajax calls – parameters >> can be passed in URL >> >> It appears that through his "fuzzer", even though our requests are marked >> as POST, it still processes GET requests. Is there a way to enforce POST ? >> Is there any way to mitigate this issue globally from a configuration >> standpoint ? >> > > > See Form#onMethodMismatch() > >> - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Apache Wicket - Enforcing POST on Ajax calls
I apologize in advance for my vague question. Our Wicket 8 based application was submitted to pen testing from our EISO. While I understand the finding, I'm not 100% sure I understand the problem nor do I know how to address it. In one of our complex forms that uses Ajax Calls to automatically update the DB when the fields lose focus, the tester made the following remark: Applications accepts GET requests for coded POST Ajax calls – parameters can be passed in URL It appears that through his "fuzzer", even though our requests are marked as POST, it still processes GET requests. Is there a way to enforce POST ? Is there any way to mitigate this issue globally from a configuration standpoint ?
Re: Wicket webshere 7
We also had similar problems on WAS 6.1 and we also used Wicket Servlet to mitigate our issues. We've been preparing for an upgrade of our servers, mostly comparing WebSphere 7 and WebSphere 8. V7 seems to behave the same as V6.1 whereas V8 seems to handle the Wicket Filter much better. On Mon, Jan 23, 2012 at 1:49 PM, Andrew Geery andrew.ge...@gmail.comwrote: I've had a very similar problem with WAS 6.1 (basic functionality would work but AJAX functionality did not). The solution was simply to use the Wicket servlet instead of the filter -- see https://cwiki.apache.org/WICKET/websphere.html. What made it hard to debug was the fact that the Wicket filter implementation did work for aspects on WAS, but it didn't work for AJAX calls. HTH Andrew On Mon, Jan 23, 2012 at 12:23 PM, matteus matteu...@hotmail.com wrote: Yes, my application is running with the filter Wicket Filter. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-websphere-7-tp4310810p4321364.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Sent by Eric Hamel
Re: Wicket webshere 7
Am I right to assume you're running with Wicket Filter ? On Thu, Jan 19, 2012 at 12:51 PM, matteus matteu...@hotmail.com wrote: Hi, I have a big problem with websphere and wicket because of several ajax behavior that does not work when it is configured in webphere. Someone has gone through some configuration problem with websphere wicket that could help me? Being that we've set the property called com.ibm.ws.webcontainer.invokefilterscompatibility and dont work. thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-webshere-7-tp4310810p4310810.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Sent by Eric Hamel
Re: Adding openid-authentication to spring/wicket-auth-roles?
This might help... http://www.ibm.com/developerworks/java/library/j-openid/index.html On Wed, Dec 29, 2010 at 5:04 AM, Tom Howe tomh...@artcore.com wrote: I have followed the instructions at https://cwiki.apache.org/WICKET/spring-security-and-wicket-auth-roles.htmlto integrate basic user/pass authentication using Spring security into my wicket app. How would I go about adding open-id authentication? Spring security supports openid-login as a config option but adding this has no effect. I think this is because the example integration with wicket-auth-roles on that page seems geared only towards user/password authentication. Are there any examples for adding openid login in a similar manner to stackoverflow to a wicket app, preferably using spring? Thanks, Tom -- Sent by Eric Hamel
Re: set focus in Modal Window
Thanks for posting this. I'm having a similar issue. I updated my behavior with your changes, but still doesn't seem to work on the component in the modal window. I have a Panel with the FormComponents that is being used on a page and on a modal window. The Focus Behavior works on the Page, but not the modal window. Eric On Fri, Oct 29, 2010 at 2:17 PM, Stefan Lindner lind...@visionet.de wrote: Try this: public class FocusBehavior extends AbstractBehavior { private static final long serialVersionUID = 1L; private Component component; @Override public void bind(final Component component) { this.component = component; component.setOutputMarkupId(true); } @Override public void renderHead(final IHeaderResponse response) { response.renderOnDomReadyJavascript(document.getElementById(' + component.getMarkupId() + ').focus();); } } And do TextField bla = new Textfield(); Bla.add(new FocusBeahvior()); Stefan -Ursprüngliche Nachricht- Von: Henry, Mike [GCG-PFS] [mailto:mike.he...@primerica.com] Gesendet: Freitag, 29. Oktober 2010 19:58 An: users@wicket.apache.org Betreff: set focus in Modal Window I have successfully set the focus on a text field in a Modal window but after it is closed and re-opened it no longer sets the focus to that field. If I reload the whole parent page it will work once but again If the modal window is closed and re-opened same problem. I have tried all of these with the same result: target.appendJavascript(document.findRepform.searchString.focus();); target.focusComponent(((FindRepDetailsPanel)selectModalWindow.get(conte nt)).get(findRepform:searchString)); ((FindRepDetailsPanel)selectModalWindow.get(content)).get(findRepform :searchString).add(new DefaultFocusBehavior()) Any ideas? Thanks Mike - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Sent by Eric Hamel
Re: CSS Templating
Agreed. This is what I ended up doing. Thanks for the ideas all. On Mon, May 10, 2010 at 3:28 PM, Jeremy Thomerson jer...@wickettraining.com wrote: Instead of doing this, use cascading stylesheets like they were intended to be used: In both applications, have a global.css or similar that handles all of the layout, etc, that is common to both sites. Then, in each application, include a appXYZ.css that simply changes colors, background images, etc, that you would presumably be doing on a per-site basis. -- Jeremy Thomerson http://www.wickettraining.com On Mon, May 10, 2010 at 7:17 AM, Eric Hamel dantehick...@gmail.com wrote: Good Point. In all honesty, I'm looking for a practical way to skin 2 applications which are identical layout wise. Inherently, I don't want to manage 2 different stylesheets as that will lead to maintenance hell. The idea was to build a Template implemented in both applications to which I would override/pass to the template colors/background-colors/background-image. Might not be the best approach... On Sat, May 8, 2010 at 3:42 AM, Chris Colman chr...@stepaheadsoftware.comwrote: That method of css generation you propose would be generating CSS (even if it were into a separate .css file) with each page render. If you're dealing with a lot of CSS that probably isn't the most efficient method. Generating CSS at render time would mean the browser could not take advantage of CSS caching - which would be bad in these days of quite large CSS files. You might be better off considering a separate CSS generator that doesn't generate CSS at 'page render time'. -Original Message- From: Eric Hamel [mailto:dantehick...@gmail.com] Sent: Saturday, 8 May 2010 5:52 AM To: users@wicket.apache.org Subject: CSS Templating All, I've been exploring the use of TextTemplateHeaderContributor.forCss method to build a CSS template for multiple application. Take for example: IModelMapString, Object model = new AbstractReadOnlyModelMapString,Object(){ private static final long serialVersionUID = 1L; @Override public MapString, Object getObject() { HashMapString,Object map = new HashMapString, Object(); map.put(body-bgcolor, red); return map; } }; add(TextTemplateHeaderContributor.forCss(WelcomePage.class, Template.css, model)); with CSS template: body{ background-color: ${body-bgcolor}; } The output works. However, the template is contributing to the header in the form of: style type=text/css!-- body{ background-color: red; }--/style which is unacceptable. Is there a way to generate a .css file to be used by the application ? Thank you -- Sent by Eric Hamel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Sent by Eric Hamel -- Sent by Eric Hamel
Re: CSS Templating
Good Point. In all honesty, I'm looking for a practical way to skin 2 applications which are identical layout wise. Inherently, I don't want to manage 2 different stylesheets as that will lead to maintenance hell. The idea was to build a Template implemented in both applications to which I would override/pass to the template colors/background-colors/background-image. Might not be the best approach... On Sat, May 8, 2010 at 3:42 AM, Chris Colman chr...@stepaheadsoftware.comwrote: That method of css generation you propose would be generating CSS (even if it were into a separate .css file) with each page render. If you're dealing with a lot of CSS that probably isn't the most efficient method. Generating CSS at render time would mean the browser could not take advantage of CSS caching - which would be bad in these days of quite large CSS files. You might be better off considering a separate CSS generator that doesn't generate CSS at 'page render time'. -Original Message- From: Eric Hamel [mailto:dantehick...@gmail.com] Sent: Saturday, 8 May 2010 5:52 AM To: users@wicket.apache.org Subject: CSS Templating All, I've been exploring the use of TextTemplateHeaderContributor.forCss method to build a CSS template for multiple application. Take for example: IModelMapString, Object model = new AbstractReadOnlyModelMapString,Object(){ private static final long serialVersionUID = 1L; @Override public MapString, Object getObject() { HashMapString,Object map = new HashMapString, Object(); map.put(body-bgcolor, red); return map; } }; add(TextTemplateHeaderContributor.forCss(WelcomePage.class, Template.css, model)); with CSS template: body{ background-color: ${body-bgcolor}; } The output works. However, the template is contributing to the header in the form of: style type=text/css!-- body{ background-color: red; }--/style which is unacceptable. Is there a way to generate a .css file to be used by the application ? Thank you -- Sent by Eric Hamel - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Sent by Eric Hamel
CSS Templating
All, I've been exploring the use of TextTemplateHeaderContributor.forCss method to build a CSS template for multiple application. Take for example: IModelMapString, Object model = new AbstractReadOnlyModelMapString,Object(){ private static final long serialVersionUID = 1L; @Override public MapString, Object getObject() { HashMapString,Object map = new HashMapString, Object(); map.put(body-bgcolor, red); return map; } }; add(TextTemplateHeaderContributor.forCss(WelcomePage.class, Template.css, model)); with CSS template: body{ background-color: ${body-bgcolor}; } The output works. However, the template is contributing to the header in the form of: style type=text/css!-- body{ background-color: red; }--/style which is unacceptable. Is there a way to generate a .css file to be used by the application ? Thank you -- Sent by Eric Hamel