Spring Hibernate : error 400 "the request sent by client was syntactically incorrect"

By sanjay

This is my semester.java class

    @Table(name = "semester")
        @NamedQuery(name = "Semester.findAll", query = "SELECT s FROM Semester s")})
    public class Semester implements Serializable {
        private static final long serialVersionUID = 1L;
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Basic(optional = false)
        @Column(name = "id")
        private Integer id;
        @OneToMany(mappedBy = "semesterid")
        private List<Marks> marksList;
        @JoinColumn(name = "facultyid", referencedColumnName = "facultyid")
        private Faculty facultyid;
        @JoinColumn(name = "semesterid", referencedColumnName = "semesterid")
        private Semestername semesterid;
        @JoinColumn(name = "subjectcode", referencedColumnName = "subjectcode")
        private Subject subjectcode;
        public Semester() {
        public Semester(Integer id) {
            this.id = id;
        public Integer getId() {
            return id;
        public void setId(Integer id) {
            this.id = id;
        public List<Marks> getMarksList() {
            return marksList;
        public void setMarksList(List<Marks> marksList) {
            this.marksList = marksList;
        public Faculty getFacultyid() {
            return facultyid;
        public void setFacultyid(Faculty facultyid) {
            this.facultyid = facultyid;
        public Semestername getSemesterid() {
            return semesterid;
        public void setSemesterid(Semestername semesterid) {
            this.semesterid = semesterid;
        public Subject getSubjectcode() {
            return subjectcode;
        public void setSubjectcode(Subject subjectcode) {
            this.subjectcode = subjectcode;

This is the admin controller

    public class AdminController {
        AdminDao adminDao;
        public String addsemester(Model model){
            model.addAttribute("semesterlist", new Semester());
            return "semesterentry";
        public String _addsemester(@ModelAttribute("semesterlist") Semester semester){
            boolean check = adminDao.insertsemester(semester);
                return "redirect:/addsemester";
            return "dashboard";

This is the admindaoImpl.java class and when i used to insert the semester 400 error with the syntically incorrect was faced.

    public class AdminDaoImpl implements AdminDao {
        SessionFactory sessionFactory;
         public boolean insertsemester(Semester semester){
              boolean check = false;
            try {
            } catch (Exception e) {
                check = true;
            return check;

and when i try to insert the data to database i got 400 error. and i have check all the value of jsp name with database again i got a problem on these.

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273