Index: plugins/workspacesmanager/src/main/java/com/xpn/xwiki/plugin/workspacesmanager/Workspace.java
===================================================================
--- plugins/workspacesmanager/src/main/java/com/xpn/xwiki/plugin/workspacesmanager/Workspace.java	(revision 9165)
+++ plugins/workspacesmanager/src/main/java/com/xpn/xwiki/plugin/workspacesmanager/Workspace.java	(working copy)
@@ -28,6 +28,10 @@
 import com.xpn.xwiki.XWikiException;
 import com.xpn.xwiki.doc.XWikiDocument;
 
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * Workspaces implementation.
  * 
@@ -58,6 +62,10 @@
     public static final String WORKSPACE_DEFAULTACCESSLEVEL = WORKSPACE_ACCESSLEVEL_PRIVATE;
 
     public static final String WORKSPACE_DEFAULTACCESSLEVEL_USER = WORKSPACE_ACCESSLEVEL_PRIVATE;
+	
+	public static final String VALIDATION_TITLE_SHORT = "title-short";
+    public static final String VALIDATION_TITLE_LONG = "title-long";
+    public static final String VALIDATION_TITLE_EXISTS = "title-exists";
 
     public static final String[] WORKSPACE_COLOR_VALUES =
         {"555555", "0000FF", "003399", "009900", "009933", "660033", "663300", "990000",
@@ -109,5 +117,38 @@
             return WORKSPACE_COLOR_DEFAULT;
         return color;
     }
+	
+	public boolean validateSpaceData() throws SpaceManagerException{
+		boolean success = true;
+		Map errors = new HashMap();
+	
+		try {         
+            success &= doc.validate(context);
+            
+            //title
+            String title = this.getDisplayTitle();
+            if(title.length() < 1)	errors.put( this.VALIDATION_TITLE_SHORT, "1" );
+            if(title.length() > 50) errors.put( this.VALIDATION_TITLE_LONG, "1" );
 
+            //same title
+            List list = context.getWiki().getStore().searchDocumentsNames(",BaseObject as obj, StringProperty as tprop where doc.fullName=obj.name and obj.className='"
+                                    + manager.getSpaceClassName() + "' and obj.id=tprop.id.id and tprop.id.name='"
+                                    + SPACE_DISPLAYTITLE + "' and tprop.value='" + this.getDisplayTitle().replaceAll("'","''") + "' and doc.web<>'" + getSpaceName() + "'", context);
+            
+			if(list!=null && list.size()>0) errors.put( this.VALIDATION_TITLE_EXISTS, "1" );
+            
+            if(errors.size()>0)
+            {
+            	context.put("validation", errors);
+            	success &= false;
+            }
+            
+        } catch (XWikiException e) {
+        	success &= false;
+            throw new SpaceManagerException(e);
+        }
+        
+        return success;
+	}
+
 }
Index: wiki/src/main/resources/XWSCode/CreateNewWorkspace
===================================================================
--- wiki/src/main/resources/XWSCode/CreateNewWorkspace	(revision 9165)
+++ wiki/src/main/resources/XWSCode/CreateNewWorkspace	(working copy)
@@ -13,8 +13,8 @@
 <contentAuthor>XWiki.Admin</contentAuthor>
 <creationDate>1201555509000</creationDate>
 <date>1207862127000</date>
-<contentUpdateDate>1207862127000</contentUpdateDate>
-<version>3.1</version>
+<contentUpdateDate>1208260338000</contentUpdateDate>
+<version>7.1</version>
 <title>CreateNewWorkspace</title>
 <template></template>
 <defaultTemplate></defaultTemplate>
@@ -60,8 +60,20 @@
 #set($ok = $sm.updateSpaceFromRequest($newspace))
 
 #if($request.method=="POST")	
+  #if($context.validation) ##{
+    #if($context.validation.get("title-short"))
+      #error($msg.get("xws.createworkspace.validation.short"))
+    #end
+    #if($context.validation.get("title-long"))
+      #error($msg.get("xws.createworkspace.validation.long"))
+    #end
+    #if($context.validation.get("title-exists"))
+      #error($msg.get("xws.creataworkspace.validation.exists"))
+    #end
+  #else
+
   #set($newspace = $sm.createSpaceFromRequest("XWS_SpaceTemplate"))
-  #if($newspace)
+  #if($newspace) ##{
     ## Space creation succeed, yeehee !
     ## display a nice message ...
      #set($args = $xwiki.arrayList)
@@ -78,7 +90,9 @@
      $newspace.set("color","0000FF")
   #else
     #error("$msg.get('xws.createworkspace.spacecreationfailed')")
-  #end
+  #end ##}end if not new space
+
+  #end ##}end if no errors
 #end
 
 &lt;form action="" method="post"&gt;
Index: wiki/src/main/resources/XWSCode/Translations
===================================================================
--- wiki/src/main/resources/XWSCode/Translations	(revision 9165)
+++ wiki/src/main/resources/XWSCode/Translations	(working copy)
@@ -144,6 +144,9 @@
 xws.createworkspace.spacecolor=Color
 xws.createworkspace.spacecreated=The space &lt;a href="{0}"&gt;{1}&lt;/a&gt; has been successfully created.
 xws.createworkspace.spacecreationfailed=An error occured while creating the space.
+xws.createworkspace.validation.short=The title can't be empty
+xws.createworkspace.validation.long=The title can't be longer than 50 characters
+xws.creataworkspace.validation.exists=A workspace with this title already exists
 
 xws.createmyspace.success=Your space has been created with success
 xws.createmyspace.error=An error occured while creating your space
