org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "ServiceAmc.id" (results:30)

Sumeet

This is my SerCorAmc.html file in which i have one button After clicking on button showResult() method will call it will call the controller that contains url like acquireServiceCorporateAmcFormDetailsAMC.

            <!DOCTYPE html>
            <html xmlns="http://www.w3.org/1999/xhtml"
                xmlns:th="http://www.thymeleaf.org" lang="en">
                <head>
                    <title>ServiceCorporateAmcForm</title>
                    <meta charset="UTF-8"/>
                    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
                      <script type="text/javascript"
                src="http://code.jquery.com/jquery.min.js"></script>
                </head>
                <body>
        <div>
                <button onclick="showResult()">ServiceCorporateAmc</button>
                    </div>
                <div id="show"></div>
                <script type="text/javascript">
                    function showResult(){
                        $("#show").load("acquireServiceCorporateAmcFormDetailsAMC");
                    }

                </script>

                </body>
            </html>

            This is my Controller, In which list will pass to the results.html
            package com.control;

            import com.model.service.ServiceCorporateAmc;
            import com.repo.ServiceCorporateAmcRepo;
            import java.util.Iterator;
            import java.util.List;
            import org.springframework.beans.factory.annotation.Autowired;
            import org.springframework.stereotype.Controller;
            import org.springframework.ui.Model;
            import org.springframework.web.bind.annotation.ModelAttribute;
            import org.springframework.web.bind.annotation.RequestMapping;
            import org.springframework.web.bind.annotation.RequestMethod;        
            @Controller
            public class ServiceCorAmcController {            
                @Autowired
                private ServiceCorporateAmcRepo serviceCorporateAmcRepo;             
                 @RequestMapping(value="acquireServiceCorporateAmcFormDetailsAMC", method=RequestMethod.GET)
                public  String selectServiceCorporateAmcFormDetailsss(@ModelAttribute ServiceCorporateAmc serviceCorporateAmc,Model model)
                {                     
      List  listServiceCorporateAmc= serviceCorporateAmcRepo.findAllData();                            model.addAttribute("ServiceAmcs",listServiceCorporateAmc);   
                        Iterator itr=listServiceCorporateAmc.iterator();  
              while(itr.hasNext()){  
               System.out.println(itr.next());  
     }   
    return "results::resultsList";
    //return listServiceCorporateAmc;

    }  
     }

        This is my results.html file it will display the results of Controller 
        <!DOCTYPE html>
        <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"lang="en"> 
        <head>
        <title>ServiceCorporateAmcForm</title>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        </head>
         <body>
        <div th:fragment="resultsList" th:unless="${#lists.isEmpty(ServiceAmcs)}" >
        <table>
        <thead>
        <tr>
        <!--<th th:text="#{results.ServiceAmcs.id}">Id</th>
        <th th:text="#{results.ServiceAmcs.customerID}">Customer ID</th>
        <th th:text="#{results.ServiceAmcs.escalation}">Escalation</th>
        <th th:text="#{results.ServiceAmcs.servicerequestcreatedby}">Service Request Created By</th>-->
        <th>Id</th>
        <th >Customer ID</th>
        <th>Escalation</th>
        <th>Service Request Created By</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="ServiceAmc : ${ServiceAmcs}">
        // I am getting error overhere
        <td th:text="${ServiceAmc.id}">id</td>
        <td th:text="${ServiceAmc.customerID}"> CustomerID</td>
         <td th:text="${ServiceAmc.escalation}">Escalation</td>
        <td th:text="${ServiceAmc.servicerequestcreatedby}">ServiceRequestCreatedBy</td> 
        </tr>
        </tbody>
         </table>
        </div>
         </body>
        </html>
Sumeet

In thymeleaf i cannot access the data from different class or pojo directly at a time, I have to make one new pojo which contains field from different pojo.

Thank You EveryOne

Thank YOu P.J.Meisch sir for your comment

Collected from the Internet

Please contact javaer1[email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

org.thymeleaf.exceptions.TemplateProcessingException: Concatenation href

Exception evaluating SpringEL expression, spring guru course

"Exception evaluating SpringEL expression" error while trying to iterate List(<Object>) in Thymeleaf Spring Boot

How to fix "Exception evaluating SpringEL expression" error after submitting a variable Spring/Thymeleaf

Spring Boot Testing Thymeleaf org.thymeleaf.exceptions.TemplateProcessingException

how to resolve this : Exception evaluating SpringEL expression: "#authorization.expression('isAuthenticated()')"?

Exception evaluating SpringEL with Spring MVC

Thymeleaf: "Exception evaluating OGNL expression" in a simple for loop

org.thymeleaf.exceptions.TemplateProcessingException: Only variable expressions returning numbers or booleans are allowed in this context

Exception evaluating SpringEL expression: "#dates.format(passation.datepassation, 'dd-MMM-yyyy')"

Spring Boot 1.4 MVC testing with Thymeleaf results in TemplateProcessingException

Spring Thymeleaf TemplateProcessingException in SpringInputGeneralFieldTagProcessor

Thymeleaf : org.thymeleaf.exceptions.TemplateInputException

Thymeleaf: org.thymeleaf.exceptions.TemplateInputException

org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="login", line 36 - column 3

how to get rid of org.thymeleaf.exceptions.TemplateInputException: while using thymeleaf expression to print data in form of bootstrap cards?

erlang: exception error when evaluating an arithmetic expression

String concat with conditional (Thymeleaf + SpringEL)

java program for evaluating postfix expression results in numberformat exception in one of the methods leetcode #150 for stack.Suggest changes please

Thyemleaf nested iteration triggers org.thymeleaf.exceptions.TemplateInputException

issue with springboot project : org.thymeleaf.exceptions.TemplateInputException

Method threw 'org.mockito.exceptions.misusing.InvalidUseOfMatchersException' exception.

Mockito exception : org.mockito.exceptions.misusing.InvalidUseOfMatchersException

Evaluating an if expression behaves differently then evaluating a BOOL expression

Raising non-Exception based exceptions in Python gives different results

In emacs org-babel, can I export the results of previous executions instead of re-evaluating on export?

Evaluating an expression in gekko

Evaluating Expression Tree

Evaluating call expression