我已经下载了typesafe激活器完整版,开始使用Play框架.在运行activator run命令后创建play-java项目后,它开始下载许多已存在于~/activator-1.3.2/repository本地文件夹中的库.
可能是它正在更新它们,但由于网络连接速度慢,我想完全脱机工作.我试过activator -Dactivator.checkForUpdates=false run但它仍然下载它们.
假设我有page1.aspx和page2.aspx,我使用查询字符串将一些数据从page1发送到page2并分配给某个变量.
第2页中有一些字段,因此用户必须保留一段时间才能进入下一页(例如第3页).
如果第二个用户也访问来自page1的page2,那么从查询字符串获取值的page2的变量是否会改变?
编辑:
示例:我在服务器中有"txt /","img /"和"temp /"等文件夹,第1页有文件上传选项,用户可以上传文件,它将保存在"temp /"文件夹中.在同一页面中有文件扩展名检查方法,对应扩展名,信息将发送到第2页,
第1页:
string filePath;
if(extension == "txt")
{
filePath = "txt/";
Response.Redirect("Page2.aspx?filePath=" + filePath + "&fileName=" + fileName);
}
if(extension == "png")
{
filePath = "img/";
Response.Redirect("Page2.aspx?filePath=" + filePath + "&fileName=" + fileName);
}
Run Code Online (Sandbox Code Playgroud)
第2页:
string fileName = HttpContext.Current.Request.QueryString["fileName"].ToString();
string filePath = HttpContext.Current.Request.QueryString["filePath"].ToString();
string savingPath = filePath + fileName;
Run Code Online (Sandbox Code Playgroud)
第2页有Save按钮保存文件.
user1上传txt文件并进入page2并在2分钟后单击Save按钮,但在user1单击save按钮之前,user2上传图像文件并进入page2.所以现在将第一个文件即txt文件保存到"img"文件夹(这是我的疑问),因为来自查询字符串的filePath变为"img /"或一切都将按预期完成,意味着txt文件将保存在"txt /"中?
我想获取服务器上的目录结构并将其解析为 json 格式,以便我可以通过 ajax 将其发送到 jQuery treeview 插件(Dynatree)。Dynatree 接受如下树数据:
[
{"title": "Item 1"},
{"title": "Folder 2", "isFolder": true, "key": "folder2",
"children": [
{"title": "Sub-item 2.1"},
{"title": "Sub-item 2.2"}
]
},
{"title": "Folder 3", "isFolder": true, "key": "folder3",
"children": [
{"title": "Sub-item 3.1"},
{"title": "Sub-item 3.2"}
]
},
{"title": "Lazy Folder 4", "isFolder": true, "isLazy": true, "key": "folder4"},
{"title": "Item 5"}
]
Run Code Online (Sandbox Code Playgroud)
在这个问题中,@Timothy Shields 展示了一种从 DirectryInfo 类获取 Directory 并将结构解析为 Json 格式的方法,如下所示:
JToken GetDirectory(DirectoryInfo directory)
{
return JToken.FromObject(new
{
directory …Run Code Online (Sandbox Code Playgroud)