0% found this document useful (0 votes)
4 views

Viva Java Notes

Uploaded by

Sakshi Rawat
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Viva Java Notes

Uploaded by

Sakshi Rawat
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 5

* disppatcher servlet

it comes unders psring mvc

first, dispatcher servlet is provided by spring

it handles all types of requests form client and decided which controler to send a partuclar request
and rends thje response from controller to view resolver

view resolver decides privdes mapping between view names and actiual view

after this view gives the response to diaptcher

and dispatcher gives reposnse to the client

it handles hhtp request - cause it s aservet

* can config name be customized

yes by using @conditional and @ configration

* disadvantages of jdbc

slow driver - can't be used in real time

odbc it is dependent on application platform

required db specific query

performace not good with multiple connections

exception handling is big issues - need to write multiple nested try catch blocks

* orm is object relationl mapping

meta data descriptor is a thing

class corresponds to table name

class meme corresponds to columns

objects corersponds to rows


* how do you configue manaby tp many relations

using @manytomany annotations

multiple instance of any intity can be mapped to any entities

it contains composite primary key consisting of primary key of both table

* entity life cycle (it asi different form MVC lifecycle)

new , managed, removed, detached

new - when an entity obj is initially created

managed - when it is persisted to the db via entity manager;'s persisted() method

it can also be retrieved from db and marked for deletion by an entity manager method - removed

detached - represents entity objects which are disconnected from entity manager

* what is entity

lightweight persistance domain object

it represents tbale in

obj/intace represents - rows

* how to validate no of tickets

@min @max @range

* pre defined validator annotation

@notnull @notempty @range @size

* bean
any obj, which is instatntiated, controlled or assembled by spring IoC contrainers

@autowired - we create a ref of a class in other class with this.

to cerate the actual obj we us config class - obj created using new keyword

conpulsary to write bean on top of it

* how to create custom validation annotation

add dependecy in POM.xml

create bean class

create control class

validator annotation

create validator class

provide entry of controller in web.xml file

define bean in xml file

* transactional annotation

if another mehtod calls current methos - by using this annotation the other mthod get option to come
sin between the ongoing process

* junit is ajava programmming tetsing unit

main motto - unit testing

* microserver is a collection of small autonomous services that can either work independentyl or as a
collection

all services are small independent and loosely coupled

a kind of architecture

language neutral

amazon, netflix, uber,


* core java - about access modifiers

class ka default modifier - default

interface ka default modifier - public

if any class extends any class or implements

the extender class has higher priority than interface - 3rd rule of java

* java 8

we can now define methods in interface using default keyword

also, the method created with default keyword with default keyword isn't abstract - it can be funcitonal
interface

static method is allowed now - no need to create obj.

added the forEach() method

lambda expression
if there is only one abs metho it become functional method
() -> {}

@model attribute

model attribute reads data in the existing model and loads JSP

it can be used to inject data object in the model before JSP loads

it can be used to read data

@requestmapping -- this come

this annotation maps http requests to handler methods of MVC and Rest contorllers

@ componentscan is to activate annotation -- this came

- sabke start me aayega hi aayega

You might also like