Let's suppose we have a Hamiltonian $H(p_k, q_k)$ and we want to transform it via a canonical transformation to one Hamiltonian which doesn't depend on the new coordinates $w_k$, but only in the momenta, $\bar{H}(J_k)$
Such coordinates are called action-angle variables. One (or the only one?) way to find the new coordinates is define $J_l$ as:
$$J_l = \int^{T_l}_0 p_l dq_l$$
Why are this $J_l$ the momenta that make the Hamiltonian doesn't depend on $\bar{q}_k$?
I think it has something to do with the type 1 generating function (in one dimension, $S(q, \bar{q})$), since:
$$dS = \frac{\partial S}{\partial q}dq + \frac{\partial S}{\partial q}dq = pdq - Jdw$$ And then integrating in a period of motion:
$$\oint dS = \oint pdq - J\oint dw$$
$\oint dw$ is defined to be 1, and S is basically the action and thus should be 0 in one period, so that we could deduce the $J$ equation from here. Am I right?