• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

opening chm file from jsp page

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to make chm file stored in server to be available on client jsp page?

when i tried below jsp code, its successfully opens the chm file on click of the link:



but, when i used below jsp code to access chm file on server, its showing weired texts:



please tell me the right way of opening chm stored in server. Thank you.
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's probably not setting the right content type in the response. Add a mime-mapping to your application's deployment descriptor.

I'm not sure what the correct content type is. A quick web search returned some possibilites:

  • application/mshelp
  • application/x-msdownload
  • application/chm
  •  
    Sheriff
    Posts: 67749
    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
    Are you installing the chm file on every person's computer that will visit your site? Because that's what your code is assuming by using a file path as the URL.

    Am I correct in assuming that this is not really your intention?
     
    vikas sharmaa
    Ranch Hand
    Posts: 191
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you Bear and Michael for the quick response.

    Michael, i set application/x-chm mime-type in the tomcat server's web.xml file but it does not have any effect. i also tried application/mshelp, application/x-msdownload, and application/chm .. but none works..

    Bear, no, i dont want chm file to be exists on everyone's machine. In the link, < a hr e f ="help/help.chm">Help< / a> ; help.chm file is located on the server's help folder.

    please help.
     
    Michael Angstadt
    Ranch Hand
    Posts: 282
    Eclipse IDE PHP Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    vikas sharmaa wrote:Michael, i set application/x-chm mime-type in the tomcat server's web.xml file but it does not have any effect.


    Did you restart Tomcat after making the change?
     
    vikas sharmaa
    Ranch Hand
    Posts: 191
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    yes i restart the server as well
     
    Michael Angstadt
    Ranch Hand
    Posts: 282
    Eclipse IDE PHP Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Try changing the content type to something like "application/pdf" to see if it's picking up the changes you're making to web.xml. If a PDF application opens and tries to open the .chm file, you'll know that Tomcat is picking up the web.xml changes.

    Or maybe you're just not using the right content type.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic