Let $\Omega \subset \er^N$ be a bounded open set and let $g\fcolon \Omega\times\er\to\er$ be a Carathéodory function that satisfies standard growth conditions. Then the functional $\Phi(u)=\int_{\Omega} g\bigl(x,u(x)\bigr) \d x$ is weakly continuous on $W^{1,p}_0(\Omega)$, $1\leq p \leq \infty$, if and only if $g$ is linear in the second variable.