A Vietnamese court on Friday sentenced a prominent former lawyer to three years in jail over Facebook posts it ruled undermined the state by criticising a leading judge.