I.E why we can not run the application like simple Java program
You cannot override the _jspservice() method within a JSP page. You can however, override the JSPinit() and JSPdestroy() methods within a JSP page. JSPinit() can be useful for allocating resources like database connections, network connections, and so forth for the JSP page. It is good programming practice...
The problem I am facing is that whenever I fill details in the form and then click on upload link then request go to upload.JSP and when after uploading the form the request comes back to registration page(1st page) then the values from all fields disappear
It allows the servlet to set the content length and mime type of the reply. Provides an output stream, servletoutputstream and a writer through which the servlet can send the reply data.
Each servlet has the same life cycle:a server loads and initializes the servlet (init())the servlet handles zero or more client requests (service())the server removes the servlet (destroy()) (some servers do this step only when they shut down)