When the Defendant is able to show that a case is without merit or has no legal basis, the court can "Dismiss With Prejudice", meaning that it cannot be refiled.
However, if the case has some fundamental flaw (incorrect service, improper legal basis, etc.) the court can 'Dismiss Without Prejudice" which will allow the Plaintiff to correct the errors and refile the case.