Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Autowired
- private CredentialDao credentialDao;
- @RequestMapping(value = "/fisicHost/{id}/credentials", method = RequestMethod.POST)
- public String deleteCredential(@PathVariable(value = "id") String credId){
- String[] parts = credId.split("-");
- int id = Integer.parseInt(parts[1]);
- Credential c = credentialDao.getCredentialById(id);
- credentialDao.delete(c);
- return "justreturnsomething";
- }
- @Override
- public void delete(Credential credential) {
- Session session = sessionFactory.openSession();
- session.delete(credential);
- session.close();
- }
- $("#credentialsTable").on('click',"button[id^='del-']", (e) => {
- var credentialId = e.target.id;
- console.log('credId' + credentialId);
- $.post( "/fisicHost/" + credentialId + "/credentials", data => {
- console.log(data);
- });
- });
Add Comment
Please, Sign In to add comment