Forums Register Login

opening chm file from jsp page

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
  • +Pie Number of slices to send: Send
    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?
    +Pie Number of slices to send: Send
    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.
    +Pie Number of slices to send: Send
     

    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?
    +Pie Number of slices to send: Send
    yes i restart the server as well
    +Pie Number of slices to send: Send
    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.
    money grubbing section goes here:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 3242 times.
    Similar Threads
    Multiple Actions issue in JSF
    2 newbie questions on errors encountered
    Tiles in JSF
    There is no Action mapped for action name prePaymentManager
    Using JSTL Data Displayed In Browser Is Getting Fixed To 24576 Bytes(24 KB)
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 29, 2024 00:18:12.