I wants to store some files into the project, for that i have created a folder inside the project application.
Now i need to store some files dynamically at present iam giving the path of the folder to store like c:\\program files\\---\\--- like this iam storing but i not a right way i think but while iam giving project to client they can store the project in different location that time i will show error for time being i kept like this please help me to solve my problem .
Thanks for your reply but it is not working for me, below i have given my code please go through it and if i wants to change any thing please guide me.
Hear i am give the path to store the files what iam uploading.
Now you can see the path to where iam telling the uploaded files to save but i have used method is not good because it is storing in local host, even though iam giving the project path its not a perfect.
My project is working fine but without error but now i have created one folder under WebContent i need to save the files in that folder not in D:\Eclipse\eclipse\WorkSpace like this how i can solve this problem. please help me. its so urgent.
I can see you are using Java code inside JSP. That is not a good practice. JSP is used for displaying contents and should not contain any Java code. Any Java code should be move to Java files i.e. Service classes according to MVC architecture. There are tons of benefits using right tool, one of them is maintenance.
you can use "/<Folder name>" or something like "../<Folder name>" for storing it in subfolder of the parent folder..
Thanks and Regards
Senthil Kumar M
Joined: Jan 05, 2012
Thanks for your reply
To solve this problem what i want to do, iam new to development field please guide me to solve this. i learned myself no one is not there to guide me so i did some mistake, to rectify the problem please help me.
Thanks in advance.
Joined: Jan 05, 2012
I have change my code into jsp+ servlet files but now iam facing some error please help me to solve, if iam doing mistake please intimate me.It is a file uploading concept.
My servlet file is Upload.java
If you say that ServletContext context = pageContext.getServletContext(); in this line its showing error while compiling time cannot find symbol. then i kept
private GenericServlet pageContext;
ServletContext context = pageContext.getServletContext();
now its not showing error compilation fine but while running time its shows the error as
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.