JSTL map<long,?> How to convert a string or integer to a Long

Source: Internet
Author: User

Jstl the value in the map, generally need to be compared to whether it is a key, only take out the value of the map, if the front splicing key is a string or shape, the direct fetch is not out, need to convert, the conversion is very simple, key+0 on the line.

eg

recordentity.key= ' 2014.05.22-1-1 '

<c:set var= "StoreId" value= "${recordentity.key.split ('-') [2]}"/>

This storeid=1 is a string type, and the Storenamemap key is a long type.

${storenamemap[storeid]} This is not taken, you need to convert storeId to long.

The correct fetch method is: ${storenamemap[storeid+0]}, which is also applicable for storeId int type.

JSTL map<long,?> How to convert a string or integer to a Long

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.