Dreams tend to be derived from what the dreamer is thinking about or feeling while awake, so if the dreamer is dreaming about ex-boyfriends, it's likely that the ex is on the dreamer's mind. These dreams have no specific meaning outside that.
The science of dreams is complicated. There's a lot that researchers have yet to discover and many questions that are unanswered so far. What scientists do know is that vivid dreams with a specific subject tend to have a rational explanation related to current thoughts. According to Schneider and Domhoff from the University of California, Santa Cruz, if a recent high school graduate is having anxious, scary dreams about going to college and moving to the next stage of life, it's a safe bet that this person is preoccupied with, or at least has been thinking about, what her new life will be like.
So, it naturally follows that anyone who is dreaming about a specific person, particularly an ex-boyfriend or ex-girlfriend, is probably thinking about that person while he or she is awake. These thoughts don't have to be terribly involved, and things can happen in dreams that don't necessarily reflect how someone actually feels. The attribution of value or significance to a dream is mostly an individual decision. Scientists have yet to make a definitive, widely accepted rule about interpreting dreams.
People who find themselves dreaming about an ex may understandably be disturbed or bothered by these dreams, especially if the breakup was bad. Waking up from such a dream can feel discouraging and upsetting, but the important thing to remember is that these dreams don't necessarily mean anything more significant than a sign that the subject is on the dreamer's mind.