IllegalArgumentException within WicketURLDecoder
Hi! From time to time we are getting an IllegalArgumentException within WicketURLDecoder (see below). We can't reproduce the error and it seems to not bother the users since we haven't had any reports about errors in the UI or so .. yet it keeps showing up in our logs. Could it be some problem with the CryptedUrlWebRequestCodingStrategy we are using? I already did some Google searches but have found nothing so far - I have no idea where to start debugging this problem.. Any ideas? Cheers, Patrick 2011-10-06 01:49:19,916 [http-8080-28] ERROR - RequestCycle - URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "�ˠ" java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "�ˠ" at org.apache.wicket.protocol.http.WicketURLDecoder.decode(WicketURLDecoder.java:179) at org.apache.wicket.protocol.http.WicketURLDecoder.decode(WicketURLDecoder.java:90) at org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy$DecodedUrlRequest.(CryptedUrlWebRequestCodingStrategy.java:443) at org.apache.wicket.protocol.http.request.CryptedUrlWebRequestCodingStrategy.decode(CryptedUrlWebRequestCodingStrategy.java:124) at org.apache.wicket.Request.getRequestParameters(Request.java:183) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Session values not stored using chrome
Hi! Our wicket application has the following scenario: -) save myValue in the session -) redirect the user to an external page (using getRequestCycle().setRequestTarget()) -) the external pages redirects back to our webapp after the user entered some data -) read myValue from the session and do something based on myValue It all works just fine in Firefox, but not in Chrome. Using Chrome myValue is null when the user returns to the our wicket page again. My first guess was that a new session must have been created or that myValue was never set. I debugged through the code and the session id is exactly the same ... myValue has also been set before the user got redirected. I don't quite get how Chrome and Firefox would behave differently when it comes to saving values into the wicket session. Or how leaving the webpage and returning to it 1 minute later would suddenly result in a different kind of session. Any hints? Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Provide the user with immediate feedback
Hey! In our wicket application we are using a lot of Ajax links/forms. Sometimes, those requests take a second or two. We now want to give the user some feedback, that his request is being processed (to avoid double clicking or the impression that the webapp is slow). What would be the best way to execute custom javascript methods BEFORE the request gets sent to the webapp? Those javascript methods would then show a progress bar, a message like "Your request is being processed.." etc. For example: The user clicks an AjaxLink to delete an entry from the table and before the request gets sent to the server, some javascript method adds a small progress bar at the top of the table. Once the ajax request is done, the progress bar disappears. Another example would be how Facebook handles sending private messages. As soon as I click the "send" button, the text area gets disabled / greyed out immediately and after the Ajax request has gone through, I get access again to the text area. Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
correct way to get css classes of component
Hi! I was trying to solve the problem of replacing a specific css class of a wicket component with another css class. Google pointed me to the following thread: http://apache-wicket.1842946.n4.nabble.com/How-to-add-and-remove-css-classes-the-right-way-td1868408.html The nice and simple solution was something like this: String oldCss = String.valueOf(this.getMarkupAttributes().get("class")); String newCss = oldCss.replaceFirst("old", "new"); new SimpleAttributeModifier("class", newCss); I've used it and it works just fine. Unfortunately - as I've just found out - the method getMarkupAttributes() has the following javadoc: "THIS IS WICKET INTERNAL ONLY. DO NOT USE IT." If I'm not supposed to use getMarkupAttributes(), what would be the correct way then to get the current css classes of a wicket component? Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket:message inside html title
Thank you! Works like a charm!! Am 2011-01-17 12:10, schrieb Matthias Gasser: Hello Patrick, I guess the following will do the Job: https://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket:message inside html title
Hi! We are using wicket:message for i18n of our html pages. It all works fine except for the html title. I have the following html: myTitle In the properties files I have page.title set to "German Title" and "English Title" for example. The output from wicket to the browser is: German Title The localization worked, but wicket leaves the "wicket:message" tag in the title which looks ugly and wrong. Am I doing something wrong? What's the correct way of i18n html titles? I could probably treat the page title as a simple label as shown in this blogpost: http://th1rty7.blogspot.com/2009/08/page-title-in-wicket.html But I would much rather do it with wicket:message since I don't have to touch any Java code this way. Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Preventing user input script-injection attacks
Am 2010-11-25 16:15, schrieb Ian Marshall: If a user has entered some HTML in a TextField or TextArea when I do not want HTML to be entered, what is a good way to prevent this? In our project we are using OWASP Antisamy to prevent XSS attacks. It is easy to use, has a couple templates (slashdot, ebay,..) and works like a charm. http://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project http://code.google.com/p/owaspantisamy/ Regards, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Maven: Where to find the current binaries
Am 2010-11-16 11:29, schrieb Erich W Schreiner: where to can I point Maven to obtain the current stable binaries, i.e. 1.4.13 or 1.4.14? My maven installation only finds versions up to 1.4.9 Do you have your own maven repository or some kind of mirror running? Wicket 1.4.13 is available via all the public maven repositories, so unless you filter/proxy something via your pom.xml, internal repository or settings.xml, you should be able to get it. Have you tied the wicket quickstart for maven? http://wicket.apache.org/start/quickstart.html Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Edit whole ListItem via Ajax
Hey list! I have a ListView and each ListItem has multiple labels. I want to add an "edit" button at the end of each line so that the user can switch into an edit mode, edit every label and then save them all at once. So far, I've used AjaxEditableLabel for a single label and it works great. Is there something similar for a whole ListItem so that multiple labels can be changed into TextFields? If there are no existing components with this feature, what would be the best way to implement it myself? Thanks & Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
FeedbackPanel for each ListItem in ListView
Hey! I have ListView and every ListItem has multiple AjaxEditableLabels and one FeedbackPanel added to it. Each FeedbackPanel should only show messages that were reported within the same listitem. I tried the following but it didn't work: protected void populateItem(final ListItem item) { [...] item.add(new FeedbackPanel("someId", new ContainerFeedbackMessageFilter(item))); } Somehow when the AjaxEditablelabel submits, the list items get created from scratch, which screws up object references and therefore container.contains(message.getReporter(), true) of the ContainerFeedbackMessageFilter never returns true. Am I doing something wrong here? What would be the proper way to check if a feedback message was created within a listitem? Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: autocomplete for AjaxEditableLabel
Is there a way to enable autocomplete for AjaxEditableLabel (just like AutoCompleteTextField)? I was going through AutoCompleteTextField as a reference and wrote my own behavior for autocompletion. The new behavior works perfectly for a TextField, but not for AjaxEditableLabel. Answering my own question (in case someone is looking for the same functionality through a google search). AjaxEditableLabel is a panel with a label and textfield component which is why adding the autocomplete behavior to it didn't work. I solved it by overriding the newEditor() method and adding my behavior to the editor in the AjaxEditableLabel panel like so: AjaxEditableLabel label = new AjaxEditableLabel("foo") { @Override protected FormComponent newEditor(final MarkupContainer parent, final String componentId, final IModel model) { final FormComponent form = super.newEditor(parent, componentId, model); form.add(new MyAutoCompleteBehavior()); return form; } }; Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
autocomplete for AjaxEditableLabel
Hi! Is there a way to enable autocomplete for AjaxEditableLabel (just like AutoCompleteTextField)? I was going through AutoCompleteTextField as a reference and wrote my own behavior for autocompletion. The new behavior works perfectly for a TextField, but not for AjaxEditableLabel. Any help? What would be the correct way to do it? Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Best practice for component interaction
Igor Vaynberg schrieb: onclick(final AjaxRequestTarget target) { getPage().visitChildren(CaresAboutMyAjaxEvent.class, new IVisitor () { Object visit(CaresAboutMyAjaxEent object) { object.onMyAjaxEvent(target); }}} Interesting. A colleague also found the following blogpost: http://techblog.molindo.at/2008/09/wicket-loose-coupling-of-componens-for-ajax-updates.html Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Best practice for component interaction
Hi! Let's say I have a page with 2 panels. CalendarPanel shows a simple calendar, FormPanel a basic form. Whenever the user clicks on a date in the calendar, the textfield of the form should show the selected date. What is the best practice for this kind of interaction? Right now we hold a reference to the FormPanel in CalendarPanel and attach our custom CalendarAjaxBehavior to it. Whenever the CalendarAjaxBehavior gets a request / click, it updates the FormPanel's model directly. I don't really know if this is some ugly hack or if there is a better way of different panels to update / communicate with each other - other than holding references to one another... Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AutoCompleteTextField
Matthias Keller schrieb: Use: AutoCompleteSettings settings = new AutoCompleteSettings(); settings.setShowListOnEmptyInput(true); settings.setShowListOnFocusGain(true); // and possibly other settings as needed And then specify those settings in the constructor.. Thanks! Works like a charm. I didn't even think about using AutoCompleteSettings... Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AutoCompleteTextField
armandoxxx schrieb: You need to be able to select multiple items from autocomplete dropdown list with just DOWN key ??? No, I want to select a single item - but out of a list of all the items. Take the example at: www.wicket-library.com/wicket-examples/ajax/autocomplete The user starts typing "a" and the AutoCompleteTextField suggests the values Algeria, Austria, Australia, etc. In my usecase, the user wants to press the down key and be presented with a list of all the countries so that he can navigate through them with the up & down keys. Let's say a user has 100 possible choices .. then it makes sense to type in the first few letters until he is down to probably 5 choices or so. But another user may have only 3 possible choices. For him it would be better to just use the down key right away and select the value he wants instead of having him type a letter first.. Cheers, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AutoCompleteTextField
Hi! Is it possible to get the AutoCompleteTextField to return a list of all available choices when the user presses the downward key? I tried to return an iterator for the full list when the input of getChoices(String input) is empty, but this only works when the user presses the space key. When the user presses the downward key, nothing happpens. Thanks, Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: General question - business logic with Wicket, where to put it?
Brown, Berlin [GCG-PFS] schrieb: What is the best practice for where to put business logic in Wicket. I don't know if it is the best practice, but here is how we use it: We have several projects / modules like myApp-dao myApp-service myApp-wicket-ui Our wicket app then depends on those projects, starts one big application context (Spring) with all the beans and just calls the needed methods on them. The Login page in wicket for example has a service bean that is responsible for authenticating the user. All we do in the form's onSubmit method is to call the authentication logic through its own bean and never care about the actual business logic behind it. In a small project you don't have to split everything into multiple modules / projects, but you should at least move the logic out of the onSubmit etc. methods and just call methods on a seperate service class. Patrick - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org