Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4340106
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:18:17+00:00 2026-05-21T11:18:17+00:00

My code currently looks like this <% if (request != null) { bustOut; }

  • 0

My code currently looks like this

<%
    if (request != null) {
        bustOut;
    }
%>

<script language="javascript">
function bustOut(){
   var newWin = window.open("the real url", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes"); 
}
</script>

How do I call the javascript function inside the Java code? Or is that not possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:18:18+00:00Added an answer on May 21, 2026 at 11:18 am

    JSP runs at webserver and generates/produces HTML/CSS/JS code upon a webbrowser request. Webserver sends HTML/CSS/JS to webbrowser. Webbrowser runs HTML/CSS/JS. So, you just have to let JSP print it literally as JS code.

    <script language="javascript">
        function bustOut(){
           var newWin = window.open("the real url", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes"); 
        }
        <% 
            if (foo != null) { 
                out.print("bustOut();");
            }
        %>
    </script>
    

    or, better, with EL

    <script language="javascript">
        function bustOut(){
           var newWin = window.open("the real url", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes"); 
        }
        ${not empty foo ? 'bustOut();' : ''}
    </script>
    

    (note that I changed the attribute name to foo because request stands for HttpServletRequest which might confuse others since this is never null)

    Either way, the generated HTML (which you should see by opening page in browser, rightclicking it and choosing View Source) should look like this when the condition was true:

    <script language="javascript">
        function bustOut(){
           var newWin = window.open("the real url", "subWindow","height=500,width=700,resizable=yes,scrollbars=yes"); 
        }
        bustOut();
    </script>
    

    Does it now turn on a light bulb above your head?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
My current code looks like the following. How can I pass my array to
I am currently having some problems with <li> in IE6 essentially my code looks
The code currently does this and the fgetpos does handle files larger than 4GB
There is probably is simple fix for this but I currently have code similar
Here is the code currently used. public String getStringFromDoc(org.w3c.dom.Document doc) { try { DOMSource
I currently have code in my ApplicationController to check if a user is logged
I am currently publishing code behind .aspx in SharePoint. I can automatically publish the
I'm currently refactoring code to replace Convert.To's to TryParse. I've come across the following
Possible Duplicate: How do I get the HMODULE for the currently executing code? I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.