Preheat oven to 350. Prepare a 9" square pan with cooking spray; set aside. In a mixing bowl, combine cooked spaghetti, eggs, and parmesan cheese. Place into prepared pan; pressing evenly over bottom and up sides to form a crust; set aside. In a large skillet, cook chicken and onions until chicken is no longer pink. Add spaghetti sauce, corn, and salt. Mix well. Spoon mixture evenly over spaghetti crust. Sprinkle with cheese. Bake for 30 minutes, or until heated through. Let stand five minutes before serving.