Hello Friends,
I am facing some problem in
servlet which is written to download files .
I wrote a servlet for downloading jar files. once the user clicks a button or link the servlet is called.
HTML CODE.
----------
In the above code HelloWorld is my servlet .The code is as follows
SERVLET CODE
------------
I have stored my webapps as d:\tomcat\webapps\karthik
and the a.jar in the d:\tomcat\webapps\karthik path.
when i submit i unable to download the jar , the file i receive is as of unknown format.The file is named HelloWorld.
My web.xml
[CODE
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>] [/CODE]
I tried with text files , my text file is opening in the same page without prompting.
Can any one please help me out.