Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the .
Originally posted by Raj Kumar Bindal: If i write same code in JSP, file is getting created successfully, but it is created in OC4J/bin directory. We are using OC4J application server.
From servlet, i want to create file at location from where it is accessible by jsp.
If you want to create a file in a specific directory, then specify the full path to that directory. If you use a relative path, then it's relative to your server's current working directory. That probably isn't a useful place for your files to be stored. (I didn't read your code so I don't know what kind of path you're specifying.)
And I don't understand what it means for the files to be "accessible by JSP". If they are accessible by servlets then they are accessible by JSPs. Both can access files anywhere on the server.