Creating js file to use in JSP????

Could someone please tell me how to move javascript code that I have in my JSP to a separate js file and then use that js code in my JSP???

This is the entire mainjavascript.js file ...
<script>
     function checkForm()
          if(document.Check.Barcode.value == "")
               alert("Sorry, you must enter a barcode");
               return false;
          if(document.Check.Title.value == "")
               alert("Sorry, you must enter a title");
               return false;
          if(document.Check.Barcode.value.length > 5)
               alert("Sorry, the barcode can not exceed 99,999");
          if(document.Check.Title.value.length > 100)
               alert("Sorry, the title can not be more than 100 characters long");
               return false;
          if(document.Check.Author.value.length > 40)
               alert("Sorry, the author can not be more than 40 characters long");
               return false;
          if(document.Check.Publisher.value.length > 30)
               alert("Sorry, the publisher can not be more than 30 characters long");
               return false;
          if(document.Check.Isbn.value.length > 20)
               alert("Sorry, the ISBN can not be more than 20 characters long");
               return false;
          if(document.Check.Publishdate.value.length > 7)
               alert("Sorry, the publish date field must be in the format YYYY-MM");
               return false;
          if(document.Check.Description.value.length > 500)
               alert("Sorry, the description can not be more than 500 characters long");
               return false;
          if(document.Check.Orderedby.value.length > 40)
               alert("Sorry, the ordered by field can not be more than 40 characters long");
               return false;
          if(document.Check.Mediatype.value == "0")
               alert("Sorry, you must enter a media type");
               return false;
          if(document.Check.Location.value == "0")
               alert("Sorry, you must enter a location");
               return false;
          var a = parseInt(document.Check.Barcode.value);
          var b = parseInt(document.Check.largestBarcode.value);
          if(a <= b)
               alert("Sorry, you must enter a barcode that is greater than " + document.Check.largestBarcode.value);
               return false;
</script>
<script language="JavaScript">
     function StripQuotes(){
     //This function will prevent double quotes from being placed around title
     var preamble = document.Check.Title.value;
     var strTitle = "";
     for (i=0; i < preamble.length; i = i + 1){
     if (preamble.charAt(i) == "\""){
          preamble.charAt(i) == "";
               }// ends IF
               else{var strTitle = strTitle + preamble.charAt(i);}
     }// ends FOR
     document.Check.Title.value = strTitle;
     }// ends StripQuotes() function
</script>

Similar Messages

  • Creating a File object in a JSP page

    Hi,
    I am trying to create a File object in my JSP page by passing it a relative path. The jsp page is in 'website/testfolder/index.jsp' and the File is in 'website/photos/1.jpg'. In my jsp page i do the following:
    <% File f = new File("../photos/1.jpg");
    boolean test = f.isFile(); %>
    The value returned is false. I am trying to figure out why it can't locate the file.
    Thanks

    You have to use absolute paths. You can get the absolute path for the given relative path by ServletContext#getRealPath().

  • Is it possible to create .ncd file without using MAX?

    Is it possible to create .ncd file without using MAX? I am trying to read the data given by hundreds of possible Arb. IDs on one of the CAN port without having to create it from the MAX.
    Thank you

    Hi,
    the NI-CAN driver software does not provide functions/VIs to generate
    *.ncd files. However the *.ncd file format is just plain XML (ASCII text). Take a
    look at the example.ncd file that gets installed with NI-CAN
    (<ProgramFiles>\National Instruments\NI-CAN\):
    <?xml version="1.0" encoding="UTF-8"?>
    <nican_config version="0.1">
    <saved>8/8/2005,17:58</saved>
    <message name="TransmissionFluids">
      <id extended="0">82</id>
      <dbc>C:\Program Files\National Instruments\NI-CAN\example.ncd</dbc>
      <conflicts>0</conflicts>
      <bytes>6</bytes>
      <interface>1</interface>
      <comment></comment>
      <channel name="ClutchPressure">
        <conflicts>0</conflicts>
        <bitfield start="0" bits="8" order="0" type="1"/>
        <linear_scaling factor="1.600000e+001"
    offset="0.000000e+000" max="4.000000e+003" min="0.000000e+000"
    default="0.000000e+000" unit="kPa"/>
        <comment></comment>
      </channel>
    </message>
    </nican_config>
    Thus, you could generate *.ncd files with simple file I/O. Having XML-specific file I/O functions simplifies this task.
    -B2k

  • Does we need to Create a file Before using Open dataSet

    Hi Guys,
                Can  any body tell me whether we have to create a File before using Open dataset  for writing files in Application Server.
               Can anybody write a program for EKPO table to store it in application Server using OpendatasSet ?Is there any specific care we have to take for Executing   pgm in Background?
    I wrote the pgm for Foreground using GUI- Download.
    PGM.
          select * into table it_ekpo  from  ekpo .
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename ='c:\EKPO.xls'
    filetype = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    data_tab = it_ekpo
    *fieldnames = l_heading
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3 .
                       Plzzzzzzzzz Make the changes for existing Pgm.any help is awarded with points.Its Urgent.
    Thanks,
    Gopi.

    Hi Guys,
                 Thanks for ur immediate response.I am sending the code just confirm me whether is correct r not?
    DATA : wa_EKPO_file   TYPE file_table-filename.
    select * into table it_ekpo  from  ekpo .
      OPEN DATASET wa_EKPO_file FOR OUTPUT         "Write to appl. server
                                          IN TEXT MODE
                                          ENCODING DEFAULT.  "Open dataset Return code
    IF sy-subrc = 0.
    LOOP at IT_EKPO into WA_EKPO.
    TRANSFER wa_ekpo to wa_ekpo_file.
    ENDLOOP.
    ENDIF.
                                             I want write the data into SPREAD Sheet .Can u guys  tell me how to write into Spread Sheet using Open data Set.
    Thanks,
    Gopi.

  • Creating a file download link on jsp

    I have the following on my jsp. The code worked fine until I tried to use it in a new html design page.
    <code>
    //page name is index.jsp
    try //DISPLAY THE CONTENTS OF THE DATA DIRECTORY
    File dirname = new File(PATH); // create an instance of the File class
    if (dirname.exists()&&dirname.isDirectory())//check to see if File class dirname exists and is valid
    String [] allfiles = dirname.list();//create an array of files in the dirname File class
              for (int i=0; i< allfiles.length; i+=2)//loop through allfiles[] and print out file links
    out.println("<br><table border='1' cellspacing='1' width='99%'>");
                   out.println("<tr><td width='50%' class='pageFont'><input type='checkbox' name='cb' value='"+allfiles[i]+"'>"+allfiles[i]+"      ");
    %>
    <a class="a" href="index.jsp?downfile=C:\\data\\<%=allfiles[i+1]%>">DOWNLOAD</a></td>
    <% if(i+1 < allfiles.length)//PRINTS OUT THE SECOND TD SO THAT WE HAVE 2 COLUMNS OF LINKS
    out.println("<td width='50%' class='pageFont'><input type='checkbox' name='cb' value='"+allfiles[i+1]+"'>"+allfiles[i+1]+"      ");
    %>
    <a class="a" href="index.jsp?downfile=C:\\data\\<%=allfiles[i+1]%>">DOWNLOAD</a></td></tr>
    <%
    out.println("</form></font></table>");
    catch (IOException excep)
         out.println("An IO exception has occured.");
    </code>
    Then when clicked this code is run:
    <code>
    try{
    //CHECK TO SEE IF THE FILE HAS BEEN CLICKED TO DOWNLOAD SINGLE FILE
    if (request.getParameter("downfile") != null)
    String filePath = request.getParameter("downfile");
    File f = new File(filePath);//CREATE AN INSTANCE OF THE FILE CLASS AND POINT IT TO THE LOCATION OF THE DIRECTORY CONTAINING THE FILES
    if (f.exists() && f.canRead())
    response.setContentType ("application/octet-stream");
    response.setHeader ("Content-Disposition", "attachment;filename=\""+f.getName()+"\"");
    response.setContentLength((int) f.length());
    BufferedInputStream fileInputStream = new BufferedInputStream(new FileInputStream(f));
    int i;
    out.clearBuffer();
    while ((i = fileInputStream.read()) != -1) out.write(i);
    fileInputStream.close();
    out.flush();
    </code>
    When I click on this link I get the download dialog box. If I open it I get the following open up in notepad(the files I am trying to give download links are .txt files)
    Below is what is displayed in notepad ALL on 1 line:
    <html>
    <head>
    <LINK rel="stylesheet" ty
    That is displayed in all of the links that I click on. It is the first few lines of html code for index.jsp.
    I know this code is probably not a good way of doing what I need but I got it to work fine until the change.
    I am sure there is an easier way to code the download link without resubmitting the page.
    Thanks in advance!!

    Well all was fine with this jsp until I moved it to ApacheJServ. Now the problem has resurfaced(although it is a little different now)
    I had moved the following code to the top of my page:
    //CHECK TO SEE IF EITHER DOWNFILE OR ZIPFILE VARIABLE EXIST, AND IF THEY DO SET CONTENT TYPE BEFORE SENDING ANY HTML CODE TO THE BROWSER
    try{
    //CHECK TO SEE IF THE FILE HAS BEEN CLICKED TO DOWNLOAD SINGLE FILE
        if (request.getParameter("downfile") != null)
                String filePath = request.getParameter("downfile");
                File f = new File(filePath);//CREATE AN INSTANCE OF THE FILE CLASS AND POINT IT TO THE LOCATION OF THE DIRECTORY CONTAINING THE FILES
                    if (f.exists() && f.canRead())
                        response.setContentType ("application/octet-stream");
                        response.setHeader ("Content-Disposition", "attachment;filename=\""+f.getName()+"\"");
                        response.setContentLength((int) f.length());
                        BufferedInputStream fileInputStream = new BufferedInputStream(new FileInputStream(f));
                        int i;
                        out.clearBuffer();
                        while ((i = fileInputStream.read()) != -1) out.write(i);
                            fileInputStream.close();
                            out.flush();
                            response.flushBuffer();
    catch (Exception e){}
    //This is where the java code ends and the javascript/html code begins.Then further into the page I create the file download links like so:
                            <a class="a" href="main.jsp?downfile=C:\\data\\<%=allfiles[i+1]%>">DOWNLOAD</a>I know this isnt a secure way of doing this but I am on a intranet.
    The problem I am having now is that when I click on one of the links and download the file and then open it, I get the contents of the file plus concatenated to the end of it is the first few HTML lines of the actual jsp that I downloaded the file from. Before I was just getting the first few lines of html from the jsp, not the actual contents of the downloaded file.
    This is an example of what I am getting:
    This is the contents of the file that I downloaded.//This is where the file contents ends.
    <html>
    <head>
    <LINK rel="stylesheet" type="text/css" href="default.css">
    <script language="JavaScript1.2">
    //function that allows user to select all checkboxes
    function doIt(v)
    for(var i=0;i<document.form1.cb.length;i++)
       document.form1.cb.checked=eval(v);
    function swap(imageName,image)
    imageName.src = "templateImages/"+image;
    function imageOver(imageSrc, imageName)
         changeImage = new Image();
         changeImage.src = imageSrc;
         document.images[imageName].src = changeImage.src;
    var hide = true;
    function hideShow( ) /
    Any morre ideas?
    TIA!
    BTW, I went to ApacheJServ because they wont let me use tomcat :(

  • Creating A File Resource Using Tomcat JNDI

    Hi guys,
    My problem is that I am creating a web service and I cannot get to a properties file without creating an absolute reference to that file. If I was creating a servlet I would simple use getServletContext() method to get a relative reference to it. However since it is an axis web service i have to deploy my applications in the WEB-INF/services directory, and because it does not interact with the axis servlet I cannot use getServletContext(). So i thought I could create a JNDI file resource reference in the tomcatHome/conf/context.xml file, similar to how I created a JNDI connection pool. The resouce definition looks like this;
    <Resource name="resource/dialogueEngineConfig" auth="Container"
                      type="java.io.File"
                      url="file:/Applications/apache-tomcat-5.5.1/webapps/axis2/META-INF/DialogueEngine.properties">
    </Resource>now I tried to access the resource in my code like this;
    // Obtain our environment naming
    Context envCtx = (Context) new InitialContext().lookup("java:comp/env");
    // Look up our file
    File  f = (File) envCtx.lookup("resource/dialogueEngineConfig");However I get a NamingException; 'Cannot create resource instance'
    I don't understand why I cant create a file resource in JNDI, it seems like a simple enough thing to do. Am I doing something wrong or missing something? Any help would be greatly appreciated.
    Thanks

    Hello xalien,
    I have the same problem. I need to access external xml config file via JNDI from my servlet, running on Tomcat 5.0.28. Have you manage to define an URL resource? If so, please provide an example how to do it. Many thanx.

  • Create a file xml using dbms_xmldom

    i'm using dbms_xmldom to create a file xml. i use to create a node this line:
    IV_element:= dbms_xmldom.createElement(doc,'CATEGORIA');
    dbms_xmldom.setAttribute(IV_element, 'natura','prova');
    IV_node:=dbms_xmldom.appendChild(III_node,dbms_xmldom.makeNode(IV_element));
    where
    doc dbms_xmldom.DOMDocument;
    IV_node dbms_xmldom.DOMNode;
    IV_element dbms_xmldom.DOMElement;
    and i have a line
    <CATEGORIA natura="prova"/>
    how can i have this line?
    <CATEGORIA natura="prova">prova categoria</CATEGORIA>
    thank you

    try this.
    ap0021_element := dbms_xmldom.createElement(doc,'AP0021');
    cntbtch_element := dbms_xmldom.createElement(doc,'CNTBTCH');
    new_element := DBMS_XMLDOM.makeElement(
                      DBMS_XMLDOM.appendChild(DBMS_XMLDOM.makeNode(ap0021_element)
                     ,DBMS_XMLDOM.makeNode(cntbtch_element)));

  • Automatic created Java file error when compile JSP file

    I got the following error message when i try to load the JSP file given below (FlightSearch.jsp). Given also below the JAVA files (flightsearch$jsp.java) created by the compiler.
    Thanks for your help
    Susan
    Error message
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:320: 'catch' without 'try'.
    } catch (Throwable t) {
    ^
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:328: 'try' without 'catch' or 'finally'.
    ^
    C:\jakarta-tomcat\work\client\localhost\client\client\flightsearch$jsp.java:328: '}' expected.
    ^
    3 errors, 1 warning
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
    at java.lang.Thread.run(Thread.java:536)
    FlightSearch.jsp
    <%@page import="java.util.*" errorPage="ErrorHandler.jsp"%>
    <%@page import="com.client.entity.Flight"%>
    <%@page import="com.client.wsclient.FlightServiceClient"%>
    <H3>Available Flight List</H3>
    <br>We have found the following Available flight(s) : </br>
    <table border="0" cellpadding="0" cellspacing="0" width="100">
    <tr>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Flight Company</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Flight Number</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Depart From<font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrive</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Departure Date</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Departure Time</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrival Date</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Arrival Time</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Adult Fare</font></b></td>
    <td width="10%" bgcolor="#808080"><b><font color="#FFFFFF">Child Fare</font></b></td>
    </tr>
    <%
    //Get the search information
    String des = request.getParameter("DFrom");
    String arr = request.getParameter("DTo");
    String fy = request.getParameter(FYear.value);
    String fm = request.getParameter(FMonth.value);
    String fd = request.getParameter(FDay.value);
    String f1 = fy + "-" + fm;
    String FDat = f1 + "-" + fd;
    String ty = request.getParameter(TYear.value);
    String tm = request.getParameter(TMonth.value);
    String td = request.getParameter(TDay.value);
    String t1 = ty + "-" + tm;
    String TDat = t1 + "-" + td;
    String type;
    if( request.getParameter(type[0].checked))
    type = "Return";
    else
    { type = "OneWay";
    String clas;
    if(request.getParameter(clas[0].checked))
    {clas = "ECO";
    else
    {clas = "BUSS";}
    String adult = request.getParameter(Adult.value);
    String child = request.getParameter(Child.value);
    //Get the server Flight Search Service URL
    // ServerFlightSearchBO SFSBO = new ServerFlightSearchBO();
    // ServerFlightSearch FlightSearch = SFSBO.getFlightSearchURL();
    // FlightSearchServiceClient FSearchServiceClient = new FlightSearchServiceClient
    String ServerFlightServiceURL = "http://localhost:7080/AServer/services/FlightService";
    //Find available Flight
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(des, arr, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    %>
    <tr>
    <td width= "10%"><%=flt.getFlightComp()%></td>
    <td width= "10%"><%=flt.getFlightNum()%></td>
    <td width= "10%"><%=flt.getDestination()%></td>
    <td width= "10%"><%=flt.getArrive()%></td>
    <td width= "10%"><%=flt.getFrDate()%></td>
    <td width= "10%"><%=flt.getFlightDptTm()%></td>
    <td width= "10%"><%=flt.getToDate()%></td>
    <td width= "10%"><%=flt.getFlightArrTm()%></td>
    <%
    int adt, chld;
    int far_A, tot_A, far_C, tot_C;
    adt = Integer.parseInt(adult);
    far_A = flt.getAdultFr();
    tot_A = adt * far_A;
    chld = Integer.parseInt(child);
    far_C = flt.getChildFr();
    tot_C = chld * far_C;
    %>
    <td width= "10%"><%=tot_A%></td>
    <td width= "10%"><%=tot_C%></td>
    </tr>
    <%
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    %>
    <tr>
    <td width= "10%"><%=flt.getFlightComp()%></td>
    <td width= "10%"><%=flt.getFlightNum()%></td>
    <td width= "10%"><%=flt.getFlightDpt()%></td>
    <td width= "10%"><%=flt.getFlightArr()%></td>
    <td width= "10%"><%=flt.getFlightDptDt()%></td>
    <td width= "10%"><%=flt.getFlightDptTm()%></td>
    <td width= "10%"><%=flt.getFlightArrDt()%></td>
    <td width= "10%"><%=flt.getFlightArrTm()%></td>
    <%
    int adlt, chd;
    int fare_A, totA, fare_C, totC;
    adlt = Integer.parseInt(adult);
    fare_A = flt.getAdultFr();
    totA = adlt * fare_A;
    chd = Integer.parseInt(child);
    fare_C = flt.getChildFr();
    totC = chd * fare_C;
    %>
    <td width= "10%"><%=totA%></td>
    <td width= "10%"><%=totC%></td>
    </tr>
    <%
    %>
    </table>
    flightsearch$jsp.java
    package org.apache.jsp;
    import java.util.*;
    import com.client.entity.Flight;
    import com.client.wsclient.FlightServiceClient;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import org.apache.jasper.runtime.*;
    public class flightsearch$jsp extends HttpJspBase {
    static {
    public flightsearch$jsp( ) {
    private static boolean jspxinited = false;
    public final void jspxinit() throws org.apache.jasper.runtime.JspException {
    public void _jspService(HttpServletRequest request, HttpServletResponse response)
    throws java.io.IOException, ServletException {
    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    String _value = null;
    try {
    if (_jspx_inited == false) {
    synchronized (this) {
    if (_jspx_inited == false) {
    jspxinit();
    jspxinited = true;
    _jspxFactory = JspFactory.getDefaultFactory();
    response.setContentType("text/html;ISO-8859-1");
    pageContext = _jspxFactory.getPageContext(this, request, response,
    "ErrorHandler.jsp", true, 8192, true);
    application = pageContext.getServletContext();
    config = pageContext.getServletConfig();
    session = pageContext.getSession();
    out = pageContext.getOut();
    // HTML // begin [file="/client/flightsearch.jsp";from=(0,59);to=(1,0)]
    out.write("\r\n");
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(1,43);to=(2,0)]
    out.write("\r\n");
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(2,58);to=(19,0)]
    out.write("\r\n\r\n<H3>Available Flight List</H3>\r\n<br>We have found the following Available flight(s) : </br>\r\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100\">\r\n <tr>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Flight Company</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Flight Number</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Depart From<font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrive</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Departure Date</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Departure Time</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrival Date</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Arrival Time</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Adult Fare</font></b></td>\r\n <td width=\"10%\" bgcolor=\"#808080\"><b><font color=\"#FFFFFF\">Child Fare</font></b></td>\r\n </tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(19,2);to=(66,0)]
    //Get the search information
    String des = request.getParameter("DFrom");
    String arr = request.getParameter("DTo");
    String fy = request.getParameter(FYear.value);
    String fm = request.getParameter(FMonth.value);
    String fd = request.getParameter(FDay.value);
    String f1 = fy + "-" + fm;
    String FDat = f1 + "-" + fd;
    String ty = request.getParameter(TYear.value);
    String tm = request.getParameter(TMonth.value);
    String td = request.getParameter(TDay.value);
    String t1 = ty + "-" + tm;
    String TDat = t1 + "-" + td;
    String type;
    if( request.getParameter(type[0].checked))
    type = "Return";
    else
    { type = "OneWay";
    String clas;
    if(request.getParameter(clas[0].checked))
    {clas = "ECO";
    else
    {clas = "BUSS";}
    String adult = request.getParameter(Adult.value);
    String child = request.getParameter(Child.value);
    //Get the server Flight Search Service URL
    // ServerFlightSearchBO SFSBO = new ServerFlightSearchBO();
    // ServerFlightSearch FlightSearch = SFSBO.getFlightSearchURL();
    // FlightSearchServiceClient FSearchServiceClient = new FlightSearchServiceClient
    String ServerFlightServiceURL = "http://localhost:7080/AServer/services/FlightService";
    //Find available Flight
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(des, arr, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(66,2);to=(68,18)]
    out.write("\r\n<tr>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(68,21);to=(68,40)]
    out.print(flt.getFlightComp());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(68,42);to=(69,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(69,21);to=(69,39)]
    out.print(flt.getFlightNum());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(69,41);to=(70,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(70,21);to=(70,41)]
    out.print(flt.getDestination());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(70,43);to=(71,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(71,21);to=(71,36)]
    out.print(flt.getArrive());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(71,38);to=(72,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(72,21);to=(72,36)]
    out.print(flt.getFrDate());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(72,38);to=(73,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(73,21);to=(73,41)]
    out.print(flt.getFlightDptTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(73,43);to=(74,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(74,21);to=(74,36)]
    out.print(flt.getToDate());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(74,38);to=(75,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(75,21);to=(75,41)]
    out.print(flt.getFlightArrTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(75,43);to=(76,1)]
    out.write("</td>\r\n ");
    // end
    // begin [file="/client/flightsearch.jsp";from=(76,3);to=(87,1)]
    int adt, chld;
    int far_A, tot_A, far_C, tot_C;
    adt = Integer.parseInt(adult);
    far_A = flt.getAdultFr();
    tot_A = adt * far_A;
    chld = Integer.parseInt(child);
    far_C = flt.getChildFr();
    tot_C = chld * far_C;
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(87,3);to=(88,18)]
    out.write("\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(88,21);to=(88,26)]
    out.print(tot_A);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(88,28);to=(89,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(89,21);to=(89,26)]
    out.print(tot_C);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(89,28);to=(91,0)]
    out.write("</td>\r\n</tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(91,2);to=(100,0)]
    if(type = "Return")
    FlightServiceClient client = new FlightServiceClient(ServerFlightServiceURL);
    ArrayList list = client.getFlight(arr, des, FDat, TDat, type, clas, adult, child);
    Iterator it = list.iterator();
    while (it.hasNext()){
    Flight flt = (Flight)it.next();
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(100,2);to=(102,18)]
    out.write("\r\n<tr>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(102,21);to=(102,40)]
    out.print(flt.getFlightComp());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(102,42);to=(103,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(103,21);to=(103,39)]
    out.print(flt.getFlightNum());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(103,41);to=(104,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(104,21);to=(104,39)]
    out.print(flt.getFlightDpt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(104,41);to=(105,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(105,21);to=(105,39)]
    out.print(flt.getFlightArr());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(105,41);to=(106,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(106,21);to=(106,41)]
    out.print(flt.getFlightDptDt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(106,43);to=(107,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(107,21);to=(107,41)]
    out.print(flt.getFlightDptTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(107,43);to=(108,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(108,21);to=(108,41)]
    out.print(flt.getFlightArrDt());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(108,43);to=(109,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(109,21);to=(109,41)]
    out.print(flt.getFlightArrTm());
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(109,43);to=(110,1)]
    out.write("</td>\r\n ");
    // end
    // begin [file="/client/flightsearch.jsp";from=(110,3);to=(120,1)]
    int adlt, chd;
    int fare_A, totA, fare_C, totC;
    adlt = Integer.parseInt(adult);
    fare_A = flt.getAdultFr();
    totA = adlt * fare_A;
    chd = Integer.parseInt(child);
    fare_C = flt.getChildFr();
    totC = chd * fare_C;
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(120,3);to=(121,18)]
    out.write("\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(121,21);to=(121,25)]
    out.print(totA);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(121,27);to=(122,18)]
    out.write("</td>\r\n <td width= \"10%\">");
    // end
    // begin [file="/client/flightsearch.jsp";from=(122,21);to=(122,25)]
    out.print(totC);
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(122,27);to=(124,0)]
    out.write("</td>\r\n</tr>\r\n");
    // end
    // begin [file="/client/flightsearch.jsp";from=(124,2);to=(126,0)]
    // end
    // HTML // begin [file="/client/flightsearch.jsp";from=(126,2);to=(127,8)]
    out.write("\r\n</table>");
    // end
    } catch (Throwable t) {
    if (out != null && out.getBufferSize() != 0)
    out.clearBuffer();
    if (pageContext != null) pageContext.handlePageException(t);
    } finally {
    if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);

    i am very glad and appreciate for your help, but i would like to know how to get the value of a radio button.
    like in another JSP file i have :
    <input type="radio" name="type" value="Return" checked>
    Return
    <input type="radio" name="type" value="OneWay">
    One Way
    and when i try to get the value which is checked, i put
    String type = request.getParameter(type.checked);
    but this doesn't work,
    i would be very appreciate for your help. Thank you

  • Create XML file by using servlet

    Hi, Is there anyone who sucessfully create XML file by taking parameters from a web form? If so, hope you could share the code with me. I moved the code from the example to servlet. it keeps returning null pointer exception on the root node.
    java.lang.NullPointerException: at oracle.xml.classgen.CGDocument.(CGDocument.java:62)
    null

    Hi everybody,<br /><br />the code works good now. so it should be available for everybody who needs it:<br /><br />---------------- my code --------------------------------------<br /><br />var container = "";<br /><br />container = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";<br />container = container + "<all>\n";<br />container = container + "<header>\n";<br />container = container + "<author>author name</author>\n";<br />container = container + "<authorMail>[email protected]</authorMail>\n";<br />container = container + "</header>\n";<br />container = container + "<body>\n";<br />container = container + "<name>" + value + "</name>\n";<br />container = container + "<adresse>" + value + "</adresse>\n";<br />container = container + "<ort>" + value + "</ort>\n";<br />container = container + "<staat>" + value + "</staat>\n";<br />container = container + "<plz>" + value + "</plz>\n";<br />container = container + "<land>" + value + "</land>\n";<br />container = container + "</body>\n";<br />container = container + "</all>\n";<br /><br />var myDoc = event.target;<br />myDoc.createDataObject("export.xml", container);<br />myDoc.exportDataObject("export.xml");<br /><br />app.mailMsg(false, "mail-address1; mail-address2", "", "",<br />"mail subject", "mail body");<br /><br />---------------- end of my code ------------------------------- <br /><br />now i'm looking for a solution to automatically attach the file to this mail and directls sent it without to call up the mail client.<br />if anybody has got an hint, you're welcome ;-)

  • How to create SDA file for using AXIS Framework in the SOAP Adapter

    Hi experts,
    I have the following question:
    How I can create the SDA file aii_af_axisprovider.sda for using the AXIS Framework in the SOAP Adpater described in http://help.sap.com/saphelp_nw04/helpdata/en/45/a4f8bbdfdc0d36e10000000a114a6b/content.htm ?
    I have downloaded the files axis.jar, commons-discovery-0.2.jar, commons-logging-1.0.4.jar, commons-net-1.0.0-dev.jar and wsdl4j-1.5.1.jar. But how to create the SDA file aii_af_axisprovider.sda? Which tool I have to use for this? It is enough to compress these 5 jar-files in the sda file or need I further files with further information (meta information etc.)?
    Thanks and best regards
    Christopher

    Hi Christopher,
        Check this discussion if you have not checked already.
    Re: NTLM Authentication dosent work with XI ?
    Regards,
    Ravi

  • JAR file to use in JSP

    I have several JAR files(say parser.jar,xerces_1_2.jar, xerces_1_2_0.jar) with the same set of libraries in my tomcat/lib folder. They belong to different versions. I want to use a specific JAR file, say xerces_1_2.jar, in my JSP page irrespective of the order in which they are specified in the classpath. How do I do this? Thanks a buunch!

    Well I have all those JAR file in the lib folder. The problem is I need my JSP file to pick the exact JAR file (xcerces_1_2.jar) rather than the one assigned by tomcat. How do I do that? Thanks.

  • Can't create a file by using BufferedWriter

    Hello,
    I am going to create a new html file "C:\test1.html" by modifying the old file "C:\test.html".
    However I have not seen the file in the c driver.
    Thanks for any help.
    import java.awt.Point;
    import java.io.*;
    import java.util.*;
    public class AddIdinHtml
         private File file1;
    //     private File file2;
    //     private HashMap<String, Double> sta;
         public void AddId() {
    //     public void AddIdinHtml(String FileName, String Directory) {
         String path = System.getProperty("user.dir");
          try{
    //      String filenames = path+'/'+Directory+'/'+FileName;
              String filenames = "C:\\test.html";
          FileInputStream fstream = new FileInputStream(filenames);
        // Get the object of DataInputStream
            DataInputStream in = new DataInputStream(fstream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
            String Line;
            String secondLine;
    //        firstLine = br.readLine();
            String[] parts;
            String[] newLines;
            int lineId = 0;
            List contents = new ArrayList();
            while ((Line = br.readLine()) != null)   {
                Line = Line.trim();
                contents.add(Line);
                if(Line.startsWith("<body")){
                    while ((Line.startsWith("</body")!= true)) {
                        Line = br.readLine();
    //                System.out.println(Line);
                    parts = Line.split("\\s");
                    if(Line.startsWith("<p")){
                       Line = "<p"+" "+"id="+lineId+Line.substring(2,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<li")){
                       Line = "<li"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<li")){
                       Line = "<li"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<h1")){
                       Line = "<h1"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<h2")){
                       Line = "<h2"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<h3")){
                       Line = "<h3"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<h4")){
                       Line = "<h4"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<h5")){
                       Line = "<h5"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<h6")){
                       Line = "<h6"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<div")){
                       Line = "<div"+" "+"id="+lineId+Line.substring(4,Line.length());
                       contents.add(Line);
                       System.out.println(Line);
                       lineId++;
                    else if (Line.startsWith("<table")){
                       Line = "<table"+" "+"id="+lineId+Line.substring(6,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<tr")){
                       Line = "<tr"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<th")){
                       Line = "<th"+" "+"id="+lineId+Line.substring(3,Line.length());
                       contents.add(Line);
                       lineId++;
                    else if (Line.startsWith("<td")){
                       Line = "<td"+" "+"id="+lineId+Line.substring(4,Line.length());
                       contents.add(Line);
                       lineId++;
    //            contents.add(Line);
                lineId++;
             file1 = new File("C:\\test1.html");
                if(file1.exists())//to judge if difference file exists,delete it
                    file1.delete();
             FileWriter outFile1 = new FileWriter(file1,true);
                BufferedWriter out1 = new BufferedWriter(outFile1);
               newLines = (String[]) contents.toArray(new String[contents.size()]);
               StringBuffer buffer2 = new StringBuffer();
               for(String rec : newLines){
                     buffer2.append(rec);
                     buffer2.append("\n");
                     out1.write(buffer2.toString());
                     out1.flush();
              in.close();
        }catch (Exception e){//Catch exception if any
          System.err.println("Error1: " + e.getMessage());
        public static void main(String[] args){
            AddIdinHtml ad = new AddIdinHtml();
            ad.AddId();
    }

    kajbj,
    you are right. It is not executing.
    I added one printing but no output.for(String rec : newLines){
                      StringBuffer buffer2 = new StringBuffer();
                     buffer2.append(rec);
                       System.out.println("test");// no printing here
                     buffer2.append("\n");
                     out1.write(buffer2.toString());
                     out1.flush();
               }but why?

  • Creating UDL file for use of HFMCopyApplication utility

    I'm trying to create the UDL file on the HFM server to link to the SQL database where HFM sits.
    I followed the instructions and created a new text document, rename it as extension .udl. According to the instruction, I'm supposed to double click on this new file and an data link property window will appear. But all I see is still a blank text document.
    Am I missing something? In the past I always asked our application support guys to do that but now I have to figure it out myself....
    Thanks!

    Hi,
    The reason to rename the file to .UDL is that the UDL extension should be mapped to an application that will let you make a database connection.
    You either have one of two problems if double clicking on the UDL file opened in Notepad:
    #1 - At some point .UDL file extensions were mapped to point to Notepad (or whatever text editor the file opened in) [I'm doubtful this is the problem]
    #2 - In Windows Explorer you do not have file extensions visible; therefore, when you renamed your file, it didn't rename it the way you wanted it to. For instance instead of renaming database.txt to database.udl, you ended up with database.udl.txt This file would still open in Notepad as .TXT is associated with Notepad (or other text editor).
    IF #2 is the problem, do the following:
    #1 - Open a File Explorer window and navigate to the folder with the UDL file.
    #2 - Click on Tools
    #3 - Folder Options
    #4 - Click on View
    #5 - Make sure 'Hide extensions for known file types' is unchecked.
    #6 - Hit OK
    #7 - Refresh the File explorer window and note the filename.
    #8 - If the filename is something like .UDL.txt, rename it to remove te .txt.
    If #1 is the issue: (Note : I'm giving you windows 7 version which may be different than XP, but it should still be in the control panel somewhere)
    #1 - Open Control Panel
    #2 - Open Default Programs
    #3 - Open Set Associations
    (NOTE: Instead of steps 1-3 click Start and type in associations and one of the results will be to set file associations)
    #4 - Locate the .UDL file extension and confirm it is set as Microsoft Data Link, OLE DB Core Services
    ---IF NOT set to OLE DB Core Services --
    #5 - Click on Change Program
    #6 - Select OLE DB Core Services from Recommended Programs List

  • How to create pdf files dynamically using Java

    I am new to java world. I got a task of generating dynamic pdf files using Java. I have tried with some third party APIs for generating pdf. But most of them are not so feasable. I am looking for source code for one such APIs so that I can build my custom requirements over it.
    Thanks

    I am new to java world. I got a task of generating
    dynamic pdf files using Java. I have tried with some
    third party APIs for generating pdf. But most of
    them are not so feasable. Which ones? What was wrong with them?
    I am looking for source
    code for one such APIs so that I can build my custom
    requirements over it.What are your exact requirement?

  • Create pdf file dynamically using XML

    Hi Experts,
    I have a Webdynpro application where I want to print the data for 'N' number of employees using adobe interactive forms. I have designed the form for one employee. I want to use the same format for the rest of the employees. Can any body please guide me how to go about this.
    Regards,
    Abdullah

    In your context , create a node <b>MasterNode</b> of cardinality <b>1...1</b> and <b>singleton</b> set to <b>true</b>. Bind this to the <b>dataSource</b> property of the <b>InteractiveFormElement</b>.
    Inside this <b>MasterNode</b> create a node <b>Data</b> of cardinality <b>0...n</b> and <b>singleton</b> set to <b>false</b>. Keep all of your payslip attributes inside this node.
    In your interactive form element , in the Body Page create a subform of Type <b>Flow Content</b> and Flow Direction <b>Table</b> .Check the chechbox  for <b>Allow Page Breaks within Context</b> . Inside this subform create another subform of Type <b>Flow Content</b> and Flow Direction <b>Western Text</b> . Uncheck the checkbox for <b>Allow Page Breaks within Context</b> . Put all of your pay slip UI elements inside this subform and bind them with the attributes under the node Data. Also tick the property of the inner subform under the section Object->Subform that says <b>Repeat Subform for each Data Item</b>
    In your view controller coding area , create an element of the node Data for each employee record and populate it with values for the particular employee .  
    Add all of the elements that you created into an ArrayList and bind this ArrayList to the node Data. Now your form is ready for n number of employees.
    Put this sort of coding in your view controller coding:
    IDataElement objData = null;
    ArrayList arlData = null;
    int intNumberOfEmployees=0;
    try
            arlData = new ArrayList();
            intNumberOfEmployees = //Get size of your model node that returns employee info
            if(intNumberOfEmployees>0)
                    for(int i=0;i<intNumberOfEmployees;i++)
                            objData  = wdContext.createDataElement();
                            objData.setName("//Value fetched from backend here");//Eg:wdContext.nodeEmployeeInfo.getEmployeeInfoElementAt(i).getname()
                            //Similarly set all of the values
                            arlData.add(objData);
            wdContext.nodeData.bind(arlData);

Maybe you are looking for