JSP Expression Language get parameter

后端 未结 2 1450
野性不改
野性不改 2020-12-06 17:08

I am trying to get a String parameter \"username\" from the request with Expression Language. I\'ve done some researc

相关标签:
2条回答
  • 2020-12-06 17:20

    If get an attribute from 'session', try this ${username}.

    If get an parameter from 'request', try this ${param.username}.

    0 讨论(0)
  • 2020-12-06 17:25

    The syntax to get the attributes from session would be,

    ${sessionScope[name]}
    

    And for the request attributes , you can use

    ${param[name]}
    

    For more info,

    • Examples of EL expressions
    • Java ee tutorial
    0 讨论(0)
提交回复
热议问题