Skip to content

Incorrect SpEL syntax in reference documentation [SPR-16315] #20862

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sviatoslav Hryb opened SPR-16315 and commented

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="&#123;request.getParameter('user')&#125;" should have prefix #&#123; for correct SpEL syntax. The same is true for c:password="&#123;request.getParameter('pswd')&#125;"


Affects: 4.3.13, 5.0.2

Referenced from: commits 8aa94ae, 0d151b0

Backported to: 4.3.14

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions