Skip to main content

Posts

Showing posts from May, 2015

JSF2 backing bean has a reference to another and re using request scoped properties in new requests

 // note exam id and exam text are initialized from exam backing bean which is (request scoped) and in the same time they are traveling in each request @ManagedBean(name = "question")//Constants.QUESTION) @RequestScoped public class QuestionBean {     private int examId;     private String examText;        @ManagedProperty(name="exam", value="#{exam}")     private ExamBean exam; // getters and setters   @PostConstruct         public void init() {            examId = exam.getExamId();            examText=exam.getExamText();                   }     } ------------------------XHTML page --------------------------------------- <?xml version="1.0"?> <f:view     xmlns="http://www.w3.org/1999/xhtml"     xmlns:c="http://java.sun.com/jsp/jstl/core"     xmlns:f="http://java.sun.com/jsf/core"     xmlns:h="http://java.sun.com/jsf/html"     xmlns:ui="http://java.sun.com/jsf/facelets&qu

Very powerful yet simple JSF 2 with Ajax using render and renderd

in the jsf xhml  <?xml version="1.0"?> <f:view     xmlns="http://www.w3.org/1999/xhtml"     xmlns:c="http://java.sun.com/jsp/jstl/core"     xmlns:f="http://java.sun.com/jsf/core"     xmlns:h="http://java.sun.com/jsf/html"     xmlns:ui="http://java.sun.com/jsf/facelets" >     <h:head /> <h:body> <h:form> <h:selectOneRadio value="#{question.questionType}" >        <f:selectItem itemValue="single" itemLabel="Single Choice" />        <f:selectItem itemValue="multi" itemLabel="Multi Choice" />        <f:ajax execute="@this" render="selectedType" /> </h:selectOneRadio>  <h:panelGroup id="selectedType">      <h:panelGroup layout="block" id="choices" rendered="#{question.questionType eq 'multi'}" >         <table>         <tr>    

Oracle export /backup and import /restore schemas

A----------------------------------------EXPORT/BACKUP---------------------------------------------------- 1-  make new folder for the backup  let say  c:/oracle/import/ MY_DATA_PUMP_DIRECTORY 2-  sqlplus  login as system user 3- CREATE DIRECTORY MY_DATA_PUMP_DIRECTORY  AS 'c:/oracle/ MY_DATA_PUMP_DIRECTORY '; 4- grant all on directory MY_DATA_PUMP_DIRECTORY to system; 5- exit sqlplus and run the following from command line expdp system/password DIRECTORY=MY_DATA_PUMP_DIRECTORY DUMPFILE=schemaName.dmp logfile=schemaName.log SCHEMAS=schemaName B-----------------------------IMPORT/RESTORE-------------------------------------------------------------------- 1- make sure you have the directory  MY_DATA_PUMP_DIRECTORY   the same as for the import 2- impdp system/password  DIRECTORY=MY_DATA_PUMP_DIRECTORY dumpfile=schemaName.dmp logfile=schemaName.log SCHEMAS=schemaName