I'm new to JMeter, I want to validate a JMeter test input variables defined as part of "User Defined Parameters". Let's say I have a variable "sessions" and my tester should pass input values in between 0 to 30 for sessions, if tester passes other than this range the test should not go further and should throw an error with appropriate message.
Is it possible with any kind of JMeter controllers/assertions/... without writing code for validation?

I am not sure is there any efficient/direct way of doing this. but I achieved your requirement as follows:
Stop Test NowinAction to be taken after a Sample errorJMeter VariableinApply tosection.MatchesinPattern Matching Rulessection.^[0-9]$|^0[1-9]$|^1[0-9]$|^2[0-9]$|^30$inPattern to testtext area.Test will be stopped if you provide
sessionsvalue other than0-30in User Defined Variables, as Setup Thread Group is configured toStop Test Nowon Sample error.Note1: Added View Results Tree Listener for confirmation whether the test is continued and also to check the error message. View Results Tree is added only for visual confirmation, must be removed during the load test, does not effect the actual logic.
Note2: I am not aware of any component, which can show custom message/alert to the user. so, used View Results Tree. We should remove this command during load testing. I added here for visual confirmation purpose. If not present also, Test will be stopped on wrong value for
sessions, i.e., other than0-30Note3: We need a Sampler component in order to apply an Assertion. so, added Debug Sampler. Debug Sampler just reports all the JMeter variable values at the point of its execution.
Image references:
Setup Thread Group:
Response Assertion:
View Results Tree: