Col. John J. Cook III, head chaplain at West Point, said, “No one is pushing them to believe.”

Referring to prayers at mandatory settings, he said: “This is something we have done in the military for centuries. It is not designed to make people religious. The majority of people here are people of faith, and a prayer asks God’s blessing on a gathering and on the food.”

The Air Force, however, took a different view in the guidelines it adopted in 2005. For example, the guidelines say: “Supervisors, commanders and leaders at every level bear a special responsibility to ensure their words and actions cannot reasonably be construed as either official endorsement or disapproval of the decisions of individuals to hold particular religious beliefs or to hold no religious beliefs.”

Since the Air Force investigation, controversies over religion in the military have continued. Last year, the Army inspector general issued a report critical of seven officers, including four generals, who appeared, in uniform and in violation of military regulations, in a 2006 fund-raising video for the Christian Embassy, an evangelical Bible study group. General Caslen was among the officers.

The cadets and midshipmen do not claim practices at West Point and the Naval Academy are as egregious as those at the Air Force Academy, which were found to include expressions of anti-Semitism, official sponsorship of a showing of “The Passion of the Christ” and a locker room banner that said athletes played for “Team Jesus.” But given the vast authority superiors have over subordinates in the military, prayer and repeated mention of God in mandatory settings can communicate a requirement to be religious, military and legal experts said.

“You always have to be aware of the authority you have within your rank and uniform and the coercive potential of that authority,” said Robert Tuttle, a constitutional law expert and professor at George Washington University Law School whose father is a retired four-star Army general

At the Naval Academy, midshipmen have contacted the A.C.L.U. over the years, questioning the constitutionality of the noon meal prayer, especially after the 2004 court ruling, said Debbie Jeon, legal director of the group’s Maryland organization.

No midshipmen have wanted to take action until now, Ms. Jeon said. Three recent graduates, who spoke on condition of anonymity for fear of retaliation, said that all 4,300 midshipmen enter the noon meal together and that before they eat they are invited to pray by a chaplain. The academy’s eight chaplains are all officers, and all but one are Christian. Those midshipmen who do not bow their heads with their hands clasped in front are conspicuous, they said, which makes some, especially underclassmen, feel very uncomfortable.