NEWARK, N.J. — It was a potentially significant piece of evidence early in the bribery trial of U.S. Sen. Bob Menendez: an email sent by a staffer expressing dismay at Menendez’s efforts to secure a visa for the reputed girlfriend of a wealthy campaign donor.

Jurors never heard it, nor did they hear other testimony including whether Menendez could or couldn’t have afforded a luxury hotel room in Paris that ultimately was paid for by the donor, or whether an FBI agent investigating Menendez in 2013 was questioned about anonymous leaks to reporters.

While climactic scenes of witnesses breaking down under cross-examination remain a staple of television dramas, criminal trials can be won or lost based on what happens outside the presence of the jury, when lawyers do battle over what evidence they can present.

That has been the case at the trial of Menendez and the donor, Florida ophthalmologist Salomon Melgen, where U.S. District Judge William Walls has demonstrated a propensity for lecturing attorneys on Rule 401, which provides guidelines for what evidence is considered relevant in a trial. Some of the discussions have become contentious.

“The biggest challenge for any trial lawyer is trying to frame the evidence that’s going to be admissible and get it in front of the jury,” said Christopher Adams, a defense attorney whose clients have included former NBA star Jayson Williams. “Most times you have to find alternative ways to make evidence admissible that, on its face, may not be admissible.”

Menendez, a Democrat, has pleaded not guilty and denies any wrongdoing.

Walls and the lawyers sparred on these issues:


THE EMAIL

Prosecutors are trying to show Menendez, in exchange for trips on Melgen’s private plane and luxury vacations, used his influence to help three of Melgen’s alleged foreign girlfriends get U.S. visas.

They sought to have jurors see Mark Lopes’ email to another staffer in which Lopes wrote that his boss “doesn’t need to be calling U.S. ambassadors about stuff like this” and that Menendez’s effort “really degrades his reputation through the ambassador ranks.”

Rejecting prosecutors’ arguments, Walls barred it because he considered it unfairly prejudicial, though he called it “quite a relevant statement if the government could figure out how to get it in.”


THE LEAKS

Walls allowed attorney Abbe Lowell, representing Menendez, to ask the trial’s first witness, FBI agent Jane Ruch, whether she was a source of anonymous leaks to reporters about the investigation. But when Lowell attempted to ask similar questions to a second FBI agent to probe for any evidence of bias, Walls barred him and termed the questioning “speculative and irrelevant.”

The ensuing dispute took up 10 pages of the trial transcript and led to a testy exchange between the two men.


THE HOTEL ROOM

Prosecutors wanted to show Menendez turned to his wealthy friend to pay for a $1,500-per-night Paris hotel in 2010 because he was unable to afford it. They also appeared to imply that Menendez chose the hotel because a female friend was staying there. Walls rejected both lines of questioning.

“If the prosecution is pushing the envelope, making it more salacious, then they’ve opened the door for the defense to counter that and bring in stuff they wouldn’t have been able to otherwise,” Adams said.

Defense attorneys sought to introduce evidence of other hotel expenses Menendez paid, to show he could have afforded the Paris hotel. But Walls denied that, too.


THE VISAS

In the 2015 indictment and in their opening statement at the trial, prosecutors portrayed three women — from Spain, Brazil and the Dominican Republic — as girlfriends of the married doctor.

Before the first day of testimony had concluded, Walls warned attorneys he was “not going to let this be a tabloid trial.” When two of the women testified a few days later, they weren’t asked about their specific relationship with Melgen.

The government’s focus on Menendez’s request to Lopes, his staffer, to call an ambassador in 2008 about one of the visa applications opened the door for the defense to bring up a different 2008 case, not charged in the indictment, to show it wasn’t unusual for Menendez to contact an ambassador.

“The jury has a right to consider whether what the Senator did under similar circumstances more or less contemporaneously to the alleged offense, is just commonplace,” Walls said.