
63 Cal.2d 481 (1965)
407 P.2d 1
47 Cal. Rptr. 201
MARJORIE E. GOODWINE, Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; DON F. GOODWINE, Real Party in Interest.
Docket No. L.A. 28464.
Supreme Court of California. In Bank.
November 4, 1965.
*482 Richard M. Moore and Cooper & Nelsen for Petitioner.
Harold W. Kennedy, County Counsel, and William F. Stewart, Deputy County Counsel, for Respondent.
Newman & Newman and Nathan Newby, Jr., for Real Party in Interest.
TRAYNOR, C.J.
On October 8, 1964, plaintiff, Marjorie E. Goodwine, began an action for separate maintenance against her husband, Don F. Goodwine. A writ of attachment was levied upon defendant's real property in the County of Los Angeles, giving the trial court quasi-in-rem jurisdiction. (Baldwin v. Baldwin, 28 Cal.2d 406, 415 [170 P.2d 670]; Nichols v. Superior Court, 1 Cal.2d 589, 599 [36 P.2d 380, 95 A.L.R. 894]; Murray v. Murray, 115 Cal. 266, 275 [47 P. 37, 56 Am.St.Rep. 97, 37 L.R.A. 626].) Plaintiff secured an order for service by publication based on an affidavit that defendant resided out of the state (see Code Civ. Proc., § 412), and defendant was personally served in Mexico (see Code Civ. Proc., § 413). Defendant moved to quash the writ of attachment, the service of summons and complaint, and to dismiss the action, on the ground that the trial court was without jurisdiction. The trial court granted defendant's motion and dismissed the action, staying its order pending appellate review. Plaintiff then filed this petition for a writ of mandate to compel the trial court to vacate its order dismissing the action.
*483 Plaintiff and defendant were married in Reno, Nevada, on April 1, 1955. They lived in California until March 1963, when they moved to Mexico to live in retirement. Defendant obtained a resident's visa and became a domiciliary of Mexico. Plaintiff obtained a tourist visa because of local regulations, but she also intended to become a permanent resident of Mexico. On September 3, 1964, plaintiff left defendant and went to Los Angeles to reside with her sister, allegedly because he treated plaintiff with extreme cruelty. Plaintiff then brought the action for separate maintenance, seeking support of $1,000 per month, attorney's fees, and costs out of defendant's property within the state.
Defendant contends that the trial court has no jurisdiction in an action for separate maintenance when neither party is domiciled in the state. There is no merit in this contention. In an action for divorce, domicile is dispositive, since "the domicile of one spouse within a State gives power to that State ... to dissolve a marriage wheresoever contracted." (Williams v. North Carolina II, 325 U.S. 226, 229-230 [65 S.Ct. 1092, 89 L.Ed. 1577, 157 A.L.R. 1366].) The state in which one spouse is domiciled is deemed to have sufficient interest to terminate the marriage. Thus, a state has the power to grant an ex parte divorce to a domiciliary wife without personal jurisdiction over the husband or quasi-in-rem jurisdiction over his property. (Williams v. North Carolina I, 317 U.S. 287, 303 [63 S.Ct. 207, 87 L.Ed. 279, 143 A.L.R. 1273].) [1] In an action for separate maintenance, however, domicile is neither sufficient nor necessary for jurisdiction. An action for separate maintenance is essentially an action for support (1 Witkin, Cal. Procedure (1954) Jurisdiction, § 110, p. 375), seeking a money judgment against the defendant. Jurisdiction does not depend on domicile but on acquiring personal jurisdiction over the husband or quasi-in-rem jurisdiction over his property. (Vanderbilt v. Vanderbilt, 354 U.S. 416, 418 [77 S.Ct. 1360, 1 L.Ed.2d 1456]; Baldwin v. Baldwin, 28 Cal.2d 406, 415 [170 P.2d 670]; 1 Witkin, Cal. Procedure (1954) Jurisdiction, § 110, pp. 375-376; see Code Civ. Proc., § 537.) [2] Once quasi-in-rem jurisdiction is established, the court can award a money judgment to the extent of the defendant's interest in the property attached. (Baldwin v. Baldwin, supra, 28 Cal.2d 406, 415.) [3] The residence requirements applicable to the plaintiff in divorce actions (Civ. Code, § 128) are inapplicable in actions for separate maintenance. (Hiner v. Hiner, 153 Cal. 254, 260 [94 *484 P. 1044].) Exercising jurisdiction in these cases does not encourage forum-shopping, since the court will not necessarily apply the substantive law of the forum under the applicable conflict of laws rules. (See Bernkrant v. Fowler, 55 Cal.2d 588, 596 [12 Cal. Rptr. 266, 360 P.2d 906].)
[4] Plaintiff contends that since defendant moved to dismiss the action, he made a general appearance giving the trial court personal jurisdiction over him, rather than quasi-in-rem jurisdiction. We agree with plaintiff that defendant made a motion to dismiss. Even though the request for dismissal is found only in the title of defendant's motion, the motion rests on a theory that the court lacked subject-matter jurisdiction when neither party was domiciled in the state. Defendant thus challenged the subject-matter jurisdiction of the court, as well as its personal jurisdiction over him. We disagree with plaintiff, however, that a motion to dismiss for lack of subject-matter jurisdiction is a general appearance. "`[W]here the defendant appears and asks some relief which can only be granted on the hypothesis that the court has jurisdiction of cause and person, it is a submission to the jurisdiction of the court as completely as if he had been regularly served with process, whether such an appearance by its terms be limited to a special appearance or not.'" (Security Loan & Trust Co. v. Boston & S.R. Fruit Co., 126 Cal. 418, 422 [58 P. 941, 59 P. 296]; In re Clarke, 125 Cal. 388, 392 [58 P. 22]; see 1 Witkin, Cal. Procedure (1954) Jurisdiction, § 72, p. 342.) An answer, a demurrer, and a motion to strike constitute a general appearance (Code Civ. Proc., § 1014), since a court does not decide questions raised by such pleadings at the behest of persons over whom it has no jurisdiction. A court need not have jurisdiction over the person, however, to dismiss for lack of subject-matter jurisdiction. Indeed, the court must dismiss on that ground on its own motion. (Morris v. Gilmer, 129 U.S. 315, 326-327 [9 S.Ct. 289, 32 L.Ed. 690]; Abelleira v. District Court of Appeal, 17 Cal.2d 280, 302-303 [109 P.2d 942, 132 A.L.R. 715].) Thus, a challenge to the subject-matter jurisdiction of the court is not inconsistent with a challenge to personal jurisdiction. Moreover, since the court must dismiss on its own motion, an appropriate challenge to subject-matter jurisdiction aids the court in performing its duty. The defendant should therefore be allowed to point out lack of subject-matter jurisdiction without making a general appearance. Judson v. Superior Court, 21 Cal.2d 11 [129 P.2d 361], is to the contrary, but it has often been criticized *485 (see 31 Cal.L.Rev. 342; 1 Witkin, Cal. Procedure (1954), § 76, p. 346) and is overruled.
Defendant contends that even if the trial court has quasi-in-rem jurisdiction, it properly refused to exercise it under the doctrine of forum non conveniens. The trial court, however, has not yet considered whether the doctrine of forum non conveniens applies to this case, since it treated defendant's motion as being "for the sole purpose of objecting to the court's jurisdiction." Since the court has jurisdiction of the subject matter, it can now consider the applicability of that doctrine, which is accepted in this jurisdiction (Price v. Atchison, T. & S.F. Ry. Co., 42 Cal.2d 577, 583 [268 P.2d 457, 43 A.L.R.2d 756]) and applies to actions for support (Wilburn v. Wilburn, (D.C.) 192 A.2d 797, 800; Melvin v. Melvin, 129 F.2d 39, 40 [76 App.D.C. 56]). [5] In determining the applicability of the doctrine, the court must consider the public interest as well as the private interests of the litigants. The court must consider such factors as the ease of access of proof, the availability and cost of obtaining witnesses, the possibility of harassment of the defendant in litigating in an inconvenient forum, the enforceability of the judgment, the burden on the community in litigating matters not of local concern, and the desirability of litigating local matters in local courts. [6] "`[U]nless the balance is strongly in favor of the defendant, the plaintiff's choice of forum should rarely be disturbed.'" (Price v. Atchison, T. & S.F. Ry. Co., supra, 42 Cal.2d 577, 585.) The trial court must in the first instance consider these factors in determining whether to apply the doctrine. Thus plaintiff alleges mistreatment throughout the marriage, both in California and in Mexico, and the trial court must ascertain the location of witnesses and other sources of proof. Moreover, the trial court must consider plaintiff's contention that she is domiciled in California. The trial court originally relied on defendant's affidavit that plaintiff was domiciled in Mexico, on the failure of plaintiff to file a counteraffidavit, on the ambiguity of plaintiff's allegation of residence in her complaint, and on points and authorities submitted by the parties in deciding plaintiff was not a California domiciliary. On remand, plaintiff can submit further evidence of her domicile in this state. [7] A determination that a plaintiff is domiciled here would ordinarily preclude granting the defendant's motion for dismissal on the ground of forum non conveniens. (See Barrett, *486 The Doctrine of Forum Non Conveniens, 35 Cal.L.Rev. 380, 413-415.)
Let the peremptory writ issue as prayed.
McComb, J., Peters, J., Tobriner, J., Peek, J., Mosk, J., and Burke, J., concurred.
