In the fourth book of A Series of Unfortunate Events, the character Phil is a clear Pollyanna. He remains quite upbeat for a guy who is working in a lumbermill, is paid with coupons, and has gum for lunch every day. When his leg is crushed, he says, "Well, this isn't too bad. My left leg is broken, but at least I'm right-legged." Somebody comments, "Gee, I thought he'd say something more along the lines of 'Aaaaah! My leg! My leg!'" When he shows up in the 9th book and the Baudelairs accidentally cause a spill in the submarine, they expect him to say, "oh nice, we have a swimming pool now!"
In the novel A Walk to Remember, Jamie Sullivan fits this Trope throughout much of the book. She is a devoutly religious girl who is always optimistic because she assumes any and every perceivably negative circumstance, from Pop Quizzes to the disease that's killing her must be in the Lord's plan. She later shows sorrow for her impending death, but she gets major Pollyanna points for holding it together so long, and even after her initial display of sorrow she thereafter returns to handling the circumstances relatively gracefully.
Job for a while. Then what had happened to him took its toll on him, leaving him gloomy. He resumed his former disposition after God's speech humbled him.
Most definitely Paul and Silas, as revealed in Philippian prison by their praise toward God soon after being beaten.
For that matter, Jesus. He leaves his glorious position in Heaven to take on the body of a lowly human with extremely humble beginnings, being "born" in a stable. He spends his early years hiding out in Egypt because the king at the time wants to kill him. Most of his brief adult life is spent as a homeless wanderer, often mocked and rejected for his teachings, deserted by most of his followers, then dying in a very painful and humiliating way for crimes he didn't even commit. Through it all, he hardly shows any discouragement, even forgiving the very people who want to kill him. Of course, already knowing the end of the story probably helped out a lot...
The book of James is often considered a tough-love, pull-no-punches lecture on various life lessons. Its first topic? "My brethren, count it all joy when you fall into various trials, knowing that the testing of your faith produces patience. But let patience have its perfect work, that you may be perfect and complete, lacking nothing."
Dr. Pangloss and Candide in Voltaire's Candide undergo some horrendous maltreatment at the hands of nearly everyone, every power, and even the forces of nature during their adventure. Still the good doctor not only remains optimistic, he even justifies the incredible tragedy they face. A nuance between Candide and Polyanna is that Candide's optimism is naive whereas Polyanna's is informed. Candide is the trope namer for boundless naive optimism in French.
Robin and Joey in the Chalet School series are a mixture of this and Plucky Girl. Both are susceptible to nasty illnesses, have lost parents and other loved ones, and are forced to flee from the Nazis for their own safety, but both of them manage to stay relatively cheerful throughout.
A major theme throughout Colas Breugnon is the (male) protagonist's unwavering merriness; even if temporarily shaken by personal disaster, the old man remains a jolly optimist throughout the entire plot.
Discworld: Twoflower, during his time as a tourist, despite Rincewind's best efforts to convince him that The Fair Folk aren't cute, Bar Brawls featuring barbarian heroes aren't fun, and rundown hovels aren't picturesque. Even being locked in a dungeon doesn't get him too down. He does get quite annoyed at the end of Interesting Times, though.
Luna Lovegood from Harry Potter. But she often drops hints of what she's really feeling in a serene manner.
Jill Mariner, impulsive heroine of P. G. Wodehouse's Jill the Reckless (alternatively titled The Little Warrior with reference to her manner of handling life). Her Uncle Chris also qualifies; at one point she quotes Candide, comparing him to Pangloss.
Sally in The Adventures of Sally is a similar sort of character, cheerful, optimistic and good-hearted. Still, both girls also have a touch of clear-eyed cynicism about them.
This trope is a Flanderization; the original Pollyanna is The Woobie if not her novel's Butt-Monkey, and she has plenty of sad moments when she's alone, but she refuses to let them affect her behaviour when other people are present. She comes off as a Stepford Smiler at points in the book, clinging to her father's Glad Game to take her thoughts off the bad things that have happened to her like losing her father and becoming crippled after an accident.
Joe Ben "Joby" Stamper in Sometimes A Great Notion becomes one of these after becoming a born-again Christian. He always finds the good in every situation in spite of all the increasingly terrible things that happen to the Stamper family for breaking the lumber strike, insisiting that things will turn out okay and that they're "in God's pocket". He retains this cheerful attitude even when he's trapped under a massive log in the river, insisting that the rising water will float the log off him. It doesn't. He drowns.
The Jack Polo of Clive Barker's short story The Yattering and Jack is like this because if he displays any negative emotions regardless of what happens to him, he will face eternal damnation. Meanwhile, if the minor demon tormenting him directly attacks him without provocation (rather than merely indirectly torturing him), it's broken the rules that govern it and has to be his servant for the remainder of his life as penalty. This is actually Jack's goal in the entire exercise, although the Yattering discovers this far too late to avoid it.
Felicité in Gustave Flaubert's Un Coeur Simple is the perfect picture of the Pollyanna. Friends and relatives die around her right and left and she still puts on a happy face. She drops everything to help anyone who needs it.
Frances from Wuthering Heights though Nelly could be embellishing the story a little. It's mentioned that she never lost her sunny attitude even when she was dying from childbirth.
A rare male example is Felix Young from The Europeans, whose incessantly sunny disposition never wavers even in the face of his relative poverty, family misfortunes, and the strict, disapproving Puritanism of his American relatives.
Elin from Of Fear and Faith is this. She's still all smiles and giggles even moments after almost being sacrificed by a crazy, demon worshipping cult. And while she does appear to have some Stepford Smiler qualities, it's clear that she is a very sincerely joyful and caring person.
Delly Cartwright in The Hunger Games. Peeta is a pretty good example too, until he is hijacked.
Even with an abusive stepdad and having to live in a Bed and Breakfast hotel, Elsa in The Bed and Breakfast Star tries to keep everyone happy by telling constant jokes to everyone.
Beesong Chronicles: Joy is first encountered singing a song she made up about being a bee, after three days of being stuck alone on a flower with nothing to do (which she describes as the worst thing she can think of). Cora comes up with the name Joy for her because, well, what else are you supposed to name someone like that?
RWBY: Fairy Tales of Remnant: In The Warrior in the Woods, the hero can't understand why the Warrior is willing to protect people after learning that humans destroyed her family and left her alone with nothing. She tells him that she protects people because she can, and she's the only one who will. She also states that some people are good and that gives her hope.