[jbosstools-issues] [JBoss JIRA] (JBIDE-21380) EL syntax error: String is not closed with string concatenation
Viacheslav Kabanovich (JIRA)
issues at jboss.org
Thu Dec 24 02:15:00 EST 2015
[ https://issues.jboss.org/browse/JBIDE-21380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144067#comment-13144067 ]
Viacheslav Kabanovich edited comment on JBIDE-21380 at 12/24/15 2:14 AM:
-------------------------------------------------------------------------
For workaround, you can compose the expression as
{code}
String expression = "#" + "{" + entry.getValue() + "}";
{code}
or define constants
{code}
final static String EL_START = "#{";
final static String EL_END = "}";
String expression = EL_START + entry.getValue() + EL_END;
{code}
that will cheat EL validation.
For fix, I will implement a look up into the next string in the same Java expression for the closing token. Such expression will be excluded from validation.
The same workaround will work for the second case. Also, you can in project properties page 'JBoss Tools Knowledge Base' turn off the support for the module for which it is not relevant. Could you advise what features (facets, natures) make a module unlikely and undesirable for KB support?
was (Author: scabanovich):
For workaround, you can compose the expression as
{code}
String expression = "#" + "{" + entry.getValue() + "}";
{code}
For fix, I will implement a look up into the next string in the same Java expression for the closing token. Such expression will be excluded from validation.
The same workaround will work for the second case. Also, you can in project properties page 'JBoss Tools Knowledge Base' turn off the support for the module for which it is not relevant. Could you advise what features (facets, natures) make a module unlikely and undesirable for KB support?
> EL syntax error: String is not closed with string concatenation
> ---------------------------------------------------------------
>
> Key: JBIDE-21380
> URL: https://issues.jboss.org/browse/JBIDE-21380
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: jsf
> Affects Versions: 4.3.x
> Environment: Eclipse Mars.1 (4.5.1)
> Reporter: Andrei Ivanov
> Assignee: Viacheslav Kabanovich
> Priority: Minor
> Fix For: 4.4.x
>
>
> I get a {{EL syntax error: String is not closed.}} warning when an expression is composed using string concatenation:
> {code:java}
> String expression = "#{" + entry.getValue() + "}";
> {code}
> \\
> \\
> A different issue I think might be that when enabling the JSF support for the web module, the JBoss Tools Knowledge Support is enabled for the other modules too, including the data module.
> This leads to {{EL syntax error: Expecting expression.}} for a JPA query with Spring EL expressions:
> {code:java}
> import org.springframework.data.jpa.repository.Query;
> import org.springframework.data.repository.PagingAndSortingRepository;
> public interface FunctionsRepository extends PagingAndSortingRepository<Function, Integer> {
> @Query("SELECT DISTINCT r.workCenter.function"
> + " FROM StaffingAgreementDataRecord r"
> + " WHERE r.staffingAgreement.customer.id IN :customerIds"
> + " AND r.staffingAgreement.startDate <= :#{#interval.end}"
> + " AND r.staffingAgreement.endDate >= :#{#interval.start}")
> List<Function> findByCustomersAndInterval(List<Integer> customerIds, Interval interval);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jbosstools-issues
mailing list