How to use Expression Language in JSP

Discussion in 'JSP' started by shankar123, Mar 27, 2012.

  1. shankar123

    shankar123 New Member

    Joined:
    Mar 27, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    In JSP Expression language plays a very important role.But while i am writing it is not performing any action.As it is displayed in web page.For Ex
    if i write the EL as ${param.subtitle} it is not retrieving the subtitle's value.Instead it is displaying as ${param.subtitle} only.
    How can i get rid of this problem?
     
  2. vijaywebsolutions

    vijaywebsolutions New Member

    Joined:
    Apr 18, 2014
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    0
    I hope the following links will help you: javatpoint, tutorialspoint

    Gud luck.
     
  3. alia123

    alia123 New Member

    Joined:
    Jan 8, 2016
    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    0
  4. meenal deshpande

    meenal deshpande New Member

    Joined:
    Oct 11, 2018
    Messages:
    20
    Likes Received:
    2
    Trophy Points:
    3
    Gender:
    Female
    How about we take a gander at EL Operators and see how they are translated and how to utilize them.

    EL Property Access Operator or Dot (.) Operator

    JSP EL Dot administrator is utilized to get the quality qualities.

    ${firstObj.secondObj}

    In above articulation, firstObj can be EL understood protest or a quality in page, demand, session or application scope. For instance,

    ${requestScope.employee.address}

    Note that aside from the last piece of the EL, every one of the items ought to be either Map or Java Bean, so in above model requestScope is a Map and representative ought to be a Java Bean or Map. In the event that extension isn't given, the JSP EL investigates page, demand, session and application degree to discover the named quality.

    JSP EL [] Operator or Collection Access Operator

    [] administrator is more ground-breaking than speck administrator. We can utilize it to get information from List and Array as well.

    A few models;

    ${myList[1]} and ${myList["1"]} are same, we can give List or Array file as String exacting too.

    ${myMap[expr]} – if the parameter inside [] isn't String, it's assessed as an EL.

    ${myMap[myList[1]]} – [] can be settled.

    ${requestScope["foo.bar"]} – we can't utilize spot administrator when quality names have dabs.

    JSP EL Arithmetic Operators

    Number juggling administrators are accommodated straightforward estimations in EL articulations. They are +, - , *,/or div, % or mod.

    JSP EL Logical Operators

    They are && (and), || (or) and ! (not).

    JSP EL Relational Operators

    They are == (eq), != (ne), < (lt), > (gt), <= (le) and >= (ge).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice