Похожие чаты

Guys, need some help. In my project (which encoding in

IDEA is set to UTF-8) there is one simple bean, that have a regexp, like
private static final String GENERAL_PATTERN_STRING = "^[0-9A-Za-zа-яА-ЯэЭыЫёЁ\\\\/\\s]+$";
I make a build using gradle with encoding properties like
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
But after build is completed successfuly, I deploy .war to Tomcal and try to call start page - i get en error:
Context initialization failed EXCEPTION = [org.springframework.beans.factory.BeanCreationException: Error creating bean with name '...' defined in ServletContext resource
[/WEB-INF/conf/spring/application-context.xml]: Instantiation of bean failed;
.....
java.util.regex.PatternSyntaxException: Illegal character range near index 19
, ^[0-9A-Za-zа-яА-ЯэЭыЫёЁ\\/\s]+$
Where i miss to set the encoding? Any help is appreciated

1 ответов

21 просмотр

Well, I don't know where exactly encoding should be configured to solve this. Have never seen it. But I've came across this faq when was looking for the answer. Maybe this can help: https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8 And if I had to solve it asap, I would modify the pattern to be "^[\d\p{L}\\\\/\\s]+$" . I feel that this is what the original intention was. Or use UNICODE_CHARACTER_CLASS flag when compile regex pattern, and use widely-known notation "^[\w\\\\/\\s]" - this looks even simpler and much more familiar. I guess, that's the reason why I've never saw that exception and why there's not much info about it on first pages of google: it's more common to use locale-agnostic regex patterns in your code. See more https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#ucc, https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#UNICODE_CHARACTER_CLASS

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта