简体   繁体   English

如何在JSP中打印双引号?

[英]How do you print a double quote in JSP?

I am trying to escape with double quote - 我试图用双引号逃脱-

out.print(" \" ");

This does not work in JSP. 这在JSP中不起作用。

I have tried printing it out in single quotes 我试过用单引号将其打印出来

out.print(' " '); 

this does not work either. 这也不起作用。

What is the problem? 问题是什么? I have been looking for this answer for ever and I feel like the solution is staring me in the face. 我一直在一直寻找这个答案,我觉得解决方案使我望而却步。 and don't give me the Java solution, you can not escape them like you do in Java, it does not work in JSP for this issue. 而且不要给我Java解决方案,就不能像在Java中那样逃避它们,因此在JSP中此问题不起作用。

out.print("\\""); out.print(“ \\”“);

This solution ended up being the one that worked. 该解决方案最终成为了可行的解决方案。 My editor kept telling me that it wasn't valid code, but it ran just fine. 我的编辑不断告诉我这不是有效的代码,但运行得很好。

打印此:

out.print(""");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM