JSP Expression Language get parameter

2019-01-15 13:47发布

I am trying to get a String parameter "username" from the request with Expression Language. I've done some research, but couldn't find a way to do so, I would like something similar to ${pageContext.request.parameter.username}

How get a specific request parameter, using only expression language?

标签: java jsp el
2条回答
狗以群分
2楼-- · 2019-01-15 14:28

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

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

查看更多
Root(大扎)
3楼-- · 2019-01-15 14:29

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,

查看更多
登录 后发表回答