Package org.apache.geronimo.javaee6.asynejb.ejb

Examples of org.apache.geronimo.javaee6.asynejb.ejb.LogSessionBean


            String cid=request.getParameter("cid");
            String sid=request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            int intcid = Integer.parseInt(cid);
            Student student=facade.findStudent(intsid);
            Course course=facade.findCourse(intcid);
            facade.unselectCourse(student, course);
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+sid);
            dispatcher.forward(request, response);
        } finally {
            out.close();
View Full Code Here


    private Facade cfacade = null;

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        String cname = request.getParameter("cname");
        Course c  = cfacade.findCourseByName(cname);
        String cn = c.getClassroom();
        PrintWriter out = response.getWriter();
        try {
            out.println("<html>");
            out.println("<head>");
            out.println("<title>listQuery</title>");
View Full Code Here

        response.setContentType("text/html;charset=8859_1");
        PrintWriter out = response.getWriter();
        try {
            String sid = request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            Student student = facade.findStudent(intsid);

            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet viewAllCourse</title>")
            out.println("</head>");
            out.println("<body>");
            out.println("<a>Welcome!Student Name:"+student.getInfo().getName()+"</a>");
     
      List<Course> courses = facade.findAllCourse();
      if(courses==null){
        out.println("<p>error occur! can not findallcourse()! it is empty!</p>");
        out.println("</body>");
View Full Code Here

            String cid=request.getParameter("cid");
            String sid=request.getParameter("sid");
//            double score = 3.0;
          
            int intsid = Integer.parseInt(sid);
            Student student = facade.findStudent(intsid);
      out.println("<a>Get student name is:"+student.getInfo().getName()+"</a>\n");
      ///
            int intcid = Integer.parseInt(cid);
            Course course=facade.findCourse(intcid);
      out.println("<a>course name:"+course.getCname()+"</a>\n");
     
            facade.selectCourse(student, course);
      out.println("<a>after selectCourse op. </a>\n");
      out.println("</body>");
      out.println("</html>");
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+student.getId());
            dispatcher.forward(request, response);
        } finally {
            out.close();
        }
    }
View Full Code Here

        response.setContentType("text/html;charset=8859_1");
        PrintWriter out = response.getWriter();
        try {
            String sid = request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            Student student = facade.findStudent(intsid);

            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet selectCourse</title>")
            out.println("</head>");
            out.println("<body>");
            out.println("<a>Welcome!Student Name:"+student.getInfo().getName()+"</a>");
     
      List<Course> courses = facade.findAllCourse();

      out.println("<h2>Want to Select Course?</h2>");
            List<Course> selectedCourses = new ArrayList<Course>();
      selectedCourses = student.getCourses();
      {
        out.println("</ol>");
        for (Course course : courses) {
          if (selectedCourses==null || !selectedCourses.contains(course)){
            out.println("<li>Course name:");
            out.println("Click Here to Select "+course.getCname()+" from selectCourse ");
            out.println("<a href=\"CourseSelect?cid="+course.getCid()+"&sid="+student.getId()+"\">Select This Course</a>");
            out.println("</li>");
            }
        }
        out.println("</ol>");
      }
     
            out.println("<h2>Want to Cancel selected Course?</h2>");
      if(student.getCourses()==null){
        out.println("<p>INFO:Student has no course selected.</p>");
      }
      else
      {
        selectedCourses = student.getCourses();
        out.println("<ol>");
        for (Course course : selectedCourses) {
          out.println("<li>Course name:");
          out.println("Click Here to Unselect "+course.getCname()+" from selectCourse");
          out.println("<a href=\"CourseUnselect?cid="+course.getCid()+"&sid="+student.getId()+"\">Unselect This Course</a>");
          out.println("</li>");
        }
        out.println("</ol>");
      }
View Full Code Here

            BasicInfo basicInfo=new BasicInfo();
            basicInfo.setAddress(address);
            basicInfo.setAge(Integer.parseInt(age));
            basicInfo.setName(sname);
            basicInfo.setTelephone(telephone);
            Student student=new Student();
            student.setId(Integer.parseInt(sid));
            student.setInfo(basicInfo);
            student.setRank("N/A");
            student.setTotalScore(sco+student.getTotalScore());
           
//            System.out.println("student info before em.persist:sname:"+sname+",Address.city"+address.getCity()+",BasicInfo.TEL:"+basicInfo.getTelephone());
            facade.createStudent(student);
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewAllStudents");
            dispatcher.forward(request, response);
View Full Code Here

        try {
            String cid=request.getParameter("cid");
            String sid=request.getParameter("sid");
            int intsid = Integer.parseInt(sid);
            int intcid = Integer.parseInt(cid);
            Student student=facade.findStudent(intsid);
            Course course=facade.findCourse(intcid);
            facade.unselectCourse(student, course);
            RequestDispatcher dispatcher=request.getRequestDispatcher("viewSelect_CourseRelation?sid="+sid);
            dispatcher.forward(request, response);
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.javaee6.asynejb.ejb.LogSessionBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.