raviaaaa 0 Newbie Poster

this jsp consists of scriptlet tags so i need to remove the sriptlet to a action class

pls tell me how to move to struts

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%@ page import="java.util.*"%>

<title>Course Administration</title>

<script language="JavaScript">

 function reportSelection(){
  document.selectCourse.submit();
 }
</script>

</head>

<body bgcolor="#ffffff" leftmargin="0" rightmargin="0" topmargin="0"
    marginheight="0" marginwidth="0" bottommargin="0">
<%@ include file="/header.jsp"%>
<jsp:include flush="true" page="MELSheading.jsp"></jsp:include>

<%
System.out.println("Step 1");
//
PersonVO PV = new PersonVO();
ActivationDAOImpl aDAO = new ActivationDAOImpl();
String User_id = session.getAttribute("WIN_NO").toString();
System.out.println("user win is "+User_id);
Collection list = aDAO.getUniqueCourseList(User_id);
System.out.println("Size of the first list" + list.size());
String str = request.getParameter("course_id");
String firstCourseId = "";
String selectedId = (str != null) ? str : firstCourseId ;
System.out.println("Step 2");
%>


<form name="selectCourse" method="post" action="Activation.jsp">
<table height="20">
    <tr>
        <td height="20">&nbsp;</td>
    </tr>
</table>
<% System.out.println("Step 2");  %>
<table border="0" cellpadding="10" cellspacing="0" width="500">
    <!-- table 1 -->
    <tr>
        <td class="gohpFont" width="100%" align="center">
        <table border="1" bordercolor="#1B4443" cellpadding="0"
            cellspacing="0" width="100%">
            <!-- table 2 -->
            <tr>
                <td align="center">
                <table border="0" cellpadding="5" cellspacing="0" width="100%">
                    <!-- table 3 -->
                    <tr>
                        <td class="res3" colspan="4">Course Administration</td>
                    </tr>
                    <tr>
                        <td class="res0" align="center" colspan="4">Select a Course
                        &nbsp;&nbsp; <select name="course_id" size="1"
                            onChange="reportSelection();">
                            <option value="">&nbsp;</option>
                            <%
                      Iterator i = list.iterator();
                      while (i.hasNext()) {
                        //Country country = (Country)i.next();
                        UniqueCourseList uCourse = (UniqueCourseList)i.next();
                        if(firstCourseId.equals("")) firstCourseId = uCourse.getCourse_id();
                        //if (selectedId.equals(""))  selectedId = country.getCountryCode();
                        String courseID = uCourse.getCourse_id();
                        //String name = country.getCountryName();
                        String selected = uCourse.getCourse_id().equals(selectedId)?" selected " : "";
                        %>
                            <Option <%= selected %> value="<%= uCourse.getCourse_id() %>"><%= courseID %></option>
                            <%
                      }
                      %>
                        </select></td>
                    </tr>
                </table>
                <!-- table 3 --></td>
            </tr>
        </table>
        <!-- table 2 --></td>
    </tr>
</table>
<!-- table 1 --></form>

<% Collection list1 = null; 
    System.out.println("selectedId == " + selectedId);
    list1=aDAO.getCourseDetails(User_id, selectedId);
    System.out.println("Finding the course details step 3 in jsp ");
    System.out.println("Size of list " + list1.size());
%>

<table border="0" cellpadding="10" cellspacing="0" width="500">
    <tr>
        <td><b>COURSE ID</b></td>
        <td><b>DESC EFF DATE</b></td>
        <td><b>TIS REF NO</b></td>
        <td><b>NAME</b></td>
        <td><b>ACTION AVAILABLE</b></td>
    </tr>
<%
Iterator j = list1.iterator();
while(j.hasNext()){
    CourseDetails course_Det = (CourseDetails)j.next();
%>
    <tr>
        <td>
        <%=course_Det.getCourse_id() %>
        </td>
        <td>
        <%=course_Det.getDesc_date() %>
        </td>
        <td>
        <%=course_Det.getTis_ref() %>
        </td>
        <td>
        <%=course_Det.getName() %>
        </td>
        <td>
        <% if(course_Det.getStatus().equals("N")){
        %>
        <a href="./Success.jsp?course=<%=course_Det.getCourse_id() %>&desc_date=<%=course_Det.getDesc_date() %>&tis_ref=<%=course_Det.getTis_ref() %>&name=<%=course_Det.getName() %>&status=<%=course_Det.getStatus() %>" >
        Activate
        </a>
        <%
        }else{
        %>
        <a href="./Success.jsp?course=<%=course_Det.getCourse_id() %>&desc_date=<%=course_Det.getDesc_date() %>&tis_ref=<%=course_Det.getTis_ref() %>&name=<%=course_Det.getName() %>&status=<%=course_Det.getStatus() %>" >
        De-Activate
        </a>
        <%   }       
        %>
        </td>
        <% } %>
    </tr>
</table>


<!-- 
<html:form action="/courseActive">
</html:form> 
-->
<div style="position: relative; width: 100%; left: 20px;"><%@ include
    file="/footer.jsp"%></div>

</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.