在jsp中在运行时分配文件夹名称 [英] assign folder name on runtime in jsp

查看:111
本文介绍了在jsp中在运行时分配文件夹名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< input type =textname =text1id =text1/>



<%

String s = request.getParameter(text1);

java.io .File file = new File(c:/ jk);



if(!file.exists())



file.mkdirs();



else



out.println(文件存在);



%>



如何在运行时而不是jk中指定该文件夹的名称。 ..



这意味着我在text1中提供了一个随机名称,文件夹应该用随机名称保存..

< b>

<input type="text" name="text1" id="text1"/>

<%
String s=request.getParameter("text1");
java.io.File file = new File("c:/jk");

if (!file.exists())

file.mkdirs();

else

out.println("the file exists");

%>

how can i assign name of that folder on run time instead of jk...

that means i gave a random name in text1 and folder should be saved with that random name..

推荐答案

这篇关于在jsp中在运行时分配文件夹名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆