Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to "Add a new mime type to your Web Server"

 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading HeadFirst Java and I am on chapter 17 where they explain webstart

Their example simply runs on the local computer(127.0.0.1)

I understand that I have to place my .jar and .jnlp in a folder that I specify in the .jnlp file

Then I create an html file that has the link to that .jnlp file - put that html file in with the .jar and .jnlp

But how do I "Add a new mime" to the web server and what is a "mime"

The book gives me this line:

applications/x-java-jnlp-file

Am I supposed to run that at the command line?

Also where do I get this "JWS Helper App"?

Also what is the difference between a .jar and a .exe?

Thanks for the help!
 
Simon Roberts
Author
Ranch Hand
Posts: 170
7
Java Linux Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the risk of being unhelpful, this depends on your webserver.

In the case of Tomcat, you could edit the web.xml file located in the conf subdirectory of the installation. You'll find a bunch of "mime mapping" blocks, like this example:

<mime-mapping>
<extension>jpg</extension>
<mime-type>image/jpeg</mime-type>
</mime-mapping>

Add one for your needs, specify the extension to be jnlp, and the mime type to be application/x-java-jnlp-file (note, there's no "s" on application...)

<mime-mapping>
<extension>jnlp</extension>
<mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>

For other webservers, might try the documentation. The idea is that you're telling the webserver how to report the type of a file when it sends it over HTTP. For example, a jpeg file is known by the mime type "image/jpeg"

HTH,
Simon
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay but what exactly is a mime?
 
Simon Roberts
Author
Ranch Hand
Posts: 170
7
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
multipurpose internet mail extension

the name of the standard/convention that comes up with names like "application/x-java-jnlp-file"
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay after a bit of research using the info you gave me I got it all up and running

Thanks a ton! Couldn't have done it without you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic