<%@ page import="javax.ejb.*,javax.naming.*, javax.rmi.PortableRemoteObject,java.rmi.RemoteException, java.math.*, University.Course,University.CourseHome,java.util.*" %> <%! private Course course = null; CourseHome home=null; public void jspInit() { try { InitialContext ic = new InitialContext(); Object objRef = ic.lookup("java:comp/env/ejb/Univ"); home=(CourseHome)PortableRemoteObject.narrow(objRef, CourseHome.class); } catch(Exception ex) {} } %> University Registration Application
<% String stdname = request.getParameter("stdname"); String stdrollno = request.getParameter("stdrollno"); if ( stdname != null && stdname.length() > 0 ) { if ( stdrollno != null && stdrollno.length() > 0 ) { course = home.create(stdname,stdrollno); } } %>

University Registration Application

Welcome <%=stdname%>

Please a Course Subject
<% int i=1; String choice=request.getParameter("ch"); if(choice!=null) { if(!choice.equals("--")) { String str=course.addCourse(choice); %>

<%=str%> <% } } String rmcourse=request.getParameter("c"); if(rmcourse!=null) { course.removeCourse(rmcourse); } Vector courseList = new Vector(); courseList = course.getSelectedCourse(); Enumeration enumer = courseList.elements(); %>

<% while (enumer.hasMoreElements()) { String title = (String) enumer.nextElement(); if (title!=null) { %> <% } } %>
Course Name Select Course to remove
<%=title%> >
>