好的,首先请原谅我的英语技能。 我有个问题。 Servlet加载到带有文件地址和目录地址的jsp ArrayList。我需要导演是一个图像和文件其他图像。现在看起来像pic
P.S。如果你可以帮助我下拉列表(当点击目录打开并将图像从关闭文件夹更改为打开文件夹)我会非常高兴。
恭敬地你的
JSP文件:
<table border = "1">
<c:forEach items = "${fath}" var = "fath">
<th> <a href="/back?name=${fath}">
<img src="opfolder.png"> </a>
</th>
<th>
${fath}
</th>
</c:forEach>
<c:forEach items= "${FileZ}" var="FileZ">
<tr>
<td>
<a href = "open?name=${FileZ.father}">
<img src ="clfolder.png"/>
</a>
</td>
<td>${FileZ.name}</td>
</tr>
</c:forEach>
</table>`
Java Servlet文件:
@WebServlet(name = "ToOut" , urlPatterns = "/fileman")
public class ToOut extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setAttribute("FileZ",AllFiles.getDir(AllFiles.getAdress()));
request.getRequestDispatcher("fileman.jsp").forward(request,response);
}}