jsp下面的代码
<td class=text>
<a href=User.do?act=1&firstName="+java.net.URLEncoder.encode(firstName)+"&secondName="+java.net.URLEncoder.encode(secondName)+"&birthday="+java.net.URLEncoder.encode(birthday)------这里如何转换 为el表达式??${myBean.secondName} </td> 之前是服务器端脚本《%。。%》所以可以用java.net.URLEncoder.encode函数
1现在用 el表达式 这里不知道该如何转化(需要找到对应的.encode函数
2 <a href=User.do?act=1&firstName="+ ${myBean.firstName}+。--请问可以这样用吗?
)
部分el表达如下
c:if test="${alist!=null}">
<table border="2" cellspacing="0" cellpadding="0">
<tr>
<th BGCOLOR="#00FF00"> <b>id </b> </th>
<td BGCOLOR="#00FF00"> <b> <a href=User.do?act=2&sort=Score ??????动态参数>Score </b> </td>
<td BGCOLOR="#00FF00"> <b> <a href=User.do?act=2&sort=UserName????动态参数>UserID </b> </td>
</tr>
<td class=text>
<a href=User.do?act=1&firstName="+java.net.URLEncoder.encode(firstName)+"&secondName="+java.net.URLEncoder.encode(secondName)+"&birthday="+java.net.URLEncoder.encode(birthday)------这里如何转换 为el表达式??${myBean.secondName} </td> 之前是服务器端脚本《%。。%》所以可以用java.net.URLEncoder.encode函数
1现在用 el表达式 这里不知道该如何转化(需要找到对应的.encode函数
2 <a href=User.do?act=1&firstName="+ ${myBean.firstName}+。--请问可以这样用吗?
)
部分el表达如下
c:if test="${alist!=null}">
<table border="2" cellspacing="0" cellpadding="0">
<tr>
<th BGCOLOR="#00FF00"> <b>id </b> </th>
<td BGCOLOR="#00FF00"> <b> <a href=User.do?act=2&sort=Score ??????动态参数>Score </b> </td>
<td BGCOLOR="#00FF00"> <b> <a href=User.do?act=2&sort=UserName????动态参数>UserID </b> </td>
</tr>
如果这样
<a href=User.do?act=1& firstName="+java.net.URLEncoder.encode(firstName)+"& secondName="+java.net.URLEncoder.encode(secondName)+"& birthday="+java.net.URLEncoder.encode(birthday)------这里如何转换 为el表达式??这个还是有可能作的俄???
birthday = URLEncoder.encode(birthday) 然后el
${birthday}----------有个思想就是页面上不能直接用的就先在服务器端生成后直接页面输出
之后从jsp取这个list的值 之后replaceall(“”,“%20”)