This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Symbol filteration

 
gaurav gupta sitm
Ranch Hand
Posts: 47
Java Redhat Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Framework - JPA and Servlet Filter [ex- value.replaceAll("*", "*"); value.replaceAll("&", "&"); etc ]

Symbols
# cause to -java.lang.NumberFormatException: null

% cause to - null
JPA convert this "%" to "" (Empty) and insert nothing to database so On retrival it returns 'null'

& cause to - Space
JPA convert this '&' (amp) to '"' (Double quotes ) and insert DoubleQuotes to database so On retrival it returns ' ' (Space)


is there any technique to handle these symbols ----
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA does not do any such conversion. Perhaps include your JPA code.

Are you using parameters? You should be...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic