Can I cast spells that require a material component and still hold my hammer and shield?

I have a human cleric (war domain) with the War Caster feat. She holds a warhammer and a shield. Am I able to cast spells that require a material component and still hold my hammer and shield?

If not, then what are my options for casting a spell that requires material components? Do I drop the shield or warhammer? Does it cost a free action, move action, etc.?