Παρασκευή, 27 Φεβρουαρίου 2009

JSPs and mime types

I have a simple request. I have an .xml file stored somewhere in my server. The file is an Excel sheet saved in .xml format. I simply point to it from an anchor in my jsp page. I want, when the user, left-clicks to it, MS-Excel (or OO Calc) to open to display the file instead of its contents being displayed inside the browser. So, I set the mime type in the anchor tag like so:

<a type="application/vnd.ms-excel; charset=UTF-8" href="<c:url value='/templates/template.xml'/>"><img src="<c:url value='/images/excel.gif'/>"></a>

The trick seems to work fine for Firefox, but alas, not for Internet Explorer. If someone knows a solution, please let me know. :-)

Τετάρτη, 11 Φεβρουαρίου 2009

Speed up Intellij IDEA startup time

Intellij IDEA 8 has become a big IDE and takes quite sometime to startup. Here are a couple of hints to improve startup time:
  1. replace idea.exe.vmoptions contents with the following one:
-Xms400m
-Xmx800m
-XX:MaxPermSize=120m
-ea
-Dsun.awt.keepWorkingSetOnMinimize=true

increasing the RAM size allocation even more if your machine can handle it, e.g. to 1024m

2. modify idea.properties by moving the config directory to a faster drive if e.g. you home profile is saved in a network drive, e.g.:

# idea.config.path=${user.home}/.IntelliJIdea80/config
idea.config.path=D:/Config/.IntelliJIdea80/config