jsp中空格字符怎么写,如何在JSP中的两个变量之间插入空格?

I have one line of html in a form on a JSP page like this:

However, the space between the key and the value ${entry.key} ${entry.value} is lost when the form is submitted. I've tried using a \ before the , in that case both the \ and the are still there when submitting.

It seems that Java EL does not preserve isolated spaces, is that right? If so, is there a valid workaround?

EDIT: This is so silly of me, many thanks to Cthulhu. But I still don't understand the behavior after adding a \. Why would that cause the space to show?

解决方案

You can insert white-spaces using:  

Edit: Seems to be a bug in the way spaces are handled by the EL parser, so you should use either html entities like   or the other ways outlined here.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值