[272987] WAR Import should not move Applets into ImportedClasses
diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java
index c1531f5..da24179 100644
--- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java
+++ b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/WebComponentArchiveSaveAdapter.java
@@ -54,6 +54,16 @@
 			IFile iFile = vFile.getUnderlyingFile();
 			return iFile.getProjectRelativePath();
 		}
+		if (endsWithClassType(aFile.getPath().lastSegment())) {
+			IPath relativePath = aFile.getPath().makeRelative();
+			if (!IMPORTED_CLASSES_PATH.isPrefixOf(relativePath))
+			{
+				IVirtualFolder rootFolder = vComponent.getRootFolder();
+				IVirtualFile vFile = rootFolder.getFile(relativePath);
+				IFile iFile = vFile.getUnderlyingFile();
+				return iFile.getProjectRelativePath();
+			}
+		}
 		return super.getProjectRelativePath(aFile);
 	}
 
@@ -75,7 +85,7 @@
 		String jspUri = javaUri.substring(0, javaUri.indexOf(ArchiveUtil.DOT_JAVA));
 		int lastSlash = jspUri.lastIndexOf('/');
 		int _index = lastSlash == -1 ? ArchiveConstants.WEBAPP_CLASSES_URI.length() : lastSlash + 1;
-		if (jspUri.charAt(_index) == '_') {
+		if (jspUri.length() >= _index && jspUri.charAt(_index) == '_') {
 			jspUri = jspUri.substring(ArchiveConstants.WEBAPP_CLASSES_URI.length(), _index) + jspUri.substring(_index + 1) + ArchiveUtil.DOT_JSP;
 			IPath jspPath = new Path(jspUri);
 			if (archive.containsArchiveResource(jspPath)) {