on 08-12-2008 6:15 AM
Hi
I want to write a file to a specific folder in the application server and also i want to read the same using Web Dynpro for Java.Plz help me on this.
Thanks
Renu
Hi
to Write a file onto the server
blic void Write_Data_ToTextFile( )
{
//@@begin Write_Data_ToTextFile()
try
{
String str1=wdContext.currentContextElement().getStr1();
String str22=wdContext.currentContextElement().getStrr2();
FileWriter fil = new FileWriter(new File("D:/MyData.txt"));// Path where file to be written. This path will be where the J2EE server is installed
BufferedWriter bu= new BufferedWriter(fil);
bu.write("String 1="+str1);
bu.newLine();
bu.write("String 2="+str2);
bu.close();
}
catch(Exception e)
{}
Best Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have to use the IO Package for this. Their is nothing specific to webdynpro.
Please have a look at the following links for reading and writing files in java
http://www.roseindia.net/java/beginners/java-write-to-file.shtml
http://www.javapractices.com/topic/TopicAction.do?Id=42
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.