This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
My Requirement is to upload the images into database through jsp. For that i write a code .And it works fine .But in that File imgfile = new File("C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/test/Blue.jpg"); instead of that i used File imgfile = new File("Blue.jpg"); like that it didn't work. When we browse that image from local system it automatically takes like Blue.jpg and didn't take the full path. So i got the error as " Blue.jpg not found". Please tell the solution how can i resolve my problem.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35249
7
posted
0
Web apps don't have a concept of a "default directory"; you always need to use full, absolute paths. Also, you should not perform I/O in a JSP; JSPs are meant to create HTML or similar texual output, not for any kind of computation. Move that code into a servlet or a backing bean instead. That's much more maintainable.