ASF Bugzilla – Attachment 12523 Details for
Bug 30841
Capitalize work erroneously.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patchfile to fix the capitalization in <string:capitalize> to only affect the first word.
capitilize-patch.txt (text/plain), 1.22 KB, created by
David H. DeWolf
on 2004-08-25 14:12:26 UTC
(
hide
)
Description:
Patchfile to fix the capitalization in <string:capitalize> to only affect the first word.
Filename:
MIME Type:
Creator:
David H. DeWolf
Created:
2004-08-25 14:12:26 UTC
Size:
1.22 KB
patch
obsolete
>? build >? capitilize-patch.txt >? jakarta-taglibs-string.iml >? jakarta-taglibs-string.ipr >? jakarta-taglibs-string.iws >Index: src/org/apache/taglibs/string/CapitalizeTag.java >=================================================================== >RCS file: /home/cvs/jakarta-taglibs/string/src/org/apache/taglibs/string/CapitalizeTag.java,v >retrieving revision 1.6 >diff -u -r1.6 CapitalizeTag.java >--- src/org/apache/taglibs/string/CapitalizeTag.java 9 Mar 2004 00:54:45 -0000 1.6 >+++ src/org/apache/taglibs/string/CapitalizeTag.java 25 Aug 2004 14:00:09 -0000 >@@ -15,7 +15,6 @@ > */ > package org.apache.taglibs.string; > >-import org.apache.commons.lang.WordUtils; > import javax.servlet.jsp.JspException; > > /** >@@ -32,7 +31,17 @@ > > > public String changeString(String text) throws JspException { >- return WordUtils.capitalize( text ); >+ if(text == null || text.length() == 0) { >+ return text; >+ } >+ >+ String capitalized = ""; >+ if(text.length() > 1) { >+ capitalized = text.substring(1); >+ } >+ >+ capitalized = Character.toTitleCase(text.charAt(0)) + capitalized; >+ return capitalized; > } > > public void initAttributes() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 30841
: 12523