Victor2748
Victor2748

Reputation: 4199

JSP Expression Language get parameter

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?

Upvotes: 18

Views: 26044

Answers (2)

CE ZHANG
CE ZHANG

Reputation: 527

To get an attribute from session use ${myattr}.

To get a parameter from request use ${param.myparam}.

Upvotes: 23

Santhosh
Santhosh

Reputation: 8197

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,

Upvotes: 7

Related Questions