[565328] fix order of operations on package name setup
diff --git a/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
index a9ba4dc..ef72691 100644
--- a/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
+++ b/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004, 2020 IBM Corporation and others.
+ * Copyright (c) 2004, 2021 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -383,6 +383,8 @@
 		fServletAPIDescriptor = DeploymentDescriptorPropertyCache.getInstance().getServletAPIVersion(ResourcesPlugin.getWorkspace().getRoot().getProject(new Path(baseLocation).segment(0)));
 		fSuperclass = fServletAPIDescriptor.getRootPackage() + ".http.HttpServlet"; //$NON-NLS-1$
 
+		init();
+
 		String className = createClassname(node);
 		if (className.length() > 0) {
 			setClassname(className);
@@ -409,6 +411,8 @@
 		fServletAPIDescriptor = DeploymentDescriptorPropertyCache.getInstance().getServletAPIVersion(jspFile.getProject());
 		fSuperclass = fServletAPIDescriptor.getRootPackage() + ".http.HttpServlet"; //$NON-NLS-1$
 
+		init();
+
 		String className = createClassname(jspFile);
 		if (className.length() > 0) {
 			setClassname(className);
@@ -1307,22 +1311,24 @@
 	}
 
 	protected void init() {
+		String rootPackage = fServletAPIDescriptor.getRootPackage();
+
 		fClassname = "_JSPServlet"; //$NON-NLS-1$
 		fClassHeader = "public class " + fClassname + " extends "; //$NON-NLS-1$ //$NON-NLS-2$
-		
-		fImplicitImports = "import " + fServletAPIDescriptor.getRootPackage() + ".*;" + ENDL + //$NON-NLS-1$
-					"import "+ fServletAPIDescriptor.getRootPackage() + ".http.*;" + ENDL + //$NON-NLS-1$
-					"import " + fServletAPIDescriptor.getRootPackage() + ".jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
 
-		fServiceHeader = "public void _jspService(" + fServletAPIDescriptor.getRootPackage() + ".http.HttpServletRequest request," + //$NON-NLS-1$
-					" " + fServletAPIDescriptor.getRootPackage() + ".http.HttpServletResponse response)" + ENDL + //$NON-NLS-1$
-					"\t\tthrows java.io.IOException, " + fServletAPIDescriptor.getRootPackage() + ".ServletException {" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".jsp.PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".ServletContext application = pageContext.getServletContext();" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".ServletConfig config = pageContext.getServletConfig();" + ENDL + //$NON-NLS-1$ 
-					fServletAPIDescriptor.getRootPackage() + ".jsp.JspWriter out = pageContext.getOut();" + ENDL + //$NON-NLS-1$
+		fImplicitImports = "import " + rootPackage + ".*;" + ENDL + //$NON-NLS-1$
+					"import "+ rootPackage + ".http.*;" + ENDL + //$NON-NLS-1$
+					"import " + rootPackage + ".jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
+
+		fServiceHeader = "public void _jspService(" + rootPackage + ".http.HttpServletRequest request," + //$NON-NLS-1$
+					" " + rootPackage + ".http.HttpServletResponse response)" + ENDL + //$NON-NLS-1$
+					"\t\tthrows java.io.IOException, " + rootPackage + ".ServletException {" + ENDL + //$NON-NLS-1$
+					rootPackage + ".jsp.PageContext pageContext = JspFactory.getDefaultFactory().getPageContext(this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);" + ENDL + //$NON-NLS-1$
+					rootPackage + ".ServletContext application = pageContext.getServletContext();" + ENDL + //$NON-NLS-1$
+					rootPackage + ".ServletConfig config = pageContext.getServletConfig();" + ENDL + //$NON-NLS-1$ 
+					rootPackage + ".jsp.JspWriter out = pageContext.getOut();" + ENDL + //$NON-NLS-1$
 					"Object page = this;" + ENDL; //$NON-NLS-1$
-		fSuperclass = fServletAPIDescriptor.getRootPackage() + ".http.HttpServlet"; //$NON-NLS-1$
+		fSuperclass = rootPackage + ".http.HttpServlet"; //$NON-NLS-1$
 		fContext = "pageContext"; //$NON-NLS-1$
 		fSession = fContext+".getSession();"; //$NON-NLS-1$
 	}
diff --git a/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslator.java b/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslator.java
index 7fbd1e8..423cebc 100644
--- a/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslator.java
+++ b/web/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/TagTranslator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2020 IBM Corporation and others.
+ * Copyright (c) 2007, 2021 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
  * which accompanies this distribution, and is available at
@@ -20,22 +20,24 @@
 	}
 	
 	protected void init() {
+		String rootPackage = fServletAPIDescriptor.getRootPackage();
+
 		fClassHeader = "public class _TagHandler extends "; //$NON-NLS-1$
 		fClassname = "_TagHandler"; //$NON-NLS-1$
 
-		fImplicitImports = "import " + fServletAPIDescriptor.getRootPackage() + ".*;" + ENDL + //$NON-NLS-1$
-					"import "+ fServletAPIDescriptor.getRootPackage() + ".http.*;" + ENDL + //$NON-NLS-1$
-					"import " + fServletAPIDescriptor.getRootPackage() + ".jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
+		fImplicitImports = "import " + rootPackage + ".*;" + ENDL + //$NON-NLS-1$
+					"import "+ rootPackage + ".http.*;" + ENDL + //$NON-NLS-1$
+					"import " + rootPackage + ".jsp.*;" + ENDL + ENDL; //$NON-NLS-1$
 
 		fServiceHeader = "public void doTag() throws JspException, java.io.IOException, IllegalStateException, SkipPageException {" + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".http.HttpServletResponse response = null;" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".http.HttpServletRequest request = null;" + ENDL + //$NON-NLS-1$
+					rootPackage + ".http.HttpServletResponse response = null;" + ENDL + //$NON-NLS-1$
+					rootPackage + ".http.HttpServletRequest request = null;" + ENDL + //$NON-NLS-1$
 					"JspContext jspContext = getJspContext();" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".ServletContext application = null;" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".jsp.JspWriter out = null;" + ENDL + //$NON-NLS-1$
-					fServletAPIDescriptor.getRootPackage() + ".ServletConfig config = null;" + ENDL; //$NON-NLS-1$ 
+					rootPackage + ".ServletContext application = null;" + ENDL + //$NON-NLS-1$
+					rootPackage + ".jsp.JspWriter out = null;" + ENDL + //$NON-NLS-1$
+					rootPackage + ".ServletConfig config = null;" + ENDL; //$NON-NLS-1$ 
 
-		fSuperclass = fServletAPIDescriptor.getRootPackage() + ".jsp.tagext.SimpleTagSupport"; //$NON-NLS-1$
+		fSuperclass = rootPackage + ".jsp.tagext.SimpleTagSupport"; //$NON-NLS-1$
 
 		fContext = "getJspContext()"; //$NON-NLS-1$
 		fSession = "((PageContext)" + fContext + ").getSession();"; //$NON-NLS-1$ //$NON-NLS-2$