What does "PersonBean myBean =(PersonBean)request.getAttribute("myBean");" mean in Java? -
i learning java , came accross code example.
personbean mybean =(personbean)request.getattribute("mybean"); if(mybean=null) { mybean = new personbean(); request.setattribute("mybean",mybean); }
here personbean mybean =(personbean)request.getattribute("mybean");
doing? mean in if statement there statement constructs object of class . purpose of first line here? can break down me ?
this code gets "mybean" attribute request object (which contains incoming objects) , casts personbean. if not successful creates new personbean object name "mybean" , sets "mybean" object in request.
Comments
Post a Comment