Calling a javascript function out of java
===

Im trying to call a javascript function out of my java application. 

lets say I have an HTML file witch is located in my Java project ;

homepage.html

    <html>  
       ...  
       <script type="text/javascript">  
       ...  
       function foo(String msg)   
       {  
          alert(msg);  
       }  
       ...  
      </script>  
       ...  
    </html>  

how do I call the function foo(String msg) out of my java application

do i need to import/read the homepage.html file and just call it or is it something else I have to do ? 