• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

different behavior occurs, why?

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i created a web application to download a jar file...but when i run the application it tries to open the servlet itself

here is the code

The Servlet:



this is the form.html(reside in the application context root):





This is the web.xml file:




i place the servlet-api.jar in the application context root as supposed...but whe i click the download button a dialog from the browser appears to either save dodo.do file or to choose a file to open it....how is that....why???
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to use 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 button on your post.
 
Bear Bibeault
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hisham ragheb wrote:i place the servlet-api.jar in the application context root as supposed


Incorrect. You must not copy the servlet-api.jar anywhere! Just leave it in the Tomcat folder where it belongs!

 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but whe i click the download button a dialog from the browser appears to either save dodo.do file or to choose a file to open it....how is that....why??



I think you want to check out this link: http://www.javaworld.com/javaworld/javatips/jw-javatip94.html

Sean
 
hisham ragheb
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:

hisham ragheb wrote:i place the servlet-api.jar in the application context root as supposed


Incorrect. You must not copy the servlet-api.jar anywhere! Just leave it in the Tomcat folder where it belongs!



you didnt understand....i just took a copy from the tomcathome/lib just to test my web application

of course i didnt took the one that tomcat use :wink

i just took a copy of any jar file to test its downloading
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic