انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-014-L01

التحقق عند الحافة

  • الدرس 1 من 6
  • Junior
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

reject bad input before it reaches the service.

الموضوعات المخطط لها

  • Never trust input: clients, scripts, and attackers send anything.
  • Validate at the controller boundary, on the request DTO.
  • Jakarta Bean Validation: put constraint annotations on fields; add @Valid on the controller parameter.
  • Frontend checks are for convenience only; the server must check again.
تفاصيل المخطط المبدئي

عرض عملي

java
record CreateProductRequest(@NotBlank String name, @Positive BigDecimal price) {}

@PostMapping
ProductResponse create(@Valid @RequestBody CreateProductRequest req) { ... }

اختبر فهمك

Is frontend validation enough?

أظهر الإجابة

No; anyone can call the API directly.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.