Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
SplStack有许多用于访问其元素的函数,但有没有办法清除它?或者我应该通过用新的空堆栈替换它来“清除”我的堆栈?
没有清除堆栈的内置方法。
您要么需要使用 pops 或 unsets 清除它:
while($stack->valid()) { $stack->pop(); }
或者取消设置堆栈本身,并创建一个新的:
unset($stack); $stack = new \SplStack();
在我的jsp中,如果我打电话<form action="/sampleServlet" method="get" name="form1">,我会得到以下异常:
<form action="/sampleServlet" method="get" name="form1">
http 404 错误--未找到 sampleServlet。我在 web.xml 文件中设置