In this paper, we establish the global existence of weak solutions to the initial-boundary value and initial value problems for two classes of nonlinear wave equations which are the Euler-Lagrange equation of a variational principle. We use the method of energy-dependent coordinates to rewrite these equations as semilinear systems and resolve all singularities by introducing a new set of dependent and independent variables. The global weak solutions can be constructed by expressing the solutions of these semilinear systems in terms of the original variables.