Datatables URL reference displays No Message available.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Datatables URL reference displays No Message available.

chinnuadupam@gmail.com
Hi,

I am currently working on SPRING BOOT application. Server-Side using JSP.

Now that datatables created perfectly, but I also have a link to edit and add entity to the database.

So href to those links on to edit and delete, but my reference doesn't seem to render those views.

<div class="container-fluid">
    <div class="container xd-container">
       

Employees

<%--         <c:forEach var="employee" items="${listemp}"> --%>
            <datatables:table id="employee" data="${listemp}" row="employee" jqueryUI="true" theme="bootstrap3" cssClass="table table-striped" info="false">
            <datatables:column title="Employee No.">
             <c:out value="${employee.empNo}"/>
            </datatables:column>
            <datatables:column title="First Name">
             <c:out value="${employee.firstName}"/>
            </datatables:column>
            <datatables:column title="Last Name">
             <c:out value="${employee.lastName}"/>
            </datatables:column>
            <datatables:column title="Gender">
             <c:out value="${employee.gender}"/>
            </datatables:column>
            <datatables:column title="Birth Date" cssStyle="width: 200px;">
             <c:out value="${employee.birthDate}"/>
            </datatables:column>
            <datatables:column title="Hire Date" cssStyle="width: 200px;">
             <c:out value="${employee.hireDate}"/>
            </datatables:column>
            <datatables:column title="Edit" display="html" cssClass="btn">
            <spring:url value="/welcome/employees/edit/${employee.empNo}" var="editUrl"></spring:url>
            <a href="${editUrl}" class="btn btn-warning"> Edit
            </datatables:column>
        </datatables:table>
 </div>
 </div>
 
when I click on edit it gives white labled error no message available.

I am sure it works, it actually worked when the application is entirely with spring boot and jsp. Now that Only above .jsp is in dandelion format and other jsp's in just normal forms.Doesn't url for normal jsp's work with datatables?


Edit.jsp


Edit Employee

<form method="POST" action="/welcome/employees/update" modelAttribute="employee" commandName="employee">
<%--     <input type="hidden" name="empNo" value="${employee.empNo}"> --%>
                                                                                                               
Employee No.<input type="text" name="empNo"  value="${employee.empNo}">
First Name<input type="text" name="firstName"  value="${employee.firstName}">
Last Name<input type="text" name="lastName"  value="${employee.lastName}">
Gender<select type="text" name="gender" value="${employee.gender}">
                  <option value="">Select Gender</option>
                  <option value="M">Male</option>
                  <option value="F">Female</option>
         </select>
       
Birth Date<input name="birthDate" type=date value="${employee.birthDate}">
Hire Date<input name="hireDate" type=date value="${employee.hireDate}">
<input type="submit" value="Update Employee" class="btn btn-success">
</form>

why doesn't it work with these normal jsp's?? or Am i missing something??


@RequestMapping(value = "/employees", method = RequestMethod.GET)
    public ModelAndView getEmployeesList(){
    List<Employee> results = this.employeeService.findEmployees();
        ModelAndView model1 = new ModelAndView("/employees/list");
        model1.addObject("listemp", results);
        return model1;
    }
   
-----------------------Edit-------------------------------------------------------------------------

 @RequestMapping(value = "/employees/edit/{empNo}", method = RequestMethod.GET)
    public String editForm(@PathVariable("empNo") long empNo, Model model){
    Employee employee=this.employeeService.findEmployeeById(empNo);
        model.addAttribute(employee);
        return "employees/edit";
    }

    @RequestMapping(value = "/employees/update",method = RequestMethod.POST)
    public String processUpdate(@Valid @ModelAttribute("employee")Employee employee,
       BindingResult result, ModelMap model){
    if(result.hasErrors()) {
            return "employees/edit";
    }
        this.employeeService.saveEmployee(employee);
        return "redirect:/welcome/employees";
    }

Please advise
 

Loading...