• Post Reply Bookmark Topic Watch Topic
  • New Topic

Display Problem  RSS feed

 
Vasudevan Gopalan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a hidden variable like this in my form



If i have double Quotes in recordset value,it is printing the recordset value in the jsp page itself.

Regards
Vasu
 
saager mhatre
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that's entirely expected!
The JSP Translation phase simply writes the static text into strings or char[] and appends the results of your scriptlets in the appropriate locations. So any double quotes in the Recordset values would simply fall through to the output.
You could consider using single quotes in your HTML, but then you'd have to watch out for single quotes in your Recordset values!
 
Ayeda AngeL
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I have faced this problem earlier..
you can try the following, try putting the value before the name and see how does it look...and you dont need to use the double qoutes
<input type=hidden value=<%=rs.getString(1)%> name=hdn_text>
try that..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and you dont need to use the double qoutes

Bad advice.
If you do not quote the attributes in HTML you will start running into problems with space characters and so on.
The real solution to your problem is to run your data through an HTML encoder that will change special characters into their HTML entity equivalents so that the browser will not get confused when parsing your page. A search of this forum (or google on the net) should give you more information.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!