Dynamic inludes in JSP

Is there any ability to conduct dynamic includes in JSP pages?
I mean that include should go or not in runtime depending on the some condition.

yes.

Similar Messages

  • Need Dynamic Table in JSP page

    Hi Friends,
    I need to build table dynamically in my JSP page.
    My requirement like:
    I have a Button in my JSP page when i click that it should go to another jsp where it will ask me the row and column counts, after i entered some values then i have a button to say OK it should go to the first page again there i want the table for the rows and columns dynamically.
    (like MS- Word when u create table it will ask the row count and column count after that its building a table)
    Please help me....

    Make use of JSTL's c:forEach.

  • How to create two level dynamic list using JSP , Java Script and Oracle

    I am new in JSP. And i am facing problem in creating two level dynamic list using JSP ,Java Script where the listdata will come from Oracle 10g express edition database. Is there any easy way in JSP that is available on in ASP.NET.
    Plz response with details.

    1) Learn JDBC API [http://java.sun.com/docs/books/tutorial/jdbc/index.html].
    2) Create DAO class which contains JDBC code and do all SQL queries and returns or takes ID's or DTO objects.
    3) Learn Servlet API [http://java.sun.com/javaee/5/docs/tutorial/doc/].
    4) Create Servlet class which calls the DAO class, gets the list of DTO's as result, puts it as a request attribute and forwards the request to a JSP page.
    5) Learn JSP and JSTL [http://java.sun.com/javaee/5/docs/tutorial/doc/]. Also learn HTML if you even don't know it.
    6) Create JSP page which uses the JSTL c:forEach tag to access the list of DTO's and iterate over it and prints a HTML list out.
    You don't need Javascript for this.

  • Servlet with no dynamic code inside jsp pages

    Hello,
              I saw that a servlet is created even if there is no dynamic code inside jsp pages (scriplets & tags). Is it possible to avoid it on bea side ? (I am using portal 8).
              By the way, do you know if is it possible to define apache in order to avoid to send to bea the jsp which have no dynamic code inside ?
              thank you !

    JSP's always generate a servlet on all web containers. Apache/Tomcat is no
              different. If you have static content, make it an HTML page.
              Bill
              "hournon jc" <[email protected]> wrote in message
              news:22255787.1103297053148.JavaMail.root@jserv5...
              > Hello,
              >
              > I saw that a servlet is created even if there is no dynamic code inside
              jsp pages (scriplets & tags). Is it possible to avoid it on bea side ? (I am
              using portal 8).
              >
              > By the way, do you know if is it possible to define apache in order to
              avoid to send to bea the jsp which have no dynamic code inside ?
              >
              > thank you !
              

  • How we can generate dynamic menu in jsp page

    Hi all,
    how we can generate dynamic menu in jsp page.
    Thanks
    Manjinder

    by reading more about them on the web or in a good book, OR BY HIRING SOMEBODY TO DO SO. ;)

  • Dynamic Formatting of jsp

    How do i format elements in a jsp dynamically in a jsp.
    For ex
    <td width=100% colspan=18>
    <%= titleName %>
    </td>Instead of specifying colspan as 18, i want it to automatically adjust according to the length of the word (titleName).
    Thank You

    Use EL.
    colspan=${someDynamicValue}And replace that scriptlet by EL. Writing raw Java code in JSP files is a bad practice.

  • Store dynamic value in jsp

    hi,
    i have two page i pass value from one page to another and got it. now i want to store that dynamic value which i pass. i store it and got it my problem is that when page submit then value become null.
    i have three submit button.
    my code is
    <%@ page import ="javax.servlet.*;"  %>
    <%@ page import ="javax.servlet.http.*;" %>
    <%@ page import ="java.io.*;" %>
    <%@ page import ="java.sql.*;" %>
    <%!   Connection con = null;
        ResultSet rs;
        Statement stmt = null;
        String query = null;
        ResultSet rs1;
        Statement stmt1 = null;
        String query1 = null;
        ResultSet rs2;
        Statement stmt2 = null;
        String query2 = null;
    %>
    <input type="hidden" value="<%=request.getParameter("ID")%>" name="id_4_add" />
    <%String datamt = request.getParameter("id_4_add");%>
    <input type="hidden" value="<%=datamt%>" name="id_4_" />
    <%String datamt1 = request.getParameter("id_4_");%>
    <input type="hidden" value="<%=datamt1%>" name="id_4_1" />
    <%String datamt2 = request.getParameter("id_4_1");%>
    <%
                String data1 = request.getParameter("ID");
                String grp_name = request.getParameter("param1");
                out.println(data1);
                out.println(grp_name);
    %>
    <%    try {
                    String username = "root";
                    String password = "root";
                    String url = "jdbc:mysql://localhost/eureka_final?user=root&password=root";
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                    con = DriverManager.getConnection(url, username, password);
                } catch (Exception e) {
    // out.println("Sorry failed to connect to the Database. " + e.getMessage());
    %>
    <%
                java.util.Date utilDate = new java.util.Date();
                java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
                String teacher_id = "";
                Object usr_name = session.getValue("Username");
                Object ur_type = session.getValue("Usertype");
                stmt = con.createStatement();
    ///Teacher user
                if (ur_type == "teacher") {
                    try {
                        String search_teacher = "select tchr_id from teacher where username = '" + usr_name + "'  ";
                        rs = stmt.executeQuery(search_teacher);
                        if (rs != null) {
                            while (rs.next()) {
                                teacher_id = rs.getString("tchr_id");
                            //      String teacher_Nm = rs.getString("username");
                    } catch (Exception e) {
                        out.println(e.getMessage());
                    } finally {
                        rs.close();
                        stmt.close();
    //Admin user
                if (ur_type == "admin") {
                    stmt = con.createStatement();
                    try {
                        String search_teacher = "select other_id from other_user where username = '" + usr_name + "'  ";
                        rs = stmt.executeQuery(search_teacher);
                        if (rs != null) {
                            while (rs.next()) {
                                teacher_id = rs.getString("other_id");
                            //      String teacher_Nm = rs.getString("username");
                    } catch (Exception e) {
                        out.println(e.getMessage());
                    } finally {
                        rs.close();
                        stmt.close();
    %>
    <%          if ("D".equals(request.getParameter("hidMode")) && con != null) {
                    String chk_value;
                    try {
                        stmt = con.createStatement();
                        query = "update student set groups = '' WHERE student_id='" + request.getParameter("hidSelDel") + "'";
                        stmt.executeUpdate(query);
                        response.sendRedirect("search_grp_try.jsp?ID1=" + datamt + " ");
                    } catch (Exception e) {
    // out.println("Sorry failed to delete values from the database table. " + e.getMessage());
                if ("U".equals(request.getParameter("hidMode")) && con != null) {
                    try {
                        stmt = con.createStatement();
                        query = "UPDATE create_group SET group_name = '" + request.getParameter("txtBookName") + "', group_type = '" + request.getParameter("txtSynopsis") + "', group_details = '" + request.getParameter("txtAuthorName") + "' WHERE group_id = '" + request.getParameter("hidBookID") + "'";
                        stmt.executeUpdate(query);
                        response.sendRedirect("search_grp_try.jsp");
                    } catch (Exception e) {
    //out.println("Sorry failed to delete values from the database table. " + e.getMessage());
                /*  if ("I".equals(request.getParameter("hidMode")) && con != null) {
                String gp_name  = request.getParameter("txtBookName");
                String gp_type  = request.getParameter("txtSynopsis");
                String gp_detail  = request.getParameter("txtAuthorName");
                String publishername = request.getParameter("txtPublisherName");
                try {
                if (gp_name.length() > 0 && gp_type.length() > 0 && gp_detail.length() > 0) {
                stmt = con.createStatement();
                query = "INSERT INTO create_group (group_name, group_type, create_date, group_details,group_creator_id) VALUES ('" + gp_name + "','" + gp_type + "','" + sqlDate + "','" + gp_detail + "','" + teacher_id + "')";
                //String query = "INSERT INTO create_group (group_name, group_type, create_date, group_details,group_creator_id) VALUES ('" + gp_name + "','" + gp_type + "','" + sqlDate + "','" + gp_detail + "','" + teacher_id + "')";
                stmt.executeUpdate(query);
                response.sendRedirect("search_grp_try.jsp");
                } else {
                out.println("Group creation details cannot be left blank.");
                } catch (Exception e) {
                //out.println("Sorry failed to insert values into the Database table. " + e.getMessage());
                out.println("<HTML>");
                out.println("<HEAD>");
                out.println("<SCRIPT LANGUAGE='JavaScript'>");
                out.println("function setMode() {");
                out.println("document.frmBook.txtBookName.value='';");
                out.println("document.frmBook.txtSynopsis.value='';");
                out.println("document.frmBook.txtAuthorName.value='';");
                out.println("document.frmBook.txtPublisherName.value='';");
                out.println("}");
                out.println("function setDelMode()");
                out.println("{");
                out.println("document.frmBook.hidMode.value='D';");
                out.println("formDeleteValues('hidSelDel');");
                out.println("}");
                out.println("function formDeleteValues(hidden)");
                out.println("{");
                out.println("var selValues = '';");
                out.println("for (i=0;i<document.forms[0].elements.length;i++)");
                out.println("{");
                out.println("if(document.forms[0].elements.type == \"checkbox\")");
    out.println("{");
    out.println("if (document.forms[0].elements[i].checked == true) {");
    out.println("selValues = selValues + document.forms[0].elements[i].value + \",\";");
    out.println("}");
    out.println("}");
    out.println("}");
    out.println("if (selValues.length < 1)");
    out.println("{");
    out.println("alert(\"Please choose records you wish to delete.\");");
    out.println("}");
    out.println("else");
    out.println("{");
    out.println("selValues = selValues.substring(0,selValues.length-1);");
    out.println("eval(\"document.forms[0].\"+hidden+\".value = '\" +selValues+\"';\");");
    out.println("document.forms[0].submit();");
    out.println("}");
    out.println("}");
    out.println("function setEditMode(BookID,BookName, Synopsis, AuthorName)");
    out.println("{");
    out.println("document.frmBook.hidBookID.value = BookID;");
    out.println("document.frmBook.txtBookName.value = BookName;");
    out.println("document.frmBook.txtSynopsis.value = Synopsis;");
    out.println("document.frmBook.txtAuthorName.value = AuthorName;");
    // out.println("document.frmBook.txtPublisherName.value = PublisherName;");
    out.println("document.frmBook.hidMode.value='U';");
    out.println("}");
    %>
    function copyField()
    document.forms["frmBook"].id_4_.value = document.forms["frmBook"].id_4_add.value;
    return true;
    <%
    out.println("</SCRIPT>");
    out.println("<TITLE>Create Group</TITLE>");
    out.println("</HEAD>");
    %>
    <BODY style="background-color:#EFEFEF; solid:#cccccc;">
    <FORM ACTION='search_grp_try.jsp' METHOD='get' NAME='frmBook' >
    <table style=" width:100%; " align="center" >
    <tr>
    <td height="20%" width="40%">
    <jsp:include page="../toparea1.jsp">
    <jsp:param name="" value="" />
    </jsp:include>
    </td>
    </tr>
    </table>
    <table style=" width:100%; height:250px;" align="center" >
    <tr>
    <td width="20%" valign="top" >
    <jsp:include page="../side_menu_bar.jsp" >
    <jsp:param name="side" value="sidemenu" />
    </jsp:include>
    </td>
    <INPUT NAME="hidMode" TYPE="hidden" VALUE="<%=request.getParameter("ID")%>">
    <%
    String id_passes = request.getParameter("hidMode");
    out.println("<INPUT NAME='hidSelDel' TYPE='hidden'>");
    out.println("<INPUT NAME='hidBookID' TYPE='hidden'>");
    out.println("<TD valign='top'>");
    out.println("</TD>");
    if (con != null) {
    try {
    stmt = con.createStatement();
    query = "select student_id,username,std_Fname,std_Lname,groups from student where groups LIKE '%" + data1 + "%'";
    rs = stmt.executeQuery(query);
    out.println("<TR ALIGN='center' WIDTH='30%' COLSPAN='10'>");
    out.println("<TABLE ALIGN='center' BORDER='1' BORDERCOLOR='skyblue' CELLPADDING='0' CELLSPACING='0' WIDTH='430px' NAME='tblSecondChild'>");
    out.println("<TR BGCOLOR='black'>");
    out.println("<TD WIDTH='12%' ALIGN='center'><INPUT NAME='cmdDelete' TYPE='button' VALUE='Delete' onClick='setDelMode();'></TD>");
    out.println("<TD><FONT COLOR='#FFFFFF'>Group Name</FONT></TD>");
    out.println("<TD><FONT COLOR='#FFFFFF'>Group Type</FONT></TD>");
    out.println("<TD><FONT COLOR='#FFFFFF'>Group Detail</FONT></TD>");
    out.println("</TR>");
    if (rs != null) {
    while (rs.next()) {
    out.println("<TR>");
    out.println("<TD><INPUT TYPE='checkbox' NAME='chk" + rs.getString("student_id") + "' VALUE='" + rs.getString("student_id") + "'></TD>");
    out.println("<TD STYLE=\"cursor:pointer\" onMouseDown=\"setEditMode('" + rs.getString("student_id") + "', '" + rs.getString("username") + "', '" + rs.getString("std_Fname") + "', '" + rs.getString("std_Lname") + "');\">" + rs.getString("username") + "</TD>");
    out.println("<TD STYLE=\"cursor:pointer\" onMouseDown=\"setEditMode('" + rs.getString("student_id") + "', '" + rs.getString("username") + "', '" + rs.getString("std_Fname") + "', '" + rs.getString("std_Lname") + "');\">" + rs.getString("std_Fname") + "</TD>");
    out.println("<TD STYLE=\"cursor:pointer\" onMouseDown=\"setEditMode('" + rs.getString("student_id") + "', '" + rs.getString("username") + "', '" + rs.getString("std_Fname") + "', '" + rs.getString("std_Lname") + "');\">" + rs.getString("std_Lname") + "</TD>");
    %>
    <% // out.println("<TD STYLE=\"cursor:pointer\" onMouseDown=\"setEditMode('" + rs.getString("group_id") + "', '" + rs.getString("group_name") + "', '" + rs.getString("group_type") + "', '" + rs.getString("group_details") + "') + "');\">" + rs.getString("PublisherName") + "</TD>");
    out.println("</TR>");
    out.println("</TABLE>");
    } catch (Exception e) {
    out.println("Sorry Failed to execute the query. " + e.getMessage());
    %>
    </tr>
    </table>
    <a href="cr_grp.jsp">back</a>
    <table>
    <%! String srch_name1 = "";%><% srch_name1 = request.getParameter("search_stu");%>
    <tr><td><input type="text" id="search_stu" name="search_stu" value="<%=srch_name1%>" size="42" /></td>
    <td> <input type="submit" id="cmSearchStu_group" name="cmSearchStu_group" value="Search Student" />
    </td></tr>
    </table>
    <input type="hidden" id="search_stu_store" name="search_stu_store" value="<%=request.getParameter("ID")%>" size="42" />
    <input type="hidden" id="search_stu_store_name" name="search_stu_store_name" value="<%=request.getParameter("param1")%>" size="42" />
    <%! String vl_data;
    String student_Nm1;
    String group_ID_from_student;
    PreparedStatement ps;
    %>
    <%
    //Pass Id and Group name
    ////////end pass value////////
    if (request.getParameter("cmSearchStu_group") != null) {
    String scondPass = request.getParameter("search_stu_store");
    String scondPassName = request.getParameter("search_stu_store_name");
    String srch_name = request.getParameter("search_stu");
    out.println(srch_name);
    stmt = con.createStatement();
    try {
    //student where groups LIKE '%" + data1 + "%'";
    String search_stud = "select username,student_id,groups from student where std_Lname LIKE '%" + srch_name + "%' or std_Mname LIKE '%" + srch_name + "%' or username LIKE '%" + srch_name + "%' or std_Fname LIKE '%" + srch_name + "%' or city_c LIKE '%" + srch_name + "%' or state_c LIKE '%" + srch_name + "%' or pincode_c LIKE '%" + srch_name + "%' or city_p LIKE '%" + srch_name + "%'or state_p LIKE '%" + srch_name + "%' or pincode_p LIKE '%" + srch_name + "%' or std_DOB LIKE '%" + srch_name + "%' or std_gender LIKE '%" + srch_name + "%' or std_bloodGroup LIKE '%" + srch_name + "%' or std_addmission_no LIKE '%" + srch_name + "%' or std_transport LIKE '%" + srch_name + "%' or std_medicalNotes LIKE '%" + srch_name + "%' or std_home_no LIKE '%" + srch_name + "%' or std_emergency_no LIKE '%" + srch_name + "%' or std_email LIKE '%" + srch_name + "%' or std_parentemail LIKE '%" + srch_name + "%' or std_nationality LIKE '%" + srch_name + "%' or student_id LIKE '%" + srch_name + "%' or groups LIKE '%" + srch_name + "%' ";
    rs = stmt.executeQuery(search_stud);
    if (rs != null) {
    while (rs.next()) {
    String std_id1 = rs.getString("student_id");
    student_Nm1 = rs.getString("username");
    group_ID_from_student = rs.getString("groups");
    // response.sendRedirect("search_grp_try.jsp?ID1="+scondPass+"&parameter1="+scondPassName+"#srch_grp_stud ");
    %>
    <input type="checkbox" name="<%=std_id1%>" value="<%=std_id1%>"/>
    <INPUT MAXLENGTH="255" NAME="txtstud_name" TYPE="text" VALUE="<%=student_Nm1%>" >
    <% String chkBxVal = request.getParameter(std_id1);
    out.println(chkBxVal);
    out.println(id_passes);
    out.println(std_id1);
    // out.println(m);
    if ((chkBxVal != null)) {
    try {
    query2 = "update student set groups = " + scondPass + " WHERE student_id='" + std_id1 + "'";
    ps = con.prepareStatement(query2);
    ps.executeUpdate();
    String sendTo = "search_group.jsp?id='" + request.getParameter("ID") + "' ";
    response.sendRedirect(sendTo);
    } catch (Exception e) {
    out.println(e.getMessage());
    } catch (Exception e) {
    out.println(e.getMessage());
    } finally {
    rs.close();
    stmt.close();
    // con.close();
    %>
    <% if (request.getParameter("Add_student") != null) {
    String scondPass = request.getParameter("search_stu_store");
    String scondPassName = request.getParameter("search_stu_store_name");
    %>
    <input type="hidden" id="search_stu_str_name" name="search_stu_str_name" value="<%=request.getParameter("param1")%>" size="42" />
    <%String srch_name = request.getParameter("search_stu");
    String valueGetd = request.getParameter("search_stu_str_name");
    stmt = con.createStatement();
    try {
    String search_stud = "select username,student_id,groups from student where std_Lname = '" + srch_name + "' or std_Mname ='" + srch_name + "' or username='" + srch_name + "' or std_Fname='" + srch_name + "' or city_c='" + srch_name + "' or state_c='" + srch_name + "' or pincode_c='" + srch_name + "' or city_p='" + srch_name + "'or state_p='" + srch_name + "' or pincode_p='" + srch_name + "' or std_DOB='" + srch_name + "' or std_gender='" + srch_name + "' or std_bloodGroup='" + srch_name + "' or std_addmission_no='" + srch_name + "' or std_transport='" + srch_name + "' or std_medicalNotes='" + srch_name + "' or std_home_no='" + srch_name + "' or std_emergency_no='" + srch_name + "' or std_email='" + srch_name + "' or std_parentemail='" + srch_name + "' or std_nationality='" + srch_name + "' or student_id='" + srch_name + "' or groups='" + srch_name + "' ";
    rs = stmt.executeQuery(search_stud);
    if (rs != null) {
    while (rs.next()) {
    String std_id1 = rs.getString("student_id");
    student_Nm1 = rs.getString("username");
    group_ID_from_student = rs.getString("groups");
    // response.sendRedirect("search_grp_try.jsp?ID1="+scondPass+"&parameter1="+scondPassName+"#srch_grp_stud ");
    %>
    <input type="checkbox" name="<%=std_id1%>" value="<%=std_id1%>"/>
    <INPUT MAXLENGTH="255" NAME="txtstud_name" TYPE="text" VALUE="<%=student_Nm1%>" >
    <% String chkBxVal = request.getParameter(std_id1);
    String symbl = " ; ";
    /* if((group_ID_from_student).equals(null)){
    group_ID_from_student="";
    else{                           
    */ String merge_grp = group_ID_from_student + symbl;
    String final_merge = merge_grp + datamt1;
    if ((chkBxVal != null)) {
    try {
    query2 = "update student set groups = '" + final_merge + "' WHERE student_id='" + std_id1 + "'";
    ps = con.prepareStatement(query2);
    ps.executeUpdate();
    } catch (Exception e) {
    out.println(e.getMessage());
    } catch (Exception e) {
    out.println(e.getMessage());
    } finally {
    rs.close();
    stmt.close();
    con.close();
    // response.sendRedirect("search_grp_try.jsp?ID1=" + id_passes + "&parameter1=" + scondPassName + "#srch_grp_stud ");
    %>
    <input type="submit" id="Add_student" name="Add_student" value="Add" />
    <table style="width:100%; height:100px; " align="center" >
    <td >
    <%@ include file="../pagefooter.jspf" %>
    </td>
    </table>
    <input type="text" value="<%=request.getParameter("ID")%>" name="id_4_add5" />
    <%String datamt4 = request.getParameter("id_4_add5");%>
    <input type="text" value="" name="id_4_" />
    <input type="submit" onclick="return copyField();" />
    <% out.println("</FORM>");
    out.println("</BODY>");
    out.println("</HTML>");
    %>
    reply me                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    This is a little hard to follow and want to make sure I understand:
    You can pass the value from page1 to page2. But when you submit on page2 to another page, the value is null?
    My first recommendation is: Pull all HTML code out of scriptlets that is using out.println.
    But to answer your question, you don't have the hidden fields in the <FORM> tag. They need to be places in the form tag in order for the form to pass the values when you submit.

  • How to add a frame dynamically in a jsp page.

    Hai all,
    In my application, in a particular jsp page i had the 3 links namely add.edit and delete. When click on add button, it is pointing to another jsp page where i can enter user details. But what i want now is when i click add button, the form in which we fill the user details should be added to the current page itself dynamically i.e., it should not go to another page when i click add button and that form should be displayed in the current page in a new frame dynamically.
    The same should happen when i click n edit or delete options. everything should be diaplayed in the same page in different frames.
    Can anyone suggest me about how to add a frame dynamically.

    You create a frameset with two frames. One frame you give 100% of the rows and run the JSP in this frame. The other frame you give 0% of the row so that it is hidden. In the JSP you use a JavaScript funtion to submit the form. This function will call the parent frameset to reset the row values to 50%/50% which will make the bottom frame visible and then submit the form request with the bottom frame as teh target.
    It is not so much as creating frames as using JavaScript to hide and display frames.

  • Dynamic select using jsp?

    grrrrr............ok so I'm kinda new to this, and just a little frustrated. I'm gonna ramble here, so any time I sound like I don't know what I'm talking about it 's because I don't..correct me. I want to include a bean in a jsp which will buil d a dynamic select box on the fly. That is, connect to an LDAP db and place each value returned in the query in a select box. Now, I can compile and run the bean in my IDE and watch the output in the console. It's correct because I see "<select><option value = hall>hall....</select>". In the buildSelectBox() method I'm using System.out.println to display each line of my select box (is that right?). Now, when I copy the .class file over to the server I was initially getting an error because the bean wasn't found. I resolved that by properly compiling the bean in a package. Problem is that if I call the bean.buildSelect() method in the .jsp nothing comes back. The page is left blank. What in the world is that about? Can someone push me toward a tutorial that can push me in the right direction or sumthin? Why am I having so much trouble with this? Should I be building the select on the jsp?
    regards,
    mat

    Hi!
    If i understand you correctly :-) you are doing not very right things. I don't want it to seem like I'm going to teach you, but:
    The Bean that has buildSelect() method is not a bean at all. Usualy Beans contain getter/setters and accumulate data. If you want to build html code dynamicaly then you should use servlets(Which is not very flexible in your situation, I think), not JSPs. And if you are using JSPs then you have to make Tag which will do this everything.
    Other way is to use Struts framework which is very good and flexible for building web applications - it has it's own tags for many cases. You can make loops in JSPs, use beans and all that stuff.
    Guys will correct me if I missed something.
    Good luck

  • Dynamic text in JSP's

    I have a web application that allows for text to be inserted dynamically into its pages via a content managment system.
    Within this text, we have a requirement to be able to put some custom tags. The problem with this is that because the text is inserted into the Jsp at runtime, this text is obviously never compiled and thus, the custom tags never get executed.
    Does anyone know of any way to compile this text at runtime, through accessing the Jsp compiler, or through the use of a tag ?

    Yeah, the text is inserted using a custom tag :
    <cms:insert id="1234" />
    And the inserted text is just html snippets, but there could be custom tags inside it, like <form:input> tags. These tags don't get executed. I was hoping to be able to be able to do something like invoking the jsp compiler on this text, perhaps inside the code for the <cms:insert> tag handler.

  • Dynamic table in JSP

    Hi,
    We need some help regarding an unusual problem we are facing in our web application.
    The background:-
    We have a web page (JSP) for updating (adding, modifying, deleting) data from a single table. This page has been designed in such a way that when ever it is invoked, it displays content of the entire table on the page. Also there is a facility of filtering this content. The entire table content is displayed in a dynamic table without paging. There is one java script which is used to manage the scrolling of this table (300 rows at a time). Please not that it is just scrolling that is controlled by the Java Script, that is the entire table is displayed in a specific area with vertical scroll. Each row in this table has a radio button associated with it which is used to select a particular row for modifying it. User can select a single row at a time.
    The problem:-
    This page was working fine, until the number of rows in the table were under 70,000 records. Currently there are more than 72,000 records and the page doesn�t get displayed at all. It is not giving timeout error and also it is not going in to �Not Responding� state. It is simply showing a blank result page without the result table. Initially we thought that because we are fetching so much data in one go this would have been happening. But this problem arises only when we access this page from PC having Windows-XP operating system. If we access this page through a PC having Windows 2003 Server OS then it displays the entire table in a normal fashion.
    We are in the process of redesigning the page, but still want to know why this is happening. It will be a great help if anybody can give any pointer on this issue. And also what should be a better option of displaying such a huge table for modification of rows.
    Thanks and Regards,
    Jagdish.

    Thanks a lot masoodmjan.
    Lets assume that this problem is due to huge data being desplayed at once. Now if I decide to provide pagination to browse this entire recordset, which now has grown to 90000+ records, how many rows should I desplay on 1 page? Is there any thumb rule to decide this number?
    Just now I tried with 10,000 records per page & it took more than 25minutes to display single page. :(

  • About using dynamic sql in jsp

    I make a jsp file with "CreateViewObjec".I can get the message from db ,but I get the same message when I push the button "next" .Please help me!
    my jsp file is:
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <%@ page contentType="text/html;charset=MS936"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=MS936">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    The current time is:
    </H2>
    <P>
    <% out.println((new java.util.Date()).toString()); %>
    </P>
    <jbo:ApplicationModule id="MypackageModule" configname="mypackage.MypackageModule.MypackageModuleLocal" releasemode="Stateful" />
    <jbo:CreateViewObject appid="MypackageModule" name="dyname" rangesize="10" >
    select PRODUCT_NAME from product_information
    </jbo:CreateViewObject>
    <jbo:DataSource id="id" rangesize="20" appid="MypackageModule" viewobject="dyname" />
    <table border="0">
    <tr>
    <td ALIGN="right"><jbo:DataScroller datasource="id" /></td>
    </tr>
    <tr><td>
    <jbo:DataTable datasource="id" />
    </td>
    </tr>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources />

    David,
    I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
    Thx

  • How to include image or html dynamically in a JSP?

    I need to show the uploaded content in a jsp. It could be either a image or html file. How can i include these images or html files dynamically without affecting screen design.

    What the heck is 'screen design'? You mean the page layout?
    You could show in a popup div; JQuery will be your best bet for a prebuilt function to do that. But you'd need to put the uploaded file in a place where the browser can fetch it through an URL, or you need to create a servlet that can load and return the data to the browser.

  • Hi all.... how to display tables dynamically in a JSP page

    im trying to display the list of tables in MYSQL datbase into a JSP.... i have a database name link on the page.... once i click on that the list of tables should be listed dynamically in the page as a link...Also is it possible to click on each table link and go to see the table details ...if so how.... please some one help me ...its very urgent........

    im trying to display the list of tables in MYSQL
    datbase into a JSP.... i have a database name link on
    the page.... once i click on that the list of tables
    should be listed dynamically in the page as a
    link...Also is it possible to click on each table
    link and go to see the table details ...if so how....DatabaseMetaData has a method (look in the documentation) to get the list of tables. It also has methods to get information on specific database objects
    please some one help me ...its very urgent........It's even urgent that you look in the documentation.

  • Dynamic Gifs in JSPs

    Hi,
              I am trying to build a server that loads gifs from files, modifies them and
              them uses jsp to output them to client browsers. I am using the GifEncoder
              classes from ACME but from what I can see these were designed to be used
              with Servlets and not JSPs. Has anyone got this to work and if so how have
              you done it. Does anyone have an alternative solution.
              Thanks,
              Ged.
              

    Why do you ever want a JSP to serve a Image?
              If you are generating dynamic images, servlets is the way to go.
              If you still want to use jsp The examples you are looking at will definitely
              work.
              Ged Roberts wrote:
              > Hi,
              >
              > I am trying to build a server that loads gifs from files, modifies them and
              > them uses jsp to output them to client browsers. I am using the GifEncoder
              > classes from ACME but from what I can see these were designed to be used
              > with Servlets and not JSPs. Has anyone got this to work and if so how have
              > you done it. Does anyone have an alternative solution.
              >
              > Thanks,
              >
              > Ged.
              

Maybe you are looking for