JSP get parameter expression language

I am trying to get the String parameter "username" from request with an expression . I did some research, but could not find a way to do this, I would like something similar to ${pageContext.request.parameter.username}

How to get a specific query parameter using only expression language?

+7
java jsp el
source share
2 answers

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

If you get the parameter from the "request", try this $ {param.username}.

+12
source share

The syntax for getting attributes from the session will be:

 ${sessionScope[name]} 

And for request attributes you can use

 ${param[name]} 

For more information

+4
source share

All Articles