Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to call Javascript function inside Java code, in a JSP Page

843838Jan 18 2006 — edited Jan 18 2006
Hi,

I have to call a window.open() JS function when a particular condition in Java code is true. This java code is present in a JSP Page.

I am attaching a code snippet here.
<%@include file="../general/path.jsp"%>
<%
String ip = request.getHeader("X-Forwarded-For");
      
if(ip == null)
   ip = request.getRemoteAddr();

if("3.44.100.106".equals(ip)){
      -- Need to open a pop up window.
}
%>

<html>
<head>

	<title>Press Express - Create Contact List</title>
Could anyone pls tell me how to open a pop-up window (another jsp page) in this scenario ?

Thanks !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2006
Added on Jan 18 2006
2 comments
248 views