JSP中的Java代码:如何用双引号引起来 [英] Java Code inside JSP: How to put double quotes

查看:78
本文介绍了JSP中的Java代码:如何用双引号引起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的遗留代码直接在JSP中使用Java.我不能使用EL.我在这里遇到问题:

Our legacy code use Java directly inside JSP. I cannot use EL. I got a problem here:

<jbo:DataSource id="dsyn" appid="AM_Quebec" viewobject="YesnoView1" 
                whereclause='<%="yesno.yn_lang="+locale%>'>

对于子句,我真正想要的是这样的:

For the whereclause, what I really want is like this:

String yesno_wc = "yesno.yn_lang='" + locale + "'";

任何人都知道如何将yesno_wc放在where子句中吗?谢谢

Anybody knows how to put the yesno_wc in the where clause? Thanks

推荐答案

在Java中,您可以使用反斜杠转义双引号.

In Java you can escape double quotes with a backslash.

我可能首先存储该值,下面是一个示例JSP将值存储在scriptlet中,然后使用带有JSP表达式的标记作为值.

I might first store that value, here is an example JSP storing the value in a scriptlet, then using a tag with a JSP expression as the value.

这篇关于JSP中的Java代码:如何用双引号引起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆