下面的代码创建在C:\tmp\JSON\Input
一个新的文件,当我跑在我的本地应用程序:Java的新文件的创建工作在本地而不是WebSphere Application Server上
ObjectMapper mapper = new ObjectMapper();
mapper.writeValue(new File("\tmp\JSON\Input" , "file.json"), request);
但是,当耳朵被部署到服务器,我不确定文件的创建位置。我在服务器的/<root>/tmp/JSON/Input
下查找它,但它不在那里。
我是对的还是有另一种方式来做到这一点?请帮忙。谢谢。
你在使用servlet吗? – Ravi