Skip to Content
author's profile photo Former Member
Former Member

Display static html page in popup

Hello all,

I have to display a popup that alerts the user to the fact that a file has been written successfully (or not). The popup has to auto-close after 2 seconds or so; so that the user doesn't have to always press the "OK" button like with javascript alert. If there is a way to close the javascript alert box I'd be happy to know though.

So I thought the javascript;

win ='',.....

followed by;


would be the way to go. I see now that it isn't. I guess because the popup opens on the client while the code is run on the server and this causes a permissions problem.

Then I figured that I could add the html file to my .par and open it locally from my java code. I can't seem to get that working however.

I also figure that since the J2EE server is a server then there must be someplace there I can put an html file and then just call it over http.

Any help with this will be greatly appreciated.

Thanks for your time,


Message was edited by: Patrick O'Neill

So that I could mark it as a question 😉

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Dec 20, 2004 at 05:52 AM

    Hi Patrick,

    Could you not simply have the code launch a new URL after the file save?

    You could host a very simple website with the one page that you want to show, have the code launch the URL and use the below script within the page that you launch?

    <body onLoad="setTimeout(window.close, 3000);">

    Hope this helps.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 28, 2005 at 09:53 AM


    I had the same problem this morning: I wanted to include an external javascript, located somewhere in the par-file. The solution in JSP (or Java) to produce the path dynamically and correctly in all cases is the following:

    String componentName = componentRequest.getComponentContext().getComponentName();
    String baseURL = componentRequest.getWebResourcePath(componentName);
    <script language="JavaScript" src="<%= baseURL %>/scripts/MyScript.js"></script>

    hope this helps anyone!



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.