Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

different behavior occurs, why?

 
hisham ragheb
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • 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???
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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!

 
Sean Clark
Rancher
Posts: 377
Android Java Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic