如果我设置这样的会话:
<%
session.setAttribute("taintedAttribute", "what ever we want");
%>
Run Code Online (Sandbox Code Playgroud)
通常我们可以在EL中获得这样的会话变量
${sessionScope.taintedAttribute }
Run Code Online (Sandbox Code Playgroud)
但是,如果我想这样做怎么样
<%
String name = "taintedAttribute";
//session.setAttribute(name, "what ever we want");
session.getAttribute(name);
%>
Run Code Online (Sandbox Code Playgroud)
那么我们如何在EL中调用它?
EL可以得到类似的东西${sessionScope.---dynamic name ---}吗?
如果我这样做:
<c:set var="name" value="taintedAttribute" />
<c:out value="${sessionScope.[name]}"/>
Run Code Online (Sandbox Code Playgroud)
该名称将替换taintedAttribute为与此行相同
${sessionScope.taintedAttribute}
Run Code Online (Sandbox Code Playgroud)
那可能吗?我怎样才能做到这一点?
我正在学习如何使用InputStream.我试图为BufferedInputStream使用mark,但是当我尝试重置时,我有以下异常:
java.io.IOException: Resetting to invalid mark
Run Code Online (Sandbox Code Playgroud)
我认为这意味着我的标记读取限制设置错误.我实际上不知道如何在mark()中设置读取限制.我试过这样的:
is = new BufferedInputStream(is);
is.mark(is.available());
Run Code Online (Sandbox Code Playgroud)
这也是错误的.
is.mark(16);
Run Code Online (Sandbox Code Playgroud)
这也引发了同样的异常.我怎么知道我应该设置什么读取限制?因为我将从输入流中读取不同的文件大小.