This paper is concerned with Sobolev weak solution of Hamilton-Jacobi-Bellman (HJB) equation. This equation is derived from the dynamic programming principle in the study of the stochastic optimal control problem. Adopting Doob-Meyer decomposition theorem as one of main tool, we prove that the optimal value function is the unique Sobolev weak solution of the corresponding HJB equation. For the recursive optimal control problem, cost function is described by the solution of backward stochastic differential equation (BSDE). This has practical background in economics and finance. We also prove that the value function is the unique Sobolev weak solution of the related HJB equation by virtue of the nonlinear Doob-Meyer decomposition theorem introduced in the BSDE theory.