[jira] Updated: (WICKET-1929) PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink
[ https://issues.apache.org/jira/browse/WICKET-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan Dearing updated WICKET-1929: - Description: Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. This was discussed back in Jan 08 ( http://markmail.org/message/dfgnis2rc7ysjlhj ), but I could not find a JIRA issue for it. For now using Behaviors may work and avoids duplicating a lot of the code. was: Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. This was discussed back in Jan 08 (http://markmail.org/message/dfgnis2rc7ysjlhj), but I could not find a JIRA issue for it. For now using Behaviors may work and avoids duplicating a lot of the code. PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink - Key: WICKET-1929 URL: https://issues.apache.org/jira/browse/WICKET-1929 Project: Wicket Issue Type: Improvement Affects Versions: 1.3.0-final, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4-M1, 1.4-M2, 1.4-M3 Reporter: Ryan Dearing Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. This was discussed back in Jan 08 ( http://markmail.org/message/dfgnis2rc7ysjlhj ), but I could not find a JIRA issue for it. For now using Behaviors may work and avoids duplicating a lot of the code. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r713094 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging: PagingNavigation.java PagingNavigator.java
Author: ivaynberg Date: Tue Nov 11 09:58:15 2008 New Revision: 713094 URL: http://svn.apache.org/viewvc?rev=713094view=rev Log: WICKET-1929 Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java?rev=713094r1=713093r2=713094view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigation.java Tue Nov 11 09:58:15 2008 @@ -17,7 +17,7 @@ package org.apache.wicket.markup.html.navigation.paging; import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.link.AbstractLink; import org.apache.wicket.markup.html.list.Loop; import org.apache.wicket.model.Model; import org.apache.wicket.version.undo.Change; @@ -309,7 +309,7 @@ final int pageIndex = getStartIndex() + loopItem.getIteration(); // Add a page link pointing to the page - final Link? link = newPagingNavigationLink(pageLink, pageable, pageIndex); + final AbstractLink link = newPagingNavigationLink(pageLink, pageable, pageIndex); loopItem.add(link); // Add a page number label to the list which is enclosed by the link @@ -336,7 +336,7 @@ *the page index the link points to * @return the page navigation link. */ - protected Link? newPagingNavigationLink(String id, IPageable pageable, int pageIndex) + protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageIndex) { return new PagingNavigationLinkVoid(id, pageable, pageIndex); } Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java?rev=713094r1=713093r2=713094view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/navigation/paging/PagingNavigator.java Tue Nov 11 09:58:15 2008 @@ -16,7 +16,7 @@ */ package org.apache.wicket.markup.html.navigation.paging; -import org.apache.wicket.markup.html.link.Link; +import org.apache.wicket.markup.html.link.AbstractLink; import org.apache.wicket.markup.html.panel.Panel; /** @@ -110,7 +110,8 @@ *the increment * @return the increment link */ - protected Link? newPagingNavigationIncrementLink(String id, IPageable pageable, int increment) + protected AbstractLink newPagingNavigationIncrementLink(String id, IPageable pageable, + int increment) { return new PagingNavigationIncrementLinkVoid(id, pageable, increment); } @@ -127,7 +128,7 @@ *the page to jump to * @return the pagenumber link */ - protected Link? newPagingNavigationLink(String id, IPageable pageable, int pageNumber) + protected AbstractLink newPagingNavigationLink(String id, IPageable pageable, int pageNumber) { return new PagingNavigationLinkVoid(id, pageable, pageNumber); }
[jira] Resolved: (WICKET-1929) PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink
[ https://issues.apache.org/jira/browse/WICKET-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-1929. --- Resolution: Fixed Fix Version/s: 1.4-RC2 Assignee: Igor Vaynberg 1.4rc2 only due to api break PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink - Key: WICKET-1929 URL: https://issues.apache.org/jira/browse/WICKET-1929 Project: Wicket Issue Type: Improvement Affects Versions: 1.3.0-final, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4-M1, 1.4-M2, 1.4-M3 Reporter: Ryan Dearing Assignee: Igor Vaynberg Fix For: 1.4-RC2 Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. This was discussed back in Jan 08 ( http://markmail.org/message/dfgnis2rc7ysjlhj ), but I could not find a JIRA issue for it. For now using Behaviors may work and avoids duplicating a lot of the code. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r713098 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/IndexedParamUrlCodingStrategy.java
Author: ivaynberg Date: Tue Nov 11 10:20:18 2008 New Revision: 713098 URL: http://svn.apache.org/viewvc?rev=713098view=rev Log: WICKET-1794 Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/IndexedParamUrlCodingStrategy.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/IndexedParamUrlCodingStrategy.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/IndexedParamUrlCodingStrategy.java?rev=713098r1=713097r2=713098view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/IndexedParamUrlCodingStrategy.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/request/target/coding/IndexedParamUrlCodingStrategy.java Tue Nov 11 10:20:18 2008 @@ -64,17 +64,28 @@ *name of pagemap */ public IndexedParamUrlCodingStrategy(String mountPath, Class bookmarkablePageClass, - String pageMapName) + String pageMapName) { super(mountPath, bookmarkablePageClass, pageMapName); } + @Override protected void appendParameters(AppendingStringBuffer url, Map parameters) { int i = 0; while (parameters.containsKey(String.valueOf(i))) { - String value = (String)parameters.get(String.valueOf(i)); + String value = null; + Object parameter = parameters.get(String.valueOf(i)); + if (parameter instanceof String[] ((String[])parameter).length 0) + { + value = ((String[])parameter)[0]; + } + else + { + value = parameter.toString(); + } + if (!url.endsWith(/)) { url.append(/); @@ -92,8 +103,8 @@ { url.append(/); } - url.append(WebRequestCodingStrategy.PAGEMAP).append(/).append(urlEncodePathComponent(pageMap)) - .append(/); + url.append(WebRequestCodingStrategy.PAGEMAP).append(/).append( + urlEncodePathComponent(pageMap)).append(/); } String intface = (String)parameters.get(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME); @@ -105,16 +116,17 @@ url.append(/); } url.append(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME).append(/).append( - urlEncodePathComponent(intface)).append(/); + urlEncodePathComponent(intface)).append(/); } if (i != parameters.size()) { throw new WicketRuntimeException( - Not all parameters were encoded. Make sure all parameter names are integers in consecutive order starting with zero. Current parameter names are: + - parameters.keySet().toString()); + Not all parameters were encoded. Make sure all parameter names are integers in consecutive order starting with zero. Current parameter names are: + + parameters.keySet().toString()); } } + @Override protected ValueMap decodeParameters(String urlFragment, Map urlParameters) { PageParameters params = new PageParameters(); @@ -139,14 +151,15 @@ if (WebRequestCodingStrategy.PAGEMAP.equals(parts[i])) { i++; - params.put(WebRequestCodingStrategy.PAGEMAP, WebRequestCodingStrategy - .decodePageMapName(urlDecodePathComponent(parts[i]))); + params.put( + WebRequestCodingStrategy.PAGEMAP, + WebRequestCodingStrategy.decodePageMapName(urlDecodePathComponent(parts[i]))); } else if (WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME.equals(parts[i])) { i++; params.put(WebRequestCodingStrategy.INTERFACE_PARAMETER_NAME, -
[jira] Created: (WICKET-1930) FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters
FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters -- Key: WICKET-1930 URL: https://issues.apache.org/jira/browse/WICKET-1930 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.4-M3, 1.3.5 Environment: Windows Reporter: Bruno Borges Attachments: patch-Files.diff, patch-FileUpload.diff The component FileUpload tries to create a temporary file using the multipart fieldname's id. That id has invalid characters - not supported on Windows environments, for example. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1930) FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters
[ https://issues.apache.org/jira/browse/WICKET-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bruno Borges updated WICKET-1930: - Attachment: patch-Files.diff FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters -- Key: WICKET-1930 URL: https://issues.apache.org/jira/browse/WICKET-1930 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.5, 1.4-M3 Environment: Windows Reporter: Bruno Borges Attachments: patch-Files.diff, patch-FileUpload.diff The component FileUpload tries to create a temporary file using the multipart fieldname's id. That id has invalid characters - not supported on Windows environments, for example. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1930) FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters
[ https://issues.apache.org/jira/browse/WICKET-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bruno Borges updated WICKET-1930: - Attachment: patch-FileUpload.diff FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters -- Key: WICKET-1930 URL: https://issues.apache.org/jira/browse/WICKET-1930 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.5, 1.4-M3 Environment: Windows Reporter: Bruno Borges Attachments: patch-Files.diff, patch-FileUpload.diff The component FileUpload tries to create a temporary file using the multipart fieldname's id. That id has invalid characters - not supported on Windows environments, for example. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r713091 - /wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js
Author: ivaynberg Date: Tue Nov 11 09:39:02 2008 New Revision: 713091 URL: http://svn.apache.org/viewvc?rev=713091view=rev Log: WICKET-1504 Modified: wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js Modified: wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js?rev=713091r1=713090r2=713091view=diff == --- wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js (original) +++ wicket/trunk/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js Tue Nov 11 09:39:02 2008 @@ -288,8 +288,8 @@ var input=wicketGet(elementId); var index=getOffsetParentZIndex(elementId); container.show(); -container.style.zIndex=(!isNaN(Number(index))?Number(index)+1:index); -container.style.left=position[0]+'px' + container.style.zIndex=(Number(index)!=Number.NaN?Number(index)+1:index); +container.style.left=position[0]+'px'; container.style.top=(input.offsetHeight+position[1])+'px'; if(cfg.adjustInputWidth) container.style.width=input.offsetWidth+'px';
[jira] Created: (WICKET-1929) PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink
PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink - Key: WICKET-1929 URL: https://issues.apache.org/jira/browse/WICKET-1929 Project: Wicket Issue Type: Improvement Affects Versions: 1.3.5 Reporter: Ryan Dearing Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1927) WicketTester.assertErrorMessages uses wrong encoding
WicketTester.assertErrorMessages uses wrong encoding Key: WICKET-1927 URL: https://issues.apache.org/jira/browse/WICKET-1927 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.4-M3 Environment: Windows XP PL SP 2, Java 1.6.0_10 Reporter: Artur Wronski WicketTester.assertErrorMessages returns FeedbackMessages in iso-8859-1 encoding. Because of this all tests fail when they are using non standard ascii characters (like polish, german etc) in messages. Wicket should AFAIK use UTF-8 encoding or one that was specified by getApplication().getMarkupSettings().setDefaultMarkupEncoding(..). Example: WicketTester tester = new WicketTester(new MyApp()); tester.getApplication().getMarkupSettings().setDefaultMarkupEncoding(UTF-8); tester.getWicketSession().setLocale(new Locale(pl, PL)); tester.setupRequestAndResponse(); FormTester formTester = tester.newFormTester(someForm); [...] formTester.submit(process); tester.assertErrorMessages(new String[] { Pole 'domena' musi zawierać od 3 do 32 znaków. }; gives: junit.framework.AssertionFailedError: expect (1): Pole 'domena' musi zawierać od 3 do 32 znaków. but was (1): Pole 'domena' musi zawieraÄ od 3 do 32 znaków. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1926) UrlValidator doesn't working when using a hostname in the url
UrlValidator doesn't working when using a hostname in the url - Key: WICKET-1926 URL: https://issues.apache.org/jira/browse/WICKET-1926 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.5 Reporter: Yossi Shaul Tried a variety of urls (http://localhost, http://localhost:8080, etc.) and they all fail. And it worked in version 1.3.4 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-1504) AutoCompleteTextField - javascript error type mismatch in line 227 in IE
[ https://issues.apache.org/jira/browse/WICKET-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12646536#action_12646536 ] Will Hoover commented on WICKET-1504: - It was also brought up in the forum that there is a typo in AutoCompleteTextField.java Line 257 should be like this: tag.put(autocomplete, off); instead of this tag.put(autocomplete, false); AutoCompleteTextField - javascript error type mismatch in line 227 in IE -- Key: WICKET-1504 URL: https://issues.apache.org/jira/browse/WICKET-1504 Project: Wicket Issue Type: Bug Components: wicket-extensions Affects Versions: 1.3.3 Environment: IE 6.0 Reporter: Niels Bo Fix For: 1.4-RC2 I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript error type mismatch in line 227, wich is this line in wicket-autocomplete.js: menu.style.zIndex=index==auto?index:Number(index)+1; Only in IE (6.0) - firefox works fine. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1928) Enter key submits form in AjaxEditableMultiLineLabel on Safari
Enter key submits form in AjaxEditableMultiLineLabel on Safari -- Key: WICKET-1928 URL: https://issues.apache.org/jira/browse/WICKET-1928 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.4-M3 Environment: Mac OSX Reporter: Joakim Örtbrant Pressing the Enter key when editing a AjaxEditableMultiLineLabel submits the form on Safari instead of inserting a new line -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-1928) Enter key submits form in AjaxEditableMultiLineLabel on Safari
[ https://issues.apache.org/jira/browse/WICKET-1928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12646604#action_12646604 ] Joakim Örtbrant commented on WICKET-1928: - Replicating the Safari behaviour from AjaxEditableLabel solved this for me: replace tag.put(onkeypress, keypress); with tag.put(onkeypress, if (Wicket.Browser.isSafari()) { return; }; + keypress); tag.put(onkeydown, if (!Wicket.Browser.isSafari()) { return; }; + keypress); in the onComponentTag implementation when adding the EditorAjaxBehavior. Enter key submits form in AjaxEditableMultiLineLabel on Safari -- Key: WICKET-1928 URL: https://issues.apache.org/jira/browse/WICKET-1928 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.4-M3 Environment: Mac OSX Reporter: Joakim Örtbrant Pressing the Enter key when editing a AjaxEditableMultiLineLabel submits the form on Safari instead of inserting a new line -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WICKET-1504) AutoCompleteTextField - javascript error type mismatch in line 227 in IE
[ https://issues.apache.org/jira/browse/WICKET-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-1504. --- Resolution: Fixed Fix Version/s: 1.3.6 Assignee: Igor Vaynberg AutoCompleteTextField - javascript error type mismatch in line 227 in IE -- Key: WICKET-1504 URL: https://issues.apache.org/jira/browse/WICKET-1504 Project: Wicket Issue Type: Bug Components: wicket-extensions Affects Versions: 1.3.3 Environment: IE 6.0 Reporter: Niels Bo Assignee: Igor Vaynberg Fix For: 1.3.6, 1.4-RC2 I just swithed from 1.3.2 to 1.3.3 and that resultet in a javascript error type mismatch in line 227, wich is this line in wicket-autocomplete.js: menu.style.zIndex=index==auto?index:Number(index)+1; Only in IE (6.0) - firefox works fine. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (WICKET-1929) PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink
[ https://issues.apache.org/jira/browse/WICKET-1929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ryan Dearing updated WICKET-1929: - Description: Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. This was discussed back in Jan 08 (http://markmail.org/message/dfgnis2rc7ysjlhj), but I could not find a JIRA issue for it. For now using Behaviors may work and avoids duplicating a lot of the code. was:Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. Affects Version/s: 1.3.0-final 1.3.1 1.3.2 1.3.3 1.3.4 1.4-M1 1.4-M2 1.4-M3 PagingNavigator.newPagingNavigationIncrementLink and PagingNavigator.newPagingNavigationLink should return AbstractLink - Key: WICKET-1929 URL: https://issues.apache.org/jira/browse/WICKET-1929 Project: Wicket Issue Type: Improvement Affects Versions: 1.3.0-final, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4-M1, 1.4-M2, 1.4-M3 Reporter: Ryan Dearing Currently newPagingNavigationLink and newPagingNavigationIncrementLink in PagingNavigator return Link objects. It would be nice if they returned AbstractLink objects to allow more flexibility. This would make using SubmitLink and custom Link components with PagingNavigator much easier. This was discussed back in Jan 08 (http://markmail.org/message/dfgnis2rc7ysjlhj), but I could not find a JIRA issue for it. For now using Behaviors may work and avoids duplicating a lot of the code. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r713218 - in /wicket/trunk/wicket/src/main/java/org/apache/wicket: markup/html/form/upload/FileUpload.java util/file/Files.java
Author: ivaynberg Date: Tue Nov 11 15:09:58 2008 New Revision: 713218 URL: http://svn.apache.org/viewvc?rev=713218view=rev Log: WICKET-1930 Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java wicket/trunk/wicket/src/main/java/org/apache/wicket/util/file/Files.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java?rev=713218r1=713217r2=713218view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java Tue Nov 11 15:09:58 2008 @@ -186,7 +186,8 @@ */ public final File writeToTempFile() throws IOException { - File temp = File.createTempFile(Session.get().getId(), item.getFieldName()); + File temp = File.createTempFile(Session.get().getId(), + Files.cleanupFilename(item.getFieldName())); writeTo(temp); return temp; } Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/util/file/Files.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/util/file/Files.java?rev=713218r1=713217r2=713218view=diff == --- wicket/trunk/wicket/src/main/java/org/apache/wicket/util/file/Files.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/util/file/Files.java Tue Nov 11 15:09:58 2008 @@ -76,7 +76,7 @@ public static String filename(final String path) { return Strings.lastPathComponent(path.replace('/', java.io.File.separatorChar), - java.io.File.separatorChar); + java.io.File.separatorChar); } /** @@ -92,7 +92,8 @@ if (!file.delete()) { // NOTE: fix for java/win bug. see: - // http://forum.java.sun.com/thread.jsp?forum=4thread=158689tstart=0trange=15 + // http://forum.java.sun.com/thread.jsp?forum=4thread=158689tstart= + // 0trange=15 System.gc(); try { @@ -119,7 +120,7 @@ * @throws IOException */ public static final int writeTo(final java.io.File file, final InputStream input) - throws IOException + throws IOException { final FileOutputStream out = new FileOutputStream(file); try @@ -132,10 +133,32 @@ } } + private static String FORBIDDEN_IN_NAME = new String(\*/:?\\|,); + + /** +* p +* Replaces commonly unsupported characters with '_' +* /p +* +* @param filename +*to be cleaned +* @return cleaned filename +*/ + public static final String cleanupFilename(final String filename) + { + String name = filename; + for (int i = 0; i FORBIDDEN_IN_NAME.length(); i++) + { + name = name.replace(FORBIDDEN_IN_NAME.charAt(i), '_'); + } + return name; + } + /** * Private constructor to prevent instantiation. */ private Files() { } + }
svn commit: r713219 - in /wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket: markup/html/form/upload/FileUpload.java util/file/Files.java
Author: ivaynberg Date: Tue Nov 11 15:13:22 2008 New Revision: 713219 URL: http://svn.apache.org/viewvc?rev=713219view=rev Log: WICKET-1930 Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/file/Files.java Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java?rev=713219r1=713218r2=713219view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/upload/FileUpload.java Tue Nov 11 15:13:22 2008 @@ -187,7 +187,8 @@ */ public final File writeToTempFile() throws IOException { - File temp = File.createTempFile(Session.get().getId(), item.getFieldName()); + File temp = File.createTempFile(Session.get().getId(), + Files.cleanupFilename(item.getFieldName())); writeTo(temp); return temp; } Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/file/Files.java URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/file/Files.java?rev=713219r1=713218r2=713219view=diff == --- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/file/Files.java (original) +++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/util/file/Files.java Tue Nov 11 15:13:22 2008 @@ -76,7 +76,7 @@ public static String filename(final String path) { return Strings.lastPathComponent(path.replace('/', java.io.File.separatorChar), - java.io.File.separatorChar); + java.io.File.separatorChar); } /** @@ -92,7 +92,8 @@ if (!file.delete()) { // NOTE: fix for java/win bug. see: - // http://forum.java.sun.com/thread.jsp?forum=4thread=158689tstart=0trange=15 + // http://forum.java.sun.com/thread.jsp?forum=4thread=158689tstart= + // 0trange=15 System.gc(); try { @@ -119,7 +120,7 @@ * @throws IOException */ public static final int writeTo(final java.io.File file, final InputStream input) - throws IOException + throws IOException { final FileOutputStream out = new FileOutputStream(file); try @@ -132,10 +133,32 @@ } } + private static String FORBIDDEN_IN_NAME = new String(\*/:?\\|,); + + /** +* p +* Replaces commonly unsupported characters with '_' +* /p +* +* @param filename +*to be cleaned +* @return cleaned filename +*/ + public static final String cleanupFilename(final String filename) + { + String name = filename; + for (int i = 0; i FORBIDDEN_IN_NAME.length(); i++) + { + name = name.replace(FORBIDDEN_IN_NAME.charAt(i), '_'); + } + return name; + } + /** * Private constructor to prevent instantiation. */ private Files() { } + }
[jira] Resolved: (WICKET-1930) FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters
[ https://issues.apache.org/jira/browse/WICKET-1930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Igor Vaynberg resolved WICKET-1930. --- Resolution: Fixed Fix Version/s: 1.4-RC2 1.3.6 Assignee: Igor Vaynberg FileUpload.writeToTempFile uses field Id as filename - Windows doesn't support some characters -- Key: WICKET-1930 URL: https://issues.apache.org/jira/browse/WICKET-1930 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.5, 1.4-M3 Environment: Windows Reporter: Bruno Borges Assignee: Igor Vaynberg Fix For: 1.3.6, 1.4-RC2 Attachments: patch-Files.diff, patch-FileUpload.diff The component FileUpload tries to create a temporary file using the multipart fieldname's id. That id has invalid characters - not supported on Windows environments, for example. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.