Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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