• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

placing \" in the textfield causes error 500

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the textfield of any JSP page of the web application if one places \" it causes JSP to crash. Does anyone have ideas on this?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
Is the \" in the textfield as data when you write it out or as something the user enters?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
\ is an escape character. For it to be displayed properly, you need to use \\

Eric
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just like the rest of Java.
 
John Bennet
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone give me a sample of the code to check for \" in JavaScript since it seems to be in the client-side validation.
 
John Bennet
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I include a form_validation.js file to all the JSP's that I'm using. Do I have to include that .js file to the header of all JSP files. Is there a central place where I can include w/o having to mess with all the files?
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
You can use the JavaScript match function to check for special characters. I think you want to search for the backslash, not just \". Example code is text.match(/\\/).

Also, there is no way to automatically include the javascript in all pages without touching the code. If you have a common header that you already include in all pages, you could add the javascript there though.
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Bennet:
How do I include a form_validation.js file to all the JSP's that I'm using. Do I have to include that .js file to the header of all JSP files. Is there a central place where I can include w/o having to mess with all the files?




Are you asking how to link to an external JavaScript file?


You can place this statement in the <head> section of your JSP. It has nothing to do with JSP includes though.
 
reply
    Bookmark Topic Watch Topic
  • New Topic