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?
JSP Expression Language (EL) makes it possible to easily access application data stored in JavaBeans components. JSP EL allows you to create expressions both (a) arithmetic and (b) logical.
getParameter() is the method in request object, which returns String value always. So convert that string output to Integer [ line number 21] Integer.
getParameter is a function name in JSP which is used to retrieve data from an HTML/JSP page and passed into the JSP page. The function is designated as getParameter() function. This is a client-side data retrieval process. The full function can be written as request. getParameter().
If get an attribute from 'session', try this ${username}.
If get an parameter from 'request', try this ${param.username}.
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,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With