Тёмный

Spring Boot - Creating Custom Annotation For Validation | InterviewQA | JavaTechie 

Java Techie
Подписаться 180 тыс.
Просмотров 57 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 76   
@DiplomasizKodcu
@DiplomasizKodcu Год назад
Followed and liked. Thank you so much.
@vitamin2845
@vitamin2845 2 года назад
Great tutorial, very helpful :)
@DurgaShiva7574
@DurgaShiva7574 2 года назад
1st like and comment ❤️
@tradeinfo3897
@tradeinfo3897 Год назад
can anyone help me to validate xml request body against xsd
@vinodhreddy6227
@vinodhreddy6227 2 года назад
Same way one to many relationships, can you try once.. it will help
@Javatechie
@Javatechie 2 года назад
Hi vinodh already i uploaded this please check ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8qhaDBCJh6I.html
@vinodhreddy6227
@vinodhreddy6227 2 года назад
@@Javatechie sorry may be not understood.. I'm asking one to many relationships using validator. Many relationships not working validation. Can you try once
@Javatechie
@Javatechie 2 года назад
Ohh okay got you
@satzcalvin
@satzcalvin 2 года назад
Can we use @Pattern(regexp=“^[EMPLOYEE|VENDOR|CONTRACTOR]”)? It will be simple and one line instead of creating custom validation?
@itsnarahari
@itsnarahari 2 года назад
We can use pattern but it's not recommended you can use enum for fixed values and you can check
@ShinAkuma
@ShinAkuma 2 года назад
You can, but will you add this every time you need to perform this validation ? If in future you need to add 1 more value to the pattern, you will have to change this pattern in every single place you have used this.
@satzcalvin
@satzcalvin Год назад
@@ShinAkuma Thanks for good example
@vinodkumarreddy7696
@vinodkumarreddy7696 2 года назад
Hi Sir we have Employee class in dto we are using @notnull and @not empty ...it's working fine for all fields ...but my scenario is suppose if the user send pay load to controller based on user dept type I want to check only first and last name and for second user i dont need to check names but I need to check only email and password....is it possible here to validate like that or we need to write logics separately ? In this case always it will check the values for entire Employee class Can u plz advise ...thanks for the video
@Cons2911
@Cons2911 Год назад
I know this is old but you can put your logic in the validator itself, you’ll have access to the object so you can check however you like
@samirpanda1147
@samirpanda1147 Год назад
have you got any solution for this?
@Cons2911
@Cons2911 Год назад
@@samirpanda1147 there’s a way to validate using code, and annotation. I forgot what it’s called but basically you get access to the fields using this validator so you can check for nulls or do whatever you need to do. Let me see if I can find out the proper term.
@bhavikjoshi1060
@bhavikjoshi1060 2 года назад
Thank you so much for creating such great real world example. Very very helpful for me. I just want to request you that if you can create a video on how we can find performance issues in our application? That would be great help. I will appreciate it. Thanks again. 😊😊😊
@Javatechie
@Javatechie 2 года назад
Okay I will try that
@bhavikjoshi1060
@bhavikjoshi1060 2 года назад
@@Javatechie thank you so much 😊
@abhishekomprakash4074
@abhishekomprakash4074 Месяц назад
Very nice demonstration about custom annotation. One question: The message has hard coded values for the employeeType. Later if we add new types in an enum then can we have the message dynamic so that it fetches the valid values from the enum itself?
@rkm7184
@rkm7184 2 месяца назад
Instead of writing so much code to validate employee type, just create an Enum for Employee type with the required value and take reference of that Enum in employee request DTO
@rishabhsharma2024
@rishabhsharma2024 7 месяцев назад
can you make one more video on how to use group() and payload() method by example ,it would be great help ,i searched on internet but hard time to understanding proper usecases ,if anybody knows let me know.
@tararamgoyal2220
@tararamgoyal2220 2 года назад
Owsem content & explanation, thank for you Basant your all the efforts 😍❣
@SuperHuman748
@SuperHuman748 2 месяца назад
Hi Thanks 🙏👍 Can u make a video on following list 1. How to validate a list or a map of objects 2. How to pass a validated list of allowed strings during entity creation itself.
@crackrbiwithme3356
@crackrbiwithme3356 5 месяцев назад
Awesome content sir. Can we validate response body also?
@Javatechie
@Javatechie 5 месяцев назад
Yes we validate but the approach is not the same we need to use aop advice
@crackrbiwithme3356
@crackrbiwithme3356 5 месяцев назад
@@Javatechie thank you sir for giving me direction.
@crackrbiwithme3356
@crackrbiwithme3356 5 месяцев назад
Sir if it is possible, please upload one video for response validation also. In my current project I am dealing with lot of third party apis response and I need to validate them. It will be great help if you upload one video.
@DeepakLalchandaniProfile
@DeepakLalchandaniProfile 11 месяцев назад
@javatechie is this validation included in your springboot course
@Javatechie
@Javatechie 11 месяцев назад
Yes I believe
@DeepakLalchandaniProfile
@DeepakLalchandaniProfile 11 месяцев назад
@@Javatechie under which section
@Javatechie
@Javatechie 11 месяцев назад
Bean validation
@DeepakLalchandaniProfile
@DeepakLalchandaniProfile 11 месяцев назад
​@@Javatechie thank you
@itsnarahari
@itsnarahari 2 года назад
We are only 3K subscriber for the century let's make all quickly by sharing this content everybody will subscribe after seeing this clear eplanation
@abhaymishra8112
@abhaymishra8112 2 года назад
Yor are doing a good job to pick very interesting and useful topic.
@sreddy8141
@sreddy8141 2 года назад
Good content 👍helpful. Thanks sir
@nagareddy9744
@nagareddy9744 Год назад
Hello basanth...the exception you are getting MethodArgumentNotValidException....i am getting that
@Vithal_Nivargi
@Vithal_Nivargi 16 дней назад
Thanks ❤
@niketagrawal1990
@niketagrawal1990 Год назад
Cant we simply make the field as enum itself, it will do the work
@Javatechie
@Javatechie Год назад
Yes you can but user might give wrong value
@Cons2911
@Cons2911 Год назад
Java’s is no longer included I think it the latest version of spring. If we add Java’s manually will it still work ?
@nitinbhattacharyya8784
@nitinbhattacharyya8784 Год назад
Can you tell me what is the use of @Documented? Also can you tell me what exactly those two lines you copied are doing?
@codingmoments
@codingmoments 2 года назад
thnx for this video
@chapristuff8460
@chapristuff8460 2 года назад
Thanks for posting. Very informative.
@niranjanvasadi8616
@niranjanvasadi8616 2 года назад
Please explain how to handle request reject exception.I need to handle //(doubleslashes) in url when calling the api. I don't find any solution for this please explain.
@asadullahmonsur9136
@asadullahmonsur9136 2 года назад
Is the any way to to disable scripts (java script ) requesting to server or disable json (use xml configuration instead) , similarly disable JS files in rendering to client . I am assuming environment is springboot application with pure java
@AllDetailsIKnow
@AllDetailsIKnow 9 месяцев назад
Thanks!
@gopisambasivarao5282
@gopisambasivarao5282 Год назад
Great content.thanks Basant..
@cosmicjava
@cosmicjava 6 месяцев назад
Nice lesson!
@nguyendinhtoifplhn3443
@nguyendinhtoifplhn3443 Год назад
hello teacher, i am new to spring validation and i have encountered a problem that one of my data fields has type double and now i want to check when i enter a string or a character it will give an error format, but I have tried many times and failed, can you help me?
@francovedia5584
@francovedia5584 Год назад
thanks
@amaljeevs4157
@amaljeevs4157 Год назад
Was Helpful❤
@itsnarahari
@itsnarahari 2 года назад
Great content
@satyanarayanamanchala6476
@satyanarayanamanchala6476 2 года назад
Can we use property file to read messages
@Javatechie
@Javatechie 2 года назад
Yes you can use
@arvindpandey8793
@arvindpandey8793 2 года назад
Great
@rishiraj2548
@rishiraj2548 2 года назад
🙏👍
@sheikhmohduzair2886
@sheikhmohduzair2886 Год назад
create a video for validating List of object in springboot.
@Javatechie
@Javatechie Год назад
List of objects means you are talking about List employees or List
@sheikhmohduzair2886
@sheikhmohduzair2886 Год назад
@@Javatechie Employee
@Javatechie
@Javatechie Год назад
Approach is the same only you need to pass an argument as a list of employees in the controller class that's it .
@sheikhmohduzair2886
@sheikhmohduzair2886 Год назад
@@Javatechie i got a list of json request from client and if i have a controller for handling list of (suppose employee) object but my validation is for bean . when i validate it does not give the expected output . the response i am getting is also in the list of object. THE Approach you told does not work i have tried .
@hamednikbakht9708
@hamednikbakht9708 2 года назад
hi please add subtitle
@Javatechie
@Javatechie 2 года назад
It will auto enabled
@rajasundarrajan2066
@rajasundarrajan2066 Год назад
Great , Thank you
@itsnarahari
@itsnarahari 2 года назад
Great and clear content
@PappuKumar-ho3ek
@PappuKumar-ho3ek 2 года назад
Good topic....nicely explained 👏 👌 👍
@himanshutariyal7648
@himanshutariyal7648 Год назад
Great video, just one question. Is the Javax bean validation and Jakarta bean validation same dependencies? The annotation is working with javax but not with jakarta. I checked maven repository and there it was mentioned that "Note Javax artifact was moved to Jakarta.validation ".
@Javatechie
@Javatechie Год назад
Not sure buddy needs to check.
@vishakhnaik2310
@vishakhnaik2310 Год назад
yeah they moved all the classes of javax to jakrata now
@rahulbhagwat2182
@rahulbhagwat2182 Год назад
Javax validation doesnt work now......To discover this I almost spent my whole day today
@Javatechie
@Javatechie Год назад
It should work . Will check and update
@stevegathara8885
@stevegathara8885 Год назад
You are a good tutor. Very clear. Thanks you!
@badriv.r453
@badriv.r453 2 года назад
Nice & simple to understand
Далее
Дикий Бармалей разозлил всех!
01:00
ТАРАКАН
00:38
Просмотров 753 тыс.
Se las dejo ahí.
00:10
Просмотров 2,5 млн
We finally APPROVED @ZachChoi
00:31
Просмотров 9 млн
Дикий Бармалей разозлил всех!
01:00