Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorTag.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorTag.java	(revision 6790)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/CKEditorTag.java	(revision 6791)
@@ -44,20 +44,20 @@
 	public int doEndTag() throws JspException {
 		JspWriter out = pageContext.getOut();
-        try {
-        	String output = "";
-            if (!isInitialized()) {
-            	out.write(init());	
-            }  
-            if (globalEvents != null) {
-            	output += globalEvents.returnGlobalEvents();	
-            }
-            CKEditorConfig cfg = null;
-            if (config != null) {
-            	cfg = config.configSettings(this.events);	
-            }            
-            output += getTagOutput(cfg);                       
-            out.write(TagHelper.script(output));
-        } catch (Exception e) {
-        	try {
+		try {
+			String output = "";
+			if (!isInitialized() && !isInitializedParam()) {
+				out.write(init());
+			}
+			if (globalEvents != null) {
+				output += globalEvents.returnGlobalEvents();
+			}
+			CKEditorConfig cfg = null;
+			if (config != null) {
+				cfg = config.configSettings(this.events);
+			}
+			output += getTagOutput(cfg);
+			out.write(TagHelper.script(output));
+		} catch (Exception e) {
+			try {
 				HttpServletResponse resp = (HttpServletResponse) 
 														pageContext.getResponse();
@@ -69,7 +69,21 @@
 				throw new JspException(e1);
 			}
-        }
-        return EVAL_PAGE;
-	}
+		}
+		return EVAL_PAGE;
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	private boolean isInitializedParam() {
+		if ("initialized".equals(pageContext.getAttribute("ckeditor-initialized"))) {
+			return true; 
+		} else {
+			pageContext.setAttribute("ckeditor-initialized", "initialized");
+			return false;
+		}
+	}
+
 	
 	/**
@@ -87,5 +101,5 @@
 		String out = "";
 		String args = "";
-		String ckeditorPath = basePath;
+		String ckeditorPath = getBasePath();
 		if (timestamp != null) {
 			args += "?t=" + timestamp;
@@ -110,8 +124,13 @@
 
 	/**
-	 * @return the basePath
-	 */
-	public final String getBasePath() {
-		return basePath;
+	 * Checks if basePath contains "/" at the end and adds it if not.	
+	 * @return basePath or basePath with "/" added at the end.	 
+	*/
+	private String getBasePath() {
+		if (basePath.equals("") || basePath.charAt(basePath.length() - 1) != '/') {
+			return basePath.concat("/");
+		} else {
+			return basePath;
+		}
 	}
 
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp	(revision 6790)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp	(revision 6791)
@@ -47,6 +47,5 @@
 				eventHandler.addEvent("instanceReady", "function (ev) { alert(\"Loaded: \" + ev.editor.name); }");
 			%>
-			<ckeditor:editor initialized="false"
-				basePath="../ckeditor/" config="<%=config2 %>"
+			<ckeditor:editor basePath="../ckeditor/" config="<%=config2 %>"
 				 editor="editor1" value="<%= value %>"
 				 events="<%=eventHandler %>"/>
@@ -62,5 +61,5 @@
 			config2.addConfigValue("stylesSet", "[{name : 'Strong Emphasis', element : 'strong'}, {name : 'Emphasis', element : 'em'}, {name : 'Computer Code', element : 'code'}]");
 		%>
-		<ckeditor:replace basePath="../ckeditor/" config="<%=config2 %>" replace="editor2" initialized="true"/>
+		<ckeditor:replace basePath="../ckeditor/" config="<%=config2 %>" replace="editor2" />
 		<input type="submit" value="Submit"/>
 	</form>
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp	(revision 6790)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp	(revision 6791)
@@ -47,8 +47,7 @@
 				settings.addConfigValue("toolbar", "Basic");
 			%>
-			<ckeditor:editor textareaAttributes="<%=attr %>" initialized="false"
+			<ckeditor:editor textareaAttributes="<%=attr %>"
 				basePath="../ckeditor/" config="<%=settings %>"
-				editor="editor1" value="<%= value %>"
-				 />
+				editor="editor1" value="<%= value %>"/>
 			<input type="submit" value="Submit"/>
 		</p>
