Cook rice in boiling salted water according to package instructions. Meanwhile peel the onions, cut off the upper third of each and hollow out the onions with a ball cutter. Cook the hollowed onions in boiling salted water for 5-8 minutes.
Lift out of the water and allow to drain. Finely chop about half of the onion remains, use the remaining onion for other purposes.
Put the beans in a sieve and let them drain. Drain corn in a sieve. Wash and clean the spring onions and cut into fine rings. Heat the oil in a pot and fry the chopped onions in it until transparent.
Add the tomatoes and simmer for about 8-10 minutes. Add beans, corn, spring onions, except for something to sprinkle, and rice and stir in. Season mixture with salt, pepper and chili.
Fill the onions with the bean-rice mixture and place in an ovenproof dish. Pour in the stock and cook in the preheated oven (electric cooker: 200 °C/ convection oven: 175 °C/ gas: see manufacturer) for 10-15 minutes.
Remove from the oven, arrange and sprinkle with the remaining spring onions.