Announcement Announcement Module
Collapse
No announcement yet.
Prototype javascript Jsp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Prototype javascript Jsp

    Hi All,

    Prototype & JSP

    abc.jsp
    new Ajax.Updater("list","/link_prototype/abc1.jsp",
    { asynchronous:true,
    evalScripts:true });

    <div id="list"></div>
    abc1.jsp
    <%
    out.println("Hello");
    %>
    This Works Fine.
    -----------------------------------------------------------------
    But,

    userList.jsp
    new Ajax.Updater( 'userList',
    '/users/userTable.jsp',
    {
    }
    );
    <div id="userList">
    </div>

    userTable.jsp
    <%
    out.println("<div class='mainTable'>");
    out.println("<div class='tH'>User Management</div>");
    out.println("<table cellspacing='1' border='0' width='50%'>");
    out.println(" <tr>");
    out.println(" <th>Username</th>");
    out.println(" <th>Password</th>");
    out.println(" </tr>");

    try
    {
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/forum","root","root");
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery("select username,password from users");
    while(rs.next())
    {
    out.println(" <tr>");
    out.println(" <td class='col_1' style='padding: 4px; text-align: center;'>");
    out.println( rs.getString(1));
    out.println(" </td>");
    out.println(" <td class='col_2' style='padding: 4px; text-align: center;'>");
    out.println( rs.getString(2));
    out.println(" </td>");
    out.println(" </tr>");
    }
    rs.close();
    st.close();
    con.close();
    }
    catch(Exception e)
    {
    System.out.println(e);
    }

    out.println(" </table>");
    out.println("</div>");
    %>



    This doesn't work.............................


    Any Suggestions.............................

    thanks
    srinath.v
Working...
X