79497634

Date: 2025-03-10 10:04:26
Score: 1
Natty:
Report link

You may try if any of these solutions work:

  1. You can escape the colon in the property value by using \ before the colon. This should allow the SpEL parser to treat the colon as a regular character instead of part of the expression.

    Property File:

    report.type.urls=SOME_TYPE:'file:\\/home\\/SOME_TYPE'

    @Value("#{${report.type.urls}}")

    private Map<String, String> reportTypeToUploadHost;

  2. Alternatively, you can directly define the Map in your @Value annotation using SpEL's map literal syntax:

    report.type.urls=SOME_TYPE:file:/home/SOME_TYPE

    @Value("#{${report.type.urls}}")

    private Map<String, String> reportTypeToUploadHost;

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Value
  • Low reputation (1):
Posted by: Amit K.