Bring 2 quarts water and 2 teaspoons salt to a boil in a large saucepan. Add beans; cook for 2 to 3 minutes or until crisp-tender. Drain.
Melt butter in pan over medium heat. Add garlic and shallots; cook 4 minutes or until lightly browned, stirring occasionally. Add remaining 1/2 teaspoon salt, beans, rosemary, and pepper; cook 4 minutes or until thoroughly heated, stirring occasionally.