Here is my JSP page that has deployed on WAS 6.0:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/WEB-INF/struts-html.
tld"
prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.
tld"
prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic
.tld"
prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-form.
tld"
prefix="form" %>
<%@ include file="/jsp/jsp_head.jsp"%>
<%@ page import="java.util.Vector" %>
<%
Vector vList = (Vector)request.getAttribu
te("VIPLis
t");
if(vList == null)
vList = new Vector();
String vipName = WebUtil.null2String((Strin
g) request.getParameter("vipN
ame"));
String vipTitle = WebUtil.null2String((Strin
g) request.getParameter("vipS
tatus"));
%>
<html>
<head>
<script language="JavaScript" src="<%=request.getContext
Path()%>/j
sp/js/vipl
.js"></scr
ipt>
<script>
<!--
vipTitle = new Array(<%=vList.size()%>);
vipName = new Array(<%=vList.size()%>);
function fillVipName(){
window.opener.document.VIP
LApplForm.
vipName.va
lue=vipNam
e[document
.vipList.v
ip_name.se
lectedInde
x];
window.opener.document.VIP
LApplForm.
vipStatus.
value=vipT
itle[docum
ent.vipLis
t.vip_name
.selectedI
ndex];
self.close();
}
function showVipAddForm(){
<% if(vList.size() == 0){ %>
document.VIPListForm.submi
t();
<% } %>
}
//-->
</script>
<link rel="stylesheet" href="<%=request.getContex
tPath()%>/
VIP.css">
<title>
Add/Update Application
</title>
</head>
<BODY onload="javascript:showVip
AddForm()"
>
<form name="vipList">
<select name="vip_name">
<script language="javascript">
<!--
for(i=0; i<<%=vList.size()%>; i++){
document.writeln("<option>
" + vipName[i].toUpperCase() + "</option>");
}
//-->
</script>
</select>
<input type="button" value="Select" onClick="fillVipName()">
</form>
</BODY>
</html>
When I am calling this page deployed on my computer, there is no error. However, when I deployed this page on my colleague's computer, the following Javascript error is shown ( I am using IE 6 for both):
"Line: 1388, Error: Syntax Error"
When I click "Yes" on the dialog box, I found that the following is interpreted:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript" src="/vipl/jsp/js/vipl.js"
></script>
<script>
<!--
vipTitle = new Array(447);
vipName = new Array(447);
function fillVipName(){
window.opener.document.VIP
LApplForm.
vipName.va
lue=vipNam
e[document
.vipList.v
ip_name.se
lectedInde
x];
window.opener.document.VIP
LApplForm.
vipStatus.
value=vipT
itle[docum
ent.vipLis
t.vip_name
.selectedI
ndex];
self.close();
}
function showVipAddForm(){
}
//-->
</script>
<link rel="stylesheet" href="/vipl/VIP.css">
<title>
Add/Update Application
</title>
</head>
<BODY onload="javascript:showVip
AddForm()"
>
<form name="vipList">
<select name="vip_name">
<script language="javascript">
<!--
for(i=0; i<<%=vList.size()%>; i++){
document.writeln("<option>
" + vipName[i].toUpperCase() + "</option>");
}
//-->
</script>
</select>
<input type="button" value="Select" onClick="fillVipName()">
</form>
</BODY>
</html>
I am guessing the server setting is somehow wrong in my colleague's computer, since the locale are the same for both computers.
Can someone helps to solve this problem? Thanks.
Start Free Trial