I have a web application having an index.jsp as a welcome page and it has two href links. One pointing to jnlp file and the other to a jsp (having applet config in it). Either way, a swing application is launched via JWS or java-plugin in the browser depending on which link got clicked.
This application is deployed in Tomcat 7 with form based authentication configured for every resource in the context i.e. /*.
On requesting index.jsp (the very first request to server) from browser, i am correctly redirected to login.jsp and on passing right credentials, web server successfully redirects and delivers contents of index.jsp. So far so good.
Now, on clicking jnlp link, JWS complains of JNLParseException (arising due to the jnlp file content being that of login.jsp). On clicking the other link (pointing to jsp having applet config in it), java plugin complains of 'ClassFormatError - incompatible magic value 1008813135 in class file path/to/the/applet/class/file'. I am assuming this error due to the same login.jsp being returned when the java-plugin requests for the required applet class file.
When switched to the Basic Authentication configuration in tomcat, the application works fine. In this configuration, the browser pops up the 401 auth dialog on requesting index.jsp (the very first request to server). On successful authentication, contents of index.jsp is returned. After that, on clicking either jnlp/jsp(containing applet config in it), jws/java-plugin pops up another 401 authentication dialog requesting for correct username+password. On entering correct credentials here, the application launches without any issues.
Any suggestions on what can be done for the form based authentication scenario?
Please comment in case of confusion or more details are required.