Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16315

Incorrect SpEL syntax in reference documentation

    XMLWordPrintable

    Details

    • Last commented by a User:
      true

      Description

      Spring Framework Reference (Testing) https://docs.spring.io/spring/docs/5.0.2.RELEASE/spring-framework-reference/testing.html contains incorrect code fragment in section 3.5.6. Testing request and session scoped beans

      The incorrect fragment is:

      <beans>
      
          <bean id="userService"
                  class="com.example.SimpleUserService"
                  c:loginAction-ref="loginAction" />
      
          <bean id="loginAction" class="com.example.LoginAction"
                  c:username="{request.getParameter('user')}"
                  c:password="{request.getParameter('pswd')}"
                  scope="request">
              <aop:scoped-proxy />
          </bean>
      
      </beans>
      

      The problem is that c:username="{request.getParameter('user')}" should have prefix #{ for correct SpEL syntax. The same is true for c:password="{request.getParameter('pswd')}"

        Attachments

          Activity

            People

            Assignee:
            snicoll St├ęphane Nicoll
            Reporter:
            shryb Sviatoslav Hryb
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 37 weeks, 6 days ago