Search This Blog

Thursday, October 1, 2009

Call Parent window method from Child Window using JavaScript

In this week I have solved three technical problems while working in TMS (Transport Management System) application.

Problems:

  1. In html need to call a parent window method from the child window.
  2. com.sun.tools.Main class found error while starting the Tomcat ( After new installation of Tomcat)
  3. Tomcat cannot support JDK1.5 error.

Solution 1:

    • In html need to call a parent window method from the child window.

In my application I have to call a parent window method from child window method for setting value in parent window.

Example:

  1. Parent window has Method as PrentMethod()
  2. Child window has Method as ChildMethod();
  3. Inside Child window method ChildMethod() we have to call parent window method ParentMethod() like window.opener.ParentMethod();

Refer the below link for more information

http://www.codingforums.com/archive/index.php/t-36165.html

Solution 2:

com.sun.tools.Main class found error while starting the Tomcat ( After new installation of Tomcat)

To solve this issue we have to include the tools.jar file in Tomcat.

Steps:

1. copy the tools.jar file from C:\Program Files\Java\jdk1.5.0_06\lib\tools.jar

2. paste the same into the tomcat common lib directory (D:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib\tools.jar)

3. Now restart the server you wont get the com.sun.tools.Main class not found exception.

Solution 3:

Tomcat cannot support JDK1.5 error.

While working with tomcat 5.0 we seem to get Virtual machine does not support generics (JDK1.5 features). So the JSP file can’t compile.

If we want to enable jdk1.5 feature support, we have to supply two initial parameter for JspServlet class present in web.xml(\tomcat5.0\config.xml)

Two initial parameters are:

  1. compilerSourceVM
  2. compilerTargetVM

Default:

jsp

org.apache.jasper.servlet.JspServlet

fork

false

xpoweredBy

false

3

After Change:

jsp

org.apache.jasper.servlet.JspServlet

fork

false

xpoweredBy

false

3

compilerSourceVM

1.5

compilerTargetVM

1.5