We propose a novel approach for solving the optimal feedback control problem. Following our previous researches, we construct a Hamiltonian system by using the necessary conditions for optimality, and treat the resultant phase flow as a canonical transformation. Then starting from the Hamilton-Jacobi equations for generating functions we derive a set of 1st order quasilinear partial differential equations with the relevant terminal conditions, which forms the well-known Cauchy problem. These equations can also be obtained by applying the invariant imbedding technique to the two point boundary value problem. The solution to this Cauchy problem is utilized for solving the optimal feedback control problem with hard and soft constraint boundary conditions. As suggested by the illustrative examples, this method is promising for solving problems with control constraints, non-smooth control logic, and nonanalytic cost function.