简体   繁体   English

Wicket-每个会话创建新文件夹

[英]Wicket - Create new folder per session

I am using apache wicket 1.5 and when a new session is initialized I want to create a new temp folder: 我正在使用apache wicket 1.5,并且在初始化新会话时,我想创建一个新的临时文件夹:

Example: 例:

Session_1_connect -> create_temp_1 会话_1_​​连接-> create_temp_1

Session_1_disconnect -> delete_temp_1 会话_1_​​断开连接-> delete_temp_1

A new user logs in: 新用户登录:

Session_2_connect -> create_temp_2 Session_2_connect-> create_temp_2

Session_2_disconnect -> delete_temp_2 Session_2_disconnect-> delete_temp_2

I know how to make dirs in java, thats not a problem. 我知道如何在Java中制作Dirs,这不是问题。 Its just how to configure it in wicket? 它只是如何在检票口配置它?

Session的构造函数中似乎合乎逻辑。

You could solve this even without Wicket by simply implemeting the functionality in sessionCreated() and sessionDestroyed() in your own HttpSessionListener and then adding it like this to your web.xml : 你可以通过简单地implemeting在功能解决这个问题,即使没有检票sessionCreated()sessionDestroyed()在自己的HttpSessionListener ,然后添加像这样到你web.xml

<listener>
  <listener-class>org.your.package.YourSessionListener</listener-class>
</listener>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM