public String deletesavedPosting() throws IOException{
	
		String resource = "orm/configuration.xml";
		Reader reader = Resources.getResourceAsReader(resource);
		SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(reader);
		SqlSession session = sessionFactory.openSession();
		try{
			savedwholeapt aa=new savedwholeapt();
			/*delete saved posting by user's email and postingID*/	
			System.out.println("Id in deletedsaved Posting:"+Id);
			int res;
			res=JOptionPane.showConfirmDialog(null,"Are you sure you want to post this message?",
					"Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
			if(res==JOptionPane.YES_OPTION){
				aa.setPostingID(Id);
				aa.setUserID((String) ActionContext.getContext().getSession().get("email"));
				
				if(type.equals("whole")){
					session.delete("deletesavedpostingofwholeapt",aa);
				}else if(type.equals("share")){
					session.delete("deletesavedpostingofsharedapt",aa);
				}else{
					session.delete("deletesavedpostingofsubleaseapt",aa);	
				}
				session.commit();	
	    		JOptionPane.showMessageDialog(null,"Deleted Successfully!","Message",JOptionPane.INFORMATION_MESSAGE);

			}else{
				return "nodelete";
			}
			
		}finally{
			
			session.close();
		}
		return "deleteok";
		
		
		
	}