All Questions
186
questions
0
votes
2
answers
118
views
@Qualifier field versus constructor parameters injection problems in Spring
I have two beans: CheckPassword and CheckEmail
@Service("CheckPassword")
@Primary
public class CheckPassword implements CheckStringInterface {
private static final String regex_password ...
0
votes
1
answer
410
views
Springboot Kotlin @Pattern annotation ignored
I am really desperate to solve this issue. All I want is to validate the input parameter with @Pattern annotation, but it simply ignores it.
The code accepts all the requests coming through.
/hello?...
1
vote
0
answers
435
views
Mask sensitive data in a JSON request using logback
I am trying to mask a JSON request using Logback pattern layout. Please consider the following JSON snippet.
{"menu": {
"account": {
"name": "amal",
&...
0
votes
1
answer
113
views
SecurityFilterChain - regexMatchers() for validating an endpoint which is similar in structure to other endpoints
I have three endpoints:
GET /rest/file/{name}/{guid} - this one is secured with OAuth2 token
GET /rest/file/task/{guid}
GET /rest/file/{guid}
I need a Regex expression for Spring Security's ...
0
votes
1
answer
124
views
Regular expression in spring security context for query
I try to match this url in my spring security context xml:
/settings/folder_0+folder_1+folder_2.yaml?tag=test
I tried :
<s:intercept-url pattern="/settings/(.*)([+]?)*.yaml?tag=test&...
0
votes
1
answer
356
views
Spring GetMapping regex expression
We are trying to write a GetMapping in the Spring application, but it's not working as required. Below is the my code:
@RequestMapping("/app")
public class UserController {
@GetMapping(&...
0
votes
2
answers
128
views
How to use regex in java
I am integrating with hyperpay payment gateway,
they have this regex to check payment status
The regular expression pattern for filtering out this group is:
/^(000.000.|000.100.1|000.[36]|000.400.[1][...
0
votes
1
answer
11k
views
Regex pattern matching using @Pattern annotation in Spring Boot
I want to accept only those titles which don't contain following characters: \/:*?"<>|
I tried using the below method, but it didn't work for me
@Pattern(regexp = "[^\\/:*?\"<&...
0
votes
3
answers
384
views
Javax Pattern annotation failing for correct values
I need to use validation where input value should end with "Type" So I came up with Type$ regex, but it is failing for correct values. Here is how I am using this in Pattern annotation in my ...
0
votes
2
answers
67
views
Convert Delimitted String to Object Structure
I have a delimited String: "Albert:GE-20&40#Gert:LE-26#John-$-$#Johnah Doe:LP-40".
Name:Code-Mark1&Mark2&Mark3#
Where, Albert is the name, GE is the code, and 20&40 are marks ...
1
vote
2
answers
2k
views
How to generate a phone number with eight digits and country code 00223 or +223 with java Faker Library?
I want to use the Faker java library to generate phone numbers with 00223 or +223 followed by eight digits.The current behavior is that the format of the generated phone number does not match the ...
1
vote
0
answers
113
views
Regex not working Mongo DB + Spring Data + Java + Number
public List<Criteria> getCriteria(FiltersDto filtersDto) {
List<Criteria> criteria = new ArrayList<>();
if (filtersDto.getId() != null && !filtersDto.getId().isEmpty()...
0
votes
1
answer
77
views
Extract token from JSP tag using java [closed]
I have String s as input which is shown below and I want to extract tokens i.e title ,cssErrorClass , id, maxlength ,name along with right hand side value .
What can be the best approach to extract ...
1
vote
2
answers
5k
views
Regex pattern to check if string has no special characters - Java
I want to check if a string contains no special characters like @, $ etc and include only alphanumerics and special characters like "-", "."
I have used regex pattern as below, but ...
0
votes
2
answers
65
views
How do replace digit enclosed dot with braces in java
I am having String details=employee.details.0.name but i want to have it like String details=employee.details[0].name What would be the easiest way to achieve that? i am using java.
private static ...