jsp中在href中传递参数

时间:2022-05-06
本文章向大家介绍jsp中在href中传递参数,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
  <%  
  Configuration conf = new Configuration();  
  URI uri = new URI("hdfs://192.168.0.52:9010");  
  FileSystem fileSystem = FileSystem.get(uri, conf);  
  //System.out.println("Hdfs directory is"+"n");  
  Path src1 = new Path("hdfs://192.168.0.52:9010/user/hadoop");  
  FileStatus files[] = fileSystem.listStatus(src1);  
  Path filePath=null;  
  for(FileStatus file:files){  
  //System.out.println(file.getPath());  
  %>  
  <p><a href="./out.jsp?filePath=<%=file.getPath()%>"><%=file.getPath()%></a></p>  
  <%  
  //out.println("<a href="./out.jsp?filePath=file.getPath()">file.getName</a>");  
  }  
  %>