title: EL1008E: Property or field 'applicationName' cannot be found on object of type 'java.lang.String' - maybe not public or not valid?
body: <p>Been stuck with this error for a while now.</p>
  <blockquote>
  <p>EL1008E: Property or field 'applicationName' cannot be found on object of type 'java.lang.String' - maybe not public or not valid?</p>
  </blockquote>
  <p>I'm trying to get the records from database through thymeleaf, but always gets this error. I think I've declared everything that is needed this.</p>
  <p>Here's my code</p>
  <p>Model</p>
  <pre><code>@Entity
  @Table(name = &quot;sms_alert&quot;, schema = &quot;public&quot;)
  public class SmsAlert {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = &quot;sms_id&quot;)
      private Long smsId;
      
      @Column(name = &quot;application_name&quot;)
      private String applicationName;
  
      @Column(name = &quot;sms_flag&quot;)
      private String smsFlag;
  
      public SmsAlert() {
          
      }
      
      public SmsAlert(String applicationName, String smsFlag) {
          super();
          this.applicationName = applicationName;
          this.smsFlag = smsFlag;
      }
  
      public Long getSmsId() {
          return smsId;
      }
  
      public void setSmsId(Long smsId) {
          this.smsId = smsId;
      }
  
      public String getApplicationName() {
          return applicationName;
      }
  
      public void setApplicationName(String applicationName) {
          this.applicationName = applicationName;
      }
  
      public String getSmsFlag() {
          return smsFlag;
      }
  
      public void setSmsFlag(String smsFlag) {
          this.smsFlag = smsFlag;
      }
      
  }
  </code></pre>
  <p>Controller</p>
  <pre><code>@GetMapping(value = &quot;/smsAlert/{applicationName}&quot;)
      public String viewApplicationSmsAlert(@PathVariable(&quot;applicationName&quot;) String applicationName, Model model) {
          System.out.println(applicationName);
          model.addAttribute(&quot;sms&quot;, smsService.findSmsFlagByAppName(applicationName));
          return &quot;test&quot;;
      }
  </code></pre>
  <p>Repository</p>
  <pre><code>@Repository
  public interface SmsRepository extends JpaRepository&lt;SmsAlert, Long&gt; {
          
      @Query(value = &quot;SELECT s.application_name, s.sms_flag  FROM public.sms_alert s WHERE s.application_name= :applicationName &quot;, nativeQuery = true)
      public String findSmsFlagByAppName(@Param(&quot;applicationName&quot;) String applicationName);
  </code></pre>
  <p>Service</p>
  <pre><code>@Service
  public class SmsService {
      @Autowired
      private SmsRepository smsRepository;
      
      public List&lt;SmsAlert&gt; findAll() {
          return smsRepository.findAll();
      }
      
      public String findSmsFlagByAppName(String applicationName) {
          return smsRepository.findSmsFlagByAppName(applicationName);
      }
  
      public void updateSmsFlag(String applicationName, String smsFlag) {
          smsRepository.updateSmsFlag(applicationName, smsFlag);
      }
      
  }
  </code></pre>
  <p>HTML File</p>
  <pre><code>&lt;body&gt;
      &lt;div id=&quot;content&quot;&gt;
          &lt;div&gt;
              &lt;table class=&quot;table table-hover table-striped&quot; id=&quot;invTable&quot;&gt;
                  &lt;thead&gt;
                      &lt;tr class=&quot;table-primary&quot;&gt;
                          &lt;th id=&quot;terminalId&quot;&gt;Terminal ID&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;tr th:each=&quot;sms : ${sms}&quot;&gt;
                          &lt;td th:text=&quot;${sms.applicationName}&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>