  The purpose of this paper is to study in detail the constraint structure of
the Hamiltonian and symplectic-Lagrangian descriptions for the scalar and
electromagnetic fields in the presence of spatial boundaries. We carefully
discuss the implementation of the geometric constraint algorithm of Gotay,
Nester and Hinds with special emphasis on the relevant functional analytic
aspects of the problem. This is an important step towards the rigorous
understanding of general field theories in the presence of boundaries, very
especially when these fail to be regular. The geometric approach developed in
the paper is also useful with regard to the interpretation of the physical
degrees of freedom and the nature of the constraints when both gauge symmetries
and boundaries are present.
