title: my html page says an object i used earlier in my page does not exist
body: <p>im trying to put in the username as a parameter in my link. doing this through jquery the only problem is i get this error,note the object call works for some reason on the span tag. I've been looking at tutorials but to no avail when trying to get the span tags value via $(#emailTarget).attr(&quot;id&quot;); and putting said id onto the span tag it gives me the value of undefined rather than the username.</p>
  <p>error stack</p>
  <pre><code>org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleText(InlinedOutputExpressionMarkupHandler.java:80)
      at org.attoparser.HtmlMarkupHandler.handleText(HtmlMarkupHandler.java:208)
      at org.attoparser.AbstractChainedMarkupHandler.handleText(AbstractChainedMarkupHandler.java:203)
      at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:557)
      at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301)
      ... 98 more
  Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: &quot;principal.username&quot; (template: &quot;index&quot; - line 49, col 25)
      at org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:292)
      at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166)
      at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66)
      at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109)
      at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138)
      at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess(AbstractStandardExpressionAttributeTagProcessor.java:144)
      at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74)
      at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95)
      at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)
      at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314)
      at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205)
      at org.thymeleaf.engine.TemplateModel.process(TemplateModel.java:136)
      at org.thymeleaf.engine.TemplateManager.process(TemplateManager.java:519)
      at org.thymeleaf.util.LazyProcessingCharSequence.writeUnresolved(LazyProcessingCharSequence.java:85)
      at org.thymeleaf.util.AbstractLazyCharSequence.write(AbstractLazyCharSequence.java:103)
      at org.thymeleaf.engine.AbstractTextualTemplateEvent.writeContent(AbstractTextualTemplateEvent.java:224)
      at org.thymeleaf.engine.Text.write(Text.java:78)
      at org.thymeleaf.engine.OutputTemplateHandler.handleText(OutputTemplateHandler.java:71)
      ... 107 more
  Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'username' cannot be found on null
      at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:213)
      at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:104)
      at org.springframework.expression.spel.ast.PropertyOrFieldReference.access$000(PropertyOrFieldReference.java:51)
  </code></pre>
  <p>my home page</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th=&quot;http://www.thymeleaf.org&quot;
        xmlns:sec=&quot;http://www.thymeleaf.org/thymeleaf-extras-springsecurity3&quot;&gt;
      &lt;head&gt;
          &lt;meta charset=&quot;ISO-8859-1&quot;&gt;
          &lt;title&gt;Registration and Login App&lt;/title&gt;
  
          &lt;link rel=&quot;stylesheet&quot;
                href=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css&quot;
                integrity=&quot;sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u&quot;
                crossorigin=&quot;anonymous&quot;&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;!-- create navigation bar ( header) --&gt;
          &lt;nav class=&quot;navbar navbar-inverse navbar-fixed-top&quot;&gt;
              &lt;div class=&quot;container&quot;&gt;
                  &lt;div class=&quot;navbar-header&quot;&gt;
                      &lt;button type=&quot;button&quot; class=&quot;navbar-toggle collapsed&quot;
                              data-toggle=&quot;collapse&quot; data-target=&quot;#navbar&quot; aria-expanded=&quot;false&quot;
                              aria-controls=&quot;navbar&quot;&gt;
                          &lt;span class=&quot;sr-only&quot;&gt;Toggle navigation&lt;/span&gt; &lt;span
                              class=&quot;icon-bar&quot;&gt;&lt;/span&gt; &lt;span class=&quot;icon-bar&quot;&gt;&lt;/span&gt; &lt;span
                              class=&quot;icon-bar&quot;&gt;&lt;/span&gt;
                      &lt;/button&gt;
                      &lt;a class=&quot;navbar-brand&quot; href=&quot;#&quot; th:href=&quot;@{/}&quot;&gt;Registration and
                          Login Module&lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div id=&quot;navbar&quot; class=&quot;collapse navbar-collapse&quot;&gt;
                      &lt;ul class=&quot;nav navbar-nav&quot;&gt;
                          &lt;li sec:authorize=&quot;isAuthenticated()&quot;&gt;&lt;a th:href=&quot;@{/logout}&quot;&gt;Logout&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/nav&gt;
  
          &lt;br&gt;
          &lt;br&gt;
  
          &lt;div class=&quot;container&quot;&gt;
              &lt;h1&gt;Registration and Login with Spring Boot, Spring Security,
                  Thymeleaf, Hibernate and MySQL&lt;/h1&gt;
              Welcome &lt;span sec:authentication=&quot;principal.username&quot;&gt; User&lt;/span&gt;
          &lt;/div&gt;
          &lt;a th:href=&quot;login&quot; id=&quot;changeMe&quot; class=&quot;btn btn-danger&quot;&gt;Delete&lt;/a&gt;
          &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js&quot;&gt;&lt;/script&gt;
  
          &lt;script  type=&quot;text/javascript&quot; th:inline=&quot;javascript&quot;&gt;
              let email=[[${principal.username}]];
              $('#changeMe').prop(&quot;href&quot;, &quot;/delete?email=&quot;+email)
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>my repository url: <a href="https://github.com/jonathanIckovich/realtyKing.git" rel="nofollow noreferrer">https://github.com/jonathanIckovich/realtyKing.git</a></p>