Virginia Gov. Robert F. McDonnell on Friday delivered a political homily at a prayer breakfast convened by Ralph Reed’s Faith & Freedom Coalition in association with the nearby Conservative Political Action Conference, urging conservatives to practice the biblical virtues of humility and faith if they hope to win at the ballot box.

McDonnell, a Republican who was snubbed by the CPAC meeting next door at National Harbor, told about 200 attendees that the way to recapture Americans’ votes is to set a good example. Above all, he said, they should follow Jesus’s teaching that the greatest leaders are those who seek to serve, rather than to be served by others.

“It’s been said you have to have a servant’s heart if you want to do anything right in the field of politics,” McDonnell told the group. “We want to be able to attract people to the conservative cause. People don’t know how much you know until they find out how much you care.”

McDonnell also urged conservatives to carry themselves in a way that befits their stated values.

“I think we need to start asking, ‘How are we acting? Are we happy warriors, or are we not?’ ”

McDonnell was not the only popular Republican governor not invited to address CPAC: New Jersey Gov. Chris Christie was also passed over. But McDonnell spoke a day after Virginia Attorney General Ken Cuccinelli II — a fellow Republican who hopes to succeed him — opened the national conference.

The governor, who is spoken about as a potential White House contender in 2016, focused on proverbs more than the political nitty-gritty in his remarks at the prayer breakfast. He said he was sorry conservatives had not chosen Virginia as their meeting place but said he was happy to be in “almost Virginia.”

McDonnell also took a playful jab at Maryland Gov. Martin O’Malley, his Democratic counterpart on the other side of the Potomac River, with an Irish joke. McDonnell said an Irishman named Martin O’Malley was walking through a cemetery when he saw a tombstone with the epitaph saying, “Here lies a politician and an honest man.” O’Malley, he said, wondered, “How the heck did they get two bodies in one place?”

McDonnell received a standing ovation before he spoke. Outside the prayer breakfast, however, other conservatives protested his backing of transportation funding legislation that when fully implemented will raise $1.4 billion a year.

A group representing PublicAd­ passed out slips of paper that resembled bank checks with McDonnell’s face on them. The checks were written out to “special interests” for the sum of $6 billion. Others handed out bumper stickers saying, “Don’t vote for tax hikers.”