以下代码导致错误:
<c:set var="test" value="test1"/>
<%
String resp = "abc";
resp = resp + ${test}; //in this line I got an Exception.
out.println(resp);
%>
Run Code Online (Sandbox Code Playgroud)
我不是在scriptlet.why中使用表达式语言"$ {test}"吗?
我有一个"jsp"文件.在该文件中,我有"Javascript"脚本.在<script>标签内,只允许使用javascript但是,"表达式语言"是如何执行的?
<body>
<script type="text/javascript">
var b=${requestScope.name};
</script>
</body>
Run Code Online (Sandbox Code Playgroud) 我有以下Java类:
public class HelloWorld{
public static void main(String []args){
String s = 23.toString();//compilation error is ';' expected
s = s + "raju";
System.out.println(s);
}
}
Run Code Online (Sandbox Code Playgroud)
但是根据自动装箱23.toString()必须转换为新的Integer(23).toString()并执行该行.那么为什么我仍然会收到编译错误?