We study viscosity solutions of Hamilton-Jacobi equations that arise in optimal control problems with unbounded controls and discontinuous Lagrangian. In our assumptions, the comparison principle will not hold, in general. We prove optimality principles that extend the scope of the results of [23] under very general assumptions, allowing unbounded controls. In particular, our results apply to calculus of variations problems under Tonelli type coercivity conditions. Optimality principles can be applied to obtain necessary and sufficient conditions for uniqueness in boundary value problems, and to characterize minimal and maximal solutions when uniqueness fails. We give examples of applications of our results in this direction