views:

428

answers:

2

I have below piece of code in one my JSP

<%@ page language="java" import = "import com.ecc.SiteAdmin.servlets.*" %>

This file compiles and works fine on Weblogic 10 with Sun JDK 5, but fails with below message on Weblogic 10.3 with JRockit 6

SiteAdminLogin.jsp:1:36: No type with this name could be found at this location.

<%@ page language="java" import = "import com.ecc.SiteAdmin.servlets.*" %>

SiteAdminLogin.jsp:1:36: import is a keyword and cannot be used as an identifier.

<%@ page language="java" import = "import com.ecc.SiteAdmin.servlets.*" %>

I guess its asking me to remove the word import from the code, but why it works on JDK5 and not JDK6 ? Is there something more to it ?

EDIT: It seems to work fine on my colleague machine who is using IE7, I have upgraded to IE8 sometime back and then uninstalled IE8 and switched back to IE7. It looks like its a conflict on IE side.

+1  A: 

The fact the it works is strange, because putting import inside the import attribute is wrong. Perhaps they have written a (non-standard-compliant) parser that removed a leading import there.

There is nothing more - just remove the import

Bozho
+2  A: 

The import attribute of the page directive should contain a comma-separated list of Java packages that the JSP file should import. So the syntax you are showing here is just not correct and should fail in both cases (finding the exact difference would require more testing, providing the generated class, etc).

But unless you want to debug WebLogic appc, I wouldn't spend too much time on this problem, just write the import properly to fix it:

<%@ page language="java" import="com.ecc.SiteAdmin.servlets.*" %>

Regarding your edit, I don't think that the browser has anything to do with this problem as this is a pure server-side issue. Again, just fix it and stop spending time on it.

Pascal Thivent