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.

Similar Messages

  • Get dynamic values in Jsp fom Applet

    Hi,
    Mine is not a unique question, its been asked many times on the same forum but still I havent got any satisfactory answer so I am putting this again.
    I have one applet, it is been loaded from jsp. Applet uses double buffering and its values are changing constantly.
    Now my question arises here, In my jsp i have one button on the click of that button I am calling some other jsp passing some of jsp values in URL. I also want to pass one of the value of applet to jsp so it can pass to next jsp or to do something that next jsp automatically gets the new value.
    I thought for Applet-servlet communication but my concerns are,as my applet is being refreshed continuously(around every 1 sec) and the value which i have to pass is changing every second and I dont know when user will click on the button of jsp so to pass that value of applet i have to do applet-servlet communication every second and that does not suit me as it consumes lot of time.
    Can you suggest me any other solution so I can send value through jsp whenever button is clicked.
    Thanks
    Taral Shah

    HI Senthil Babu
    Thanks for your reply.
    But applet is very important for my application as i am showing some graphical representation on it. So I have to use applet. Now you told that i have to make temporary files on client's macvhine. You mean to say each time I have to store that value on client's pc through File I/O.
    Is that? but that is also problematic 'cause it consimes much time and my application deals in milli seconds.
    Pl. guide me considering that time is much important for my application so solution should not consume much time.
    Thanks again,
    Taral Shah

  • SAP transparent table stores condition value of Shipment cost

    HI
    I need to know which SAP transparent table stores condition value of Shipment cost document (specific for Freight condition which derived from Bulkiness group).
    Background:
    Minimum load calculation logic
    In the pricing procedure for shipment cost we have two conditions: One is ZMIN (similar with SP00)  which is having condition class u201CHu201D, Calculation type u201CGu201D which determine Bulkiness group according to access sequence. Bulkiness group is where we define different group with different minimum load. e.g. ZCEM16 u2013 25.TON (22.68) Second condition is ZAFR (Similar with FB00), ZAFR calculates the base value from ZMIN (Compare actual weight with Min weight value of Bulkiness group), if the net weight is 23 ton, it will calculate at 25 ton because of the bulkiness group.
    Now I need to know in which table system stores dynamic value of ZMIN?  Just like we have PR00 in KONV which we can find from KNUMV of billing / sales order.  If I use the same logic then I donu2019t find ZMIN Condition type and value in KONV table for the specific shipment cost document.  Please advice how to and from which Table I can find Bulkiness group value of Shipment cost document.
    Thanks

    Hi,
    Get the shipment cost number from shimpment document (document flow or shipment document header).
    Goto VFKP table,enter shipment cost number and choose detials. get the document condition number from  KNUMV field.
    Now goto KONV and enter document condition number and choose details. you can see condition type and value.
    Thanks & Regards,
    Chandrasekhar

  • Store int values into dynamic array

    Hello all,
    I'm a newbie in JAVA whose want to store int values (coming from a resultset) into an dynamic array. I know that normally to create a "dynamic array" you'd better use a Vector, but it seems that I don't know how to use it correctly (throws me a exception as : Incompatible type for method. Can't convert int[] to java.lang.Object[]).
    Thanks in advance
    STF

    I want to use the copyInto method of the vector, but it throw me an exception as ')' expected
    I include a snip of my code below ;
    Vector v= new Vector();
    Vector vv=new Vector();
    String[] labels=new String[v.size()];
    Integer[] values=new Integer[vv.size()];
    cont=rs.getInt("COUNT(CASE_ID_)");
    vv.add(j,new Integer(cont));
    log=rs.getString("ORIG_SUBMITTER");
    v.add(j,new String(log));
    v.copyInto(String[] labels);
    vv.copyInto(Integer[] values);

  • How to store the value of sum of group in Crystal Report at the runtime!

    Hello all,
    I creates a Formula Field that hold the value of Sum of Group in Crystal Report. I would like to know how to store it in a variable and pass it to store procedure. Is it an option in Crystal report to do it. I knew that Crystal Report can cache the report for sharing. My detailed issue as following:
    - Created a Formula Field named TOTAL AMOUNT that calculated the complex expression. This TOTAL AMOUNT is dynamic based on group and variables.
    - I would like to store that value from TOTAL AMOUNT and pass it to the stored procedure parameter IN.
    Any helps are much appreciated. Thanks.

    I doubt that this is possible since it would only calculate this value once the report has data.  This sounds more like a report design question that should be asked over [here|SAP Crystal Reports;

  • Store multiple values into a variable

    I was wondering if it was possible to store multiple values into one varaible. Something along the lines of...
    Oracle: 10g
    --Table xSample (this is obviously a dumbed down version of the table for the sake of showing what I want to accomplish
    S_ID   YEAR
    1         2009
    2         2009
    3         2009
    4         2009
    --Query
    select     s_id
    into       pID
    from      xSample
    where    year = 2009;Basically the reason I was trying to figure out how to store multiple values into a variable is b/c I was going to use that variable (pID) as a parameter and have it's values passed dynamically when the proc was called. The values would go into a query that would look something like:
    select *
    from cust_data
    where person_id in (pID)
    aka
    select *
    from cust_data
    where person_id in (1,2,3,4)Not sure if this is possible, but if anyone knows of a way I could accomplish this that would be great.
    Edited by: user652714 on Dec 23, 2009 9:37 AM

    Here's a basic idea building a comma seperated list, then consuming it in another query (taking the in list approach from Tom's post, linked earlier).
    create table xsample (s_id number not null, year number);
    insert into xsample select level, 2009 from dual connect by level <=4;
    commit;
    declare
       --4000 should be lots ... hopefully?
       v_parameter_list varchar2(4000);
    begin
      --create the comma seperated list
      select
        substr(max(sys_connect_by_path(s_id, ',') ), 2, 4000)
      into
        v_parameter_list
      from
        select s_id, row_number() over(order by 1) as rn
        from xsample
        where year = 2009
      start with rn = 1
      connect by prior rn = rn - 1;
      --consume the comma seperated list
      for x in
        with data as
          select
            trim( substr (txt,
            instr (txt, ',', 1, level  ) + 1,
            instr (txt, ',', 1, level+1)
            - instr (txt, ',', 1, level) -1 ) ) as token
          from
            select ','||v_parameter_list||',' txt
            from dual
          connect by level <= length(v_parameter_list)-length(replace(v_parameter_list,',',''))+1
        select *
        from xsample
        where s_id in (select * from data) 
      loop
        dbms_output.put_line('next item = ' || x.s_id);
      end loop;
    end;
    /

  • How to assign a dynamic value to the value property of a button ?

    Hi Folks,
    I have a need, can i know how to assign a dynamic value to the value property of a button. Scenario is like follows...
    This is a struts based web application
    1. I have a file which consists of login user details (user name and his previlages) for a web application.
    2. I got those user details, into a List.
    3. When a user logged into the web app, in the home page there are few buttons. The type and number of buttons shown depends on the type of user/ user. (Buttons have different combination and the number of buttons available are not constant, they will vary from user to user).
    4. for each button, there will be a different action. I can pass the value of a button to an action class, but here button must have a dynamic value.
    Here is my test code:
    <%
    if (List != null)
    for (int i = 0; i <List.length; i++)
    %>
    <html:submit property="rduname" value= "<%=List%>" onclick="return submitRdu('<%=List[i] %>');"/>
    <%
    %>
    But my problem is how to assign a dynamic value to the value property of the button ( i know 'value= "<%=List[i]%>" ' will not work, just wanted show you guys).
    Thanks in advance,
    UV
    Edited by: UV_Dev on Oct 9, 2008 2:15 PM

    Let me try i know am not good at JSP but do we need double quotes here
    value= <%=List%>i think JSTL should help you about the dynamic thing                                                                                                                                                                                                                                                                                                                       

  • 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.

  • Dynamic value objects in flex and coldfusion 9

    I'm writing a program for a company that does registrations for conventions and trade-shows.  The problem I'm having is that each different client wants to store different data for each show.  Most of the data is the same (attendee's name, address, etc...), but each show has some customizations that it wants to have...  So each database for each show is going to be different...
    Right now, the only way I know how to transfer data from Flex to ColdFusion is via a Value Object.  (Well, the only good way to do it, that is.)  My problem comes when a client wants a particular database customized.  I have MANY questions about this...
    1) How do I tell my Value Object what fields we've added to or changed in the database without re-writing the entire VO (in both the .AS and .CFC files) and re-compiling my program?  In other words, I need a dynamic VO that changes automatcially with the database.
    2) If there is a way to dynamically create a VO in Flex (and from a few blog posts I've seen, it seems there is a way), how do I tell CF9 what the structure of that dynamically-created VO is?  Without re-writing a bunch of .CFC files every time I add or change a field in the database, that is...
    3) How do I reference the dynamically-created fields in my Flex program?  Right now, for example, I can define a variable called attendeeInfo as type attendeeInfoVO, and then reference things like attendeeInfo.first_name, attendeeInfo.last_name, etc...  How do I reference a field programmatcially when I don't know what it's going to be called beforehand?
    4) How do I make my program display/modify those dynamically-created fields?  Right now, using the attendeeInfo example above, I can create a TextInput with an id="firstNameInput" and just say firstNameInput.text = "{attendeeInfo.first_name}".  That won't work when I have no clue how many dynamically-created fields there are, or even what kind of data they're going to store...  How do I deal with this?
    5) Is there something other than VOs that would fit this situation better?  Am I limiting myself by using VOs in the first place?  Is it just plain impossible to do this with VOs?  And if so, what are my alternatives?  I need a structured object that can be passed around with a single reference -- I absolutely DO NOT want to pass a bunch of references to a bunch of different variables -- that's why I used VOs from the very beginning.
    6) Can I simply PAY someone at Adobe for one-on-one help here?  Do they have experts that you can "buy" for a few hours?  What's the charge for that, if such a thing is available?  Or, is this problem well-explained somewhere on the Web, and I just haven't found it yet?
    I'm very confused here, and it seems like I might have to re-write a ton of code, which I'm not looking forward to...  Ugh...  I appreciate any help you can give me...
    Thanks,
    Laurence MacNeill
    Mableton, Georgia, USA

    This blog post is pretty close to what I want:
    http://justinjmoses.wordpress.com/2008/10/10/flex-dynamic-bindable-value-objects/
    So there are the dynamic value objects I was looking for.  But the blog-poster is using LINQ and .Net 3.5.  I'm using ColdFusion9.
    So, how do I get ColdFusion9 to deal with that?  How do you get CF9 to recognize the fact that you've changed the VO, and deal with it appropriately?
    Thanks,
    L.

  • Unit test with Dynamic Value Query

    Hi,
    I am planing a function which should return a table name for a given ROWID. The ROWID will be selected from a view. Now I am trying to setup a unit test which consists of Startup and Teardown Process as well as a Dynamic Value Query. During Startup Process one dataset is inserted in a table which is part of a view definition. The dataset should be selected during Dynamic Value Query. However I am getting the following error message: Unable to run the test because no rows were returned by the dynamic query. Is there the possibility that within a Dynamic Value Query I can't make use of datasets which where inserted by a Startup Process? I am asking because the selection outside the unit testing framework supplies the dataset as expected.
    SQL Developer: 3.2.20.09 Build MAIN-09.87
    Java: 1.6.0_45
    Regards.

    Dynamic SQL is very tricky.  Since you can get the data outside your application extract and test the dynamic SQL as it is generated.  When working with dynamic SQL I find it useful to first generate the SQL text as a string and then if necessary store it in a table (CLOB type) for later reference.  Because of the uncertainty of obtaining bind variable values later I prefer to hard-code such values into dynamic SQL - possibly slightly less efficient for Oracle at run time but a lot easier to work with when debugging and tuning (again, apart from the built-in inefficiency of not using bind variables)  I usually find the overhead of the hard-coded values not too bad and the ability to know the data values at a glance useful.  I also find it useful to write dynamic SQL in such a way so that the resulting statement can be pasted in to any normal SQL tool (SQL*PLUS, SQL*Developer) and run without any editing.
    There may be some quirk in the generated dynamic SQL preventing it from finding anything.
    Good luck.

  • How to pass a dynamic value to jrxml file???

    Hi all,
    let me know a thing,How to pass a dynamic id value to the query in jrxml file.
    <queryString>
    <![CDATA[select currency_id from currency]]>
    </queryString>
    Because for every user,we have to generate a jasper report based on their loginId.So we have to maintain a dynamic value in jrxml file inorder to get records from table.
    <queryString>
    <![CDATA[select currency_id from currency where cid="DynamicId value"]]>
    </queryString>
    is the above mentioned tag possible???If it so kindly let me know how to do this from jsp page to jrxml file(Assume that jsp page calls jrxml file for report generation).
    Thanks in advance,
    sundar,

    hi all
    i m dealing wid same problem
    i used abv code bt some problem is still there
    foll is the code:
    code]
    Enumeration e=request.getParameterNames();
    while(e.hasMoreElements()){
    out.println("fgdgf");
    String name=(String)e.nextElement();
    String value=request.getParameter(name);
    stmt = dbconn.prepareStatement("UPDATE applicants SET statusLocal = 'n' where empNo = '" +value+ "'"); 
    int rowsAffected=stmt.executeUpdate();
    out.println(stmt);
    if(rowsAffected!=0){
    out.println("Successfull");
    else {
    out.println("Failed");
    }           while condition is not satisfied
    control does not enter the while loop
    can u plz tel me wht shud b the problem..
    thnx

  • Passing Javascript values to JSP

    Hi,
    I have a select box and i get the selected value using the javascript. The variable that stores the value should be passed to the JSP. I need to know , how i an do the same.
    When a user clicks on a option I call a javascript function:
    function myFun()
    var text = document.myform.selectboxname.options[index].text;
    return text;
    I need to get the value returned.
    The select option is as follows.
    <select name="sel" multiple onChange=myFun()>
    How can i get the value "text".
    Kindly help.

    if yes.....my functions returns a value...how can i
    access the same.You can't, in the way you want it. You need the function to put the value where it's supposed to go.
    I'm sorry, but this question is clearly out of scope for this board. Look for a Javascript support forum. Just the fact that the HTML originated from a JSP doesn't make it a Java question.

  • Need to create OAF new Button Item with Destination URI with dynamic value

    Would like to add a personalization to a OAF page, with adding a new button Item. Behind the button item, one of the properties we would like to set is Destination URI, and we would like to have this with a dynamic value from the Page we are on.
    Let's say we are on the OAF page for customers. One of the fields is Customer Account Number. This is one of the Attributes from the View Object that the page is built on. So we want to take a value from an Attribute, and use this in the Destination URI value. That is what I mean by dynamic. It depends on what record from the database we are looking at on the OAF page.
    In this case it is View Object is 'HzPuiCrUpCustActVO' and the Attribute is 'AccountNumber'
    Does that make sense? can we reference an View Attribute value in the Destination URI? How can this be done?
    Thanks!

    Kristofer,
    This does make it clearer, as far as using the personalization property to reach another OAF page.
    I would like to build a custom page for the destination, but I did not want to necessarily the page to be another OAF/jsp page.
    One thing we might want to do is build an APEX page. so this Destination URI might have to start with something like http://oraserver.mycompany.com:7779/pls/apex/f?p=
    Another option we might want to use is to just have the destination resolve to a custom URL that includes a parameter value like http://mycompany.com/1905 where 1905 is the account number from the Customer Account OAF page.
    Any ideas, or is this even possible?
    Chris

  • Is it possible to pass dynamic values to custom tag?

    Hi there, I'm trying to build a calendar custom tag so I can drop the calendar into an existing webpage easily.
    I have got the calendar displaying on the page but the problem I have is when I try to create 'previous' and 'next' links. Is it possible to pass parameters to a custom tag that have dynamic values?
    In PHP it would looks something like:
    <a href="bla.php?page=$pagenumber">next page</a>When I create the calendar object I set it to the current date so when I try to increase or decrease the month (next/prev month) it doesn't work because the code is run again and hence setting the current date again.
    Any ideas?
    Cheers in advance
    Message was edited by:
    MajorMahem

    for eg
    <a href=" Display.jsp?id='+<%=customerId%>">Result Page</a>
    Please try this,
    i didn't work out, any how apply this sample to your code

  • Dynamic values in checkbox

    Hello,
    I have a servlet where I submit the value of check box to other servlet and print them there.
    out.println("<input type=\"checkbox\" name=\"option2\" value=\"2\" checked>");
    out.println(word+"<br>");
    for this check box no problem as the value is static and always =2
    I tryed to make the vlaue dynamic value ="string"
    out.println("<input type=\"checkbox\" name=\"option1\" value=\"<%=word%>\" checked>");
    out.println(word+"<br>");
    but when i print this i got :
    2 null
    any help

    Hi, please use the 'code' tags; select the text and click the code button when you're posting, it makes things easier to read.
    1. Since you're getting null, that means the value in the variable 'word' is null; check where the value should be assigned.
    2. Your code for printing the value of 'word' is wrong; why're you using the JSP tags ( <%= %> ) when it's a servlet??
    String word ="This Value" ;
    out.println("<input type=\"checkbox\" name=\"option1\" value=\"" + word + "\" checked>");

Maybe you are looking for

  • JSF 2.0.1 + j:ajax + inline script

    Hi, I am having problems with using inline <script> code in a .xhtml pages when using <j:ajax> in the page which forwarded the client's browser to the new page. index.xhtml:           <h:form prependId="false">                <h:commandButton value="

  • TCP/IP properties

    I have a questions about TCP/IP configurations for SQL server 2008R2.  We have several instances on one machine (same IP) and some of the instances have the IP1 (under the IP addresses tab) enabled set to yes and have dynamic port values of 0 because

  • Error : Content not available in jsr 168 portlet in sun one portal 7.1

    I deployed jsr 168 portlet in Sun one portal and i have added that portlet ot one channel. But i am unable to see the content of that portlet NewPortlet       ERROR: Content is not available In the log file i am getting a null pointer exception java.

  • My iphone 5 home button not working and apple guys refused to replace my phone bcoz it has 1 de

    Plss help

  • The Mail account is not saving password

    Ok so i have done all the things that the Help suggests. When I want to save a password of my Mail account into password, I click Save to keychain...but it doesn't. I've checked to make sure the settings for the Keychain are not blocking the 'save' e