I am stuck with few problems related to JSP - Java applet file write and database connectivity issues.
1) Calling the applet class from JSP works in the web browser. But the file write code written in applet does not work when called from JSP ( It works if the program is separately executed as a Java applet).
2) Also java database connectivity works when executed from Java applet separately, but does not work when called from JSP.
Tried the following things to make this work, but no success:-
--> According to Tomcat Security Manager
" The security policies implemented by the Java SecurityManager are configured in the $CATALINA_HOME/conf/catalina.policy file. This file completely replaces the java.policy file present in your JDK system directories "
So granted permission to the folder where file is to be written using java.io.FilePermission in catalina.policy file of tomcat, but still does not work for JSP
All of that is rather confusing, but my general impression is that you don't understand that a JSP runs on the server and an applet runs on the client. Therefore if a JSP tries to write to a file (which is a bad practice), it writes to a file on the server, and if an applet tries to write to a file, it writes to a file on the client.
As for database connectivity, apply the same principle. JSP runs on the server, applet runs on the client.