An Isle of Wight teenager who purchased a samurai sword from a charity shop to display in his bedroom has been sentenced.