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

Similar Messages

  • 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 can i get dynamic values to next page.

    HI!
    I am generating a dynamic rows with some different values.And in the end of each row there is a button .i want as i click that button i can get those values on next page.
    Can any one help me out in this.
    On click i can send values thouugh get or post to next page.But how will i read that on next page.
    Help if any one can.

    Not excatly.But i am trying to solve that problem.Responding early may
    help me.

  • How to get Dynamic values from R/3 into dropdownlist of my WD appl

    Hi all,
    I have a requirement like, I have 2 dropdown boxes. The values should be populated from R/3, for this am using a BAPI. But how to get the values dynamically, plz help me or give give some PDF/blogs which are useful to my scenario. Thanks in advance.
    regards,
    Ganesh

    Hi ganesh,
    YOu have 2 drop down so you should create two action handler and similarly 2 bapi's , rfc's in backend .You should drop down by key feature of webdynpro on the second drop down explained below.
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/91c5e990-0201-0010-4981-9b2075751da5
    Regards,
    Hemant
    Rewards Pts if helpful

  • How To Pass the value from JSP to Applet

    plz reply how can we pass the value from the JSP to Applet ...the applet is embedded in JSP page....

    Hi,
    <applet codebase = "."
    archive = foo.jar"
    code = "com.bar"
    name = "bar"
    id = "bar"
    width = "<%=Request["width"] %>"
    HEIGHT = "<%=Request["appHeight"] %>"
    hspace = "0"
    vspace = "0"
    align = "middle"
    alt     = "Applet is Loading..."
    >
         <param name="LANGUAGE"                value="<%=Request["lan"] %>">          
         <param name="LOGOUT_USER_URL"           value="EndSession.asp">
         <param name="DATA_READ_INTERVAL"      value="10000">
         <param name="REFRESH_INTERVAL"           value="5000">     
         <param name="DEFAULT_FONT"           value="Arial">
    </applet>
    pass values @ ur html or jsp page to Applet as parameters.
    Refer above code. By using getParameter() method of Applet, u can take values inside applet.

  • Dynamic Fonts in JSP With applet

    Hi Buddies
    My Multilingual web application uses a dynamic font , the technology provided by TrueDoc.com. Now the problem is the webpage works properly by making use of the dynamic fonts and I get stuck to life when I realised that my applet should also display using the dynamic font.
    The dynamic font is a file with an extension of .pfr usually placed in the server and all the webpages will be bound to the server to make use of the .pfr font, there by making all the clients to view the sam font
    irrespective of the fonts installed in the client machine.
    How do i get going

    The applet is run on the client machine, so you have to include the .pfr with the applet code. Best bet would be to use a JAR for the Applet and package the .pfr inside there.

  • Getting the values in jsp in struts

    hi,
    the thing is the values i had set in the form in the action as available
    in the jsp page when i use neastes tld
    but i am not able to find when i try to get in the request.getProperty(" ")
    nither as request,getAttribute()
    then how to get if i want to do some manuplation on the data in the jsp
    thanks bye

    There is no method request.getProperty() ... it should be request.getParameter(). The way you have worded your problem doesn't seem to give much information to me.

  • Getting option value in jsp: Urgent help will be appreciated

    Hello All,
    I am working on JSP. I will grade myself as beginner in JSP.
    I am trying to solve since last 2 days, I just want to display the value of option tag, and not able to get it.
    <table>
    <tr>
    <td>
    <html:select name="ActionForm" property="overage">
    <%
    int i;
    int[] arr1=new int[200];
    for (i=0;i<=100;i=i+10)
    arr1=i;
    %>
    <html:option value="/<%=i%>/"><%= arr1%></html:option>
    <%}%>
    </html:select>
    </td>
    </tr>
    </table>
    Please, ignore the syntactical error.
    Now in above code I want to know what is being put up as value of option tag. By value I mean , I want see <html:option ]value="/<%=i%>/> . (Data marked in bold)
    Your help will be appreciated. I tried couple of things such as getParameter(), get Attribute(), getOverage(). Some of it gave me value as "//", it skips the i variable.
    I want to see what is being put up in value for every iteration of loop

    Yeah I know. But thnx for the response.
    I also got that error solved. you know what it was because of those bckslashes. i wrote it,
    <html:option value="<%=i%>"><%=arr%> instead of
    <html:option value="/<%=i%>/"><%=arr[i]%>
    and that worked perfectly. I wish I could have known this before. It would have saved me lot of time.

  • How to get  value on jsp file from ActionServlets class

    Hi All,
    I am facing problem in action servlets class into Struts, I am able to get the value on jsp file from action class with the help of session scope but i want to another method for it , so how i can solve the problem.Plz help me
    Thanks......... in advance

    I got a way out to access the attribute, i feel it is
    <jsp:usebean id="myRack" class="settings.Rack"/>
    <c:foreach var="book" item="myRack.books">
    </c:foreach>
    I am not able to check if this is correct or not because myRack.books is not having any value set by me in the request scope. How do i get instance of Rack class set by another page in the current request? I can get the value if i use scriptlet but i dont want to use scriptlet.
    I am continiously trying, if I get an answer, I shall post, else pls somebody guide.

  • Dynamic Values in Business Graphics Tool Tip

    hi,
    I am using business graphics ui element in my webdynpro application.I am able to get the graghical output correctly.I want to have tool tip in my graph so when I place the cursor on a point, the tool tip should give the corresponding value.I have used the following code
    try
         String[] catLabels = {
                        "Team 1", "\1Tomoko Akino", "\1Hans Bosch", "\1Marvin Smith",
                        "Team 2", "\1Jose Vega", "\1Bao Yin", "Out of office" };
            String[][] pointCustomizing = {
                        { "approved", "cancelled", "approvedPartTime" },
                        { "approved" },
                        { "approved" },
                        { "sent", "approvedPartTime", "notsentPartTime", "notsent"},
                        { "approved", "zSeveralEntries", "zSeveralEntries",
                          "zSeveralEntries", "zSeveralEntries", "zSeveralEntries",
                          "zSeveralEntries" },
                        { "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
                          "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
                          "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
                          "outOfOffice", "outOfOffice", "outOfOffice" }
            String[][] pointLabels = {
                        { "1", "2", "2", "2", "4", "3", "3", "3", "1", "1", "2", "1",
                          "2", "1", "1" }
            String[][][] timeValues = {
                        { { "20020528", "20020606" }, { "20020606", "20020608" },
                          { "20020610", "20020611" } },
                        { { "20020531", "20020606" } },
                        { { "20020607", "20020613" } },
                        { { "20020527", "20020601" }, { "20020606", "20020607" },
                          { "20020612", "20020613" }, { "20020617", "20020619"} },
                        { { "20020531", "20020606" }, { "20020531", "20020601" },
                          { "20020601", "20020602" }, { "20020602", "20020603" },
                          { "20020603", "20020604" }, { "20020604", "20020605" },
                          { "20020605", "20020606" } },
                        { { "20020527", "20020528" }, { "20020528", "20020529" },
                          { "20020529", "20020530" }, { "20020530", "20020531" },
                          { "20020531", "20020601" }, { "20020603", "20020604" },
                          { "20020604", "20020605" }, { "20020605", "20020606" },
                          { "20020606", "20020607" }, { "20020607", "20020608" },
                          { "20020610", "20020611" }, { "20020611", "20020612" },
                          { "20020612", "20020613" }, { "20020617", "20020618" },
                          { "20020618", "20020619" }}
            String s[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14",};
            IPrivateSBusinessGraphicsSampleView.ICategoryNode catNode = wdContext.nodeCategory();
            for (int catIndex = 0; catIndex < catLabels.length; ++catIndex)
               IPrivateSBusinessGraphicsSampleView.ICategoryElement  catElement = catNode.createCategoryElement();
               catNode.addElement(catElement);
               catElement.setDescription(catLabels[catIndex]);
            // loop over series
            IPrivateSBusinessGraphicsSampleView.ISeriesNode seriesNode = wdContext.nodeSeries();
            for (int seriesIndex = 0; seriesIndex < timeValues.length; ++seriesIndex)
               IPrivateSBusinessGraphicsSampleView.ISeriesElement seriesElement = seriesNode.createSeriesElement();
               seriesNode.addElement(seriesElement);
               // set series attributes (...)
               IPrivateSBusinessGraphicsSampleView.IPointNode pointNode = seriesElement.nodePoint();
               // loop over points
               for (int pointIndex = 0; pointIndex < timeValues[seriesIndex].length; ++pointIndex)
                 IPrivateSBusinessGraphicsSampleView.IPointElement
                           pointElement = pointNode.createPointElement();
                 pointNode.addElement(pointElement); 
                 String ename = s[pointIndex];
                 wdComponentAPI.getMessageManager().reportSuccess("name:"+ename);
                 pointElement.setStartValue(timeValues[seriesIndex][pointIndex][0]);
                 pointElement.setEndValue(timeValues[seriesIndex][pointIndex][1]);
                 pointElement.setCuId(pointCustomizing[seriesIndex][pointIndex]);
                 pointElement.setLabel(pointLabels[seriesIndex][pointIndex]);    
                 pointElement.setToolTip(ename );
         catch(Exception e)
                 wdComponentAPI.getMessageManager().reportSuccess("exc2:"+e);
    By the above code ,I am getting the tool tip with the value "a" in all locations.
    But I need to have different values in the tooltip corresponding to the location.
    Please Help....
    Thanks in advance,
    Shamila

    hi,
    Still  I did not get the dynamic tool tip..........
    In wdDoInit() I have written the following code
    try
         String[] catLabels = { "Team 1", "\1Tomoko Akino", "\1Hans Bosch", "\1Marvin Smith",
                   "Team 2", "\1Jose Vega", "\1Bao Yin", "Out of office" };
            String[][] pointCustomizing = {
                        { "approved", "cancelled", "approvedPartTime" },
                        { "approved" },
                        { "approved" },
                        { "sent", "approvedPartTime", "notsentPartTime", "notsent"},
                        { "approved", "zSeveralEntries", "zSeveralEntries",
                          "zSeveralEntries", "zSeveralEntries", "zSeveralEntries",
                          "zSeveralEntries" },
                        { "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
                          "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
                          "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
                          "outOfOffice", "outOfOffice", "outOfOffice" }  };
                    String[][] pointLabels = {{ " ", " ", " " },{ " " },{ " " },{ " ", " ", " ", " "},{ " ", " ", " ", " ", " ", " ", " " },
                                  { "1", "2", "2", "2", "4", "3", "3", "3", "1", "1", "2", "1", "2", "1", "1" } };
                  String[][][] timeValues = {{        { "20020528", "20020606" },
                          { "20020606", "20020608" },
                          { "20020610", "20020611" } },
                        {  { "20020531", "20020606" } },
                        {   { "20020607", "20020613" }  },
                        {   { "20020527", "20020601" },
                          { "20020606", "20020607" },
                          { "20020612", "20020613" },
                          { "20020617", "20020619"} },
                        { { "20020531", "20020606" }, { "20020531", "20020601" },
                          { "20020601", "20020602" }, { "20020602", "20020603" },
                          { "20020603", "20020604" }, { "20020604", "20020605" },
                          { "20020605", "20020606" } },
                        { { "20020527", "20020528" }, { "20020528", "20020529" },
                          { "20020529", "20020530" }, { "20020530", "20020531" },
                          { "20020531", "20020601" }, { "20020603", "20020604" },
                          { "20020604", "20020605" }, { "20020605", "20020606" },
                          { "20020606", "20020607" }, { "20020607", "20020608" },
                          { "20020610", "20020611" }, { "20020611", "20020612" },
                          { "20020612", "20020613" }, { "20020617", "20020618" },
                          { "20020618", "20020619" }}  };
            String s[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14",};
            IPrivateSBusinessGraphicsSampleView.ICategoryNode catNode = wdContext.nodeCategory();
            IPrivateSBusinessGraphicsSampleView.ICategoryElement  catElement;
            for (int catIndex = 0; catIndex < catLabels.length; ++catIndex)
                catElement = catNode.createCategoryElement();
               catNode.addElement(catElement);
               catElement.setDescription(catLabels[catIndex]);
             // loop over series
            IPrivateSBusinessGraphicsSampleView.ISeriesNode seriesNode = wdContext.nodeSeries();
            for (int seriesIndex = 0; seriesIndex < timeValues.length; ++seriesIndex)
               IPrivateSBusinessGraphicsSampleView.ISeriesElement seriesElement = seriesNode.createSeriesElement();
               seriesNode.addElement(seriesElement);
               // set series attributes (...)
               IPrivateSBusinessGraphicsSampleView.IPointNode pointNode = seriesElement.nodePoint();
               IPrivateSBusinessGraphicsSampleView.IPointElement  pointElement;
               // loop over points
               for (int pointIndex = 0; pointIndex < timeValues[seriesIndex].length; pointIndex++)
                 //IPrivateSBusinessGraphicsSampleView.IPointElement
                 pointElement = pointNode.createPointElement();
                 pointNode.addElement(pointElement); 
                 String ename = s[pointIndex];
                  wdComponentAPI.getMessageManager().reportSuccess("name:"+ename);
                 pointElement.setStartValue(timeValues[seriesIndex][pointIndex][0]);
                 pointElement.setEndValue(timeValues[seriesIndex][pointIndex][1]);
                 pointElement.setCuId(pointCustomizing[seriesIndex][pointIndex]);
                 pointElement.setLabel(pointLabels[seriesIndex][pointIndex]);    
                  pointElement.setToolTip(ename );
    catch(Exception e){        wdComponentAPI.getMessageManager().reportSuccess("exc2:"+e);    }
    In wdDoModifyView() I have written the following code
    try
         IWDBusinessGraphics graph = (IWDBusinessGraphics)view.getElement("BusinessGraphics");
         IWDAbstractSeries allSeries[] = graph.getSeriesList();
         IWDSimpleSeries series;
         wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("length : "+allSeries.length+" value:"+allSeries[0]);
         for(int j=0;j<allSeries.length;j++)
           series = (IWDSimpleSeries)allSeries[j];
          for(int i=0;j<wdContext.nodeSeries().size();i++)
              wdContext.nodeSeries().setLeadSelection(i);
              series.setTooltip(series.getValue());
      catch(Exception e)
         wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("exc modify :"+e);
    The node structure is
    Root Node
    >Category>Description
    >Series>Point-->CuId
    >Series>Point-->endvalue
    >Series>Point -->Startvalue
    >Series>Point -->label
    >Series>Point --->Tooltip
    In BusinessGraphis seriesSource-Series node ,tooltip-Series.Point.ToolTip is mapped
    In Category description-Category.Description is mapped
    In Series pointsource-Series.Point, tooltip-series.point.tooltip is mapped
    In Point CustomisingId-eries.point.cuId.label-Series.label, tooltip-series.point.Tooltip,valuesource -series.point is mapped
    In Numericvalue value-series.point.startvalue is mapped
    In Numericvalue value-series.point.endvalue is mapped
    When I deploy my application I am getting <b>java.lang.ClassCastException</b> Exception at the line  <b>series = (IWDSimpleSeries)allSeries[j];</b>
    What is reaseon?.....
    Please help..............
    I want to get dynamic value in the tool tip of the graph.
    Thanks in advance,
    Shamila,

  • Getting hidden value with javascript problem

    <html>
    <body>
    <form>
    <input type="hidden" id="code" value="123">
    </form>
    </html>
    when open the html file and type "javascript:alert(document.getElementById("code").value)" in the address bar, I get a message box with "123".
    but when i do in the jsp with
    <input type="hidden" id="code" value="<%=request.getParameter("code")%>">
    and type the javascript in the address bar, i get "object not supported".
    Can anyone tell me how to get hidden value in jsp with javascript?
    thank you.

    There is no difference between a JSP or plain html, since javascript executes on the client side after the JSP is done processing. There is obviously something wrong with the HTML content after you input the request value, so check the generated HTML in your browser to see if there are any unwanted quotes in there or something.

  • Re: Embedding Applet in JSP which gets dynamic input| Pls help

    Hi All,
    We are into a project in Oracle Portal Server where in we want to embed a result of a standalone application(Which is applet) in JSP.
    This standalone application generates applet based on the input it gets from the current application's database.
    If it was static we could have used jsp:plugin but, it fails in our case!
    We are clueless as to how to embed an applet which will pick up the data dynamically.
    Can anyone of you help me in this regard?
    Thanks & Regards
    Arthi

    Well instead of generating entire applet ,you can have a generic applet which takes parameters as ( <PARAM name="name" value="value"> ) inputs and process those inputs to generate output.
    In this case the output of the stand alone program would be a object. And in JSP page you need to access this object, then you can get the values which need to be passed to Applet.
    Else
    1.Identify the real path of the applet class file
    ServletContext context = session.getServletContext();
    String realContextPath = context.getRealPath(request.getContextPath());2.Copy the file to a standard location in your web application
    Regards,
    -John-

  • How to get a value from applet in jsp?

    Dear all,
    I have a jsp page which includes a applet (in a form). User click to my applet and get the value.
    and the jsp form can capture the value of the applet and send to servlet.
    Is it possible?
    If it is possible, how to do that?
    Thanks.
    Regards,
    Kin

    Hi,
    Yes it is possible. You have to use LiveConnect.
    The classes required are netscape.javascript.*
    They are located in the jaws.jar file (jre/lib).
    Here is a copy of the page found at http://www.rgagnon.com/javadetails/java-0177.html
    Read/Write HTML field values from JAVA
    [Netscape AND IE4 compatible]
    The netscape.javascript.* (LiveConnect) package provides facilities to directly manipulate HTML FORM components.
    JSObject win = (JSObject)JSObject.getWindow(this);
    JSObject HTMLInputText = (JSObject) win.eval("document.forms[0].elements[0]");
    String testValue = (String)HTMLInputText.getMember("value");  // read form value
    HTMLInputText.setMember("value" , testValue + "new stuff");  // write form valueBut this action requires a signed applet. in Netscape, you must PrivilegeManager.enablePrivilege("UniversalBrowserRead");
    PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
    before using an JSObject related to an HTML document.
    But there is a workaround, simply pass the informations through Javascript functions!
    [JSjava.java]
    import java.applet.*;
    import java.awt.event.*;
    import java.awt.*;
    import netscape.javascript.*;
    public class JSjava extends Applet
         implements ActionListener {
    Button b1,b2;
    TextField tf;
    JSObject win;
    public void init(){
      setLayout(new FlowLayout());
      tf = new TextField(10);
      b1 = new Button("to FORM");
      b2 = new Button("from FORM");
      b1.addActionListener(this);
      b2.addActionListener(this);
      add(tf);add(b1);add(b2);
    public void actionPerformed(ActionEvent ae) {
      if (ae.getSource() == b1) {
         // send TO FORM
         JSObject win = (JSObject)JSObject.getWindow(this);
         win.eval("setHTMLInputText('"+tf.getText()+"');");
      if (ae.getSource() == b2) {
         // receive FROM FORM
         JSObject win = (JSObject)JSObject.getWindow(this);
         tf.setText((String)win.eval("getHTMLInputText();"));
    }[JSjava.html]
    <HTML><HEAD>
    <SCRIPT>
    function getHTMLInputText(){
      return document.forms[0].elements[0].value;
    function setHTMLInputText(s){
      document.forms[0].elements[0].value = s;
    </SCRIPT></HEAD><BODY>
    <FORM>
      <INPUT TYPE=text SZIE=20>
    </FORM>
    <APPLET NAME="JS" CODE=JSjava.class MAYSCRIPT WIDTH=200 HEIGTH=200>
    </APPLET></BODY></HTML>Regards,
    Denis.

  • How to get the values of 2 dynamic comboboxes in one jsp to another jsp?

    I have 2 comboboxes and one submit button on my jsp page.I select a value in 1st combobox then the values in the second combobox populated from the database. next i select 2nd combobox and then submit the button.After submit the button call the next jsp page. In that page i want to display the values of two comboboxes. but my problem is , in that page only 2nd combobox value is displayed.1st combobox is displayed as null. plz tell me, how to get the values of two comboboxes at a time?
    Select.jsp:
    <%@ page language="java" import="java.sql.*" %>
    <%!
         Connection con = null;
         Statement  st  = null;
         ResultSet  rs  = null;
         String     sql = null;
         void addItems(javax.servlet.jsp.JspWriter out, String sql)
           try{     
              rs = st.executeQuery(sql);
              while( rs.next() )
                   out.println("<option>" + rs.getString(1) + "</option>");               
         }catch(Exception e)
                   System.out.println(e);
    %>
    <HTML>
    <HEAD>
    <TITLE>JSP WITH  MULTIPLE FORMS</TITLE>
    <script language="javascript">
              function checking()
                        form1.submit();
         </script>
    </HEAD>
         <body>
             <center>
             <b><font size="5" color="#333399">Staff ID:</font></b></center>
                     <FORM NAME="form1" METHOD="POST" ACTION="Select.jsp">
                         <p align=center>
                         Details of Staff :  
                       <SELECT 1 NAME="type" onchange="checking();">
                                    <option> Administrator </option>
                              <option> OfficeAssistent </option>
                              <option> Clerk </option>
                                  </SELECT 1>
                          </p>
    </FORM>
                      <FORM NAME="form2" METHOD="POST" action="welcome1.jsp">
                      <center>
                          <TABLE><TR><TD>Staff ID:</TD>
                                 <TD><SELECT 2 NAME="staff_id">
                    <%    
            String type = request.getParameter("type");
            try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            con = DriverManager.getConnection("jdbc:odbc:java","system","manager");
            catch (ClassNotFoundException ex) {
                   System.out.println(ex);
            catch (SQLException ex)
                System.out.println(ex);
         st  = con.createStatement();
         sql = "select staff_id from "+type+"";
         addItems(out, sql);
    %>
              </SELECT 2>
           </TD>
         </TR>
    </table></center>
    <h2> Details of <%= type + "s" %> </h2>
                         <center><input type=submit value=ok onclick="submit();"></center>
                  </FORM>
         </BODY>
    </HTML>
    welcome1.jsp
    <center><h1>WEL COME</h1></center>
    <%    
            String type = request.getParameter("type");
            String sid = request.getParameter("staff_id");
    %>
    <h2> Details of <%= type + "s" %> </h2>
    <h2> Details of <%= sid %> </h2>

    <SELECT 1 NAME="type" onchange="checking();">
                                    <option value = "0"> Administrator </option>
                              <option value = "1"> OfficeAssistent </option>
                              <option value = "2"> Clerk </option>
                                  </SELECT 1>

  • How to get and disply dynamic values on the fly and display in applet

    hello all ,
    i have a problem in refreshing a applet.
    i have a scrolling applet which will get the share values from the database and display in a scrolling applet in the browser . i am getting the values and displaying it.
    but the problem is , if i enter a new record in the database, until and unless i press refresh button of the browser, i am not getting the new values . please help me if anybody having the idea. please mail me to [email protected]
    thank you all.
    by
    samba

    You want a database update to trigger an applet refresh? Can't be done.
    However, you can have the applet periodically re-query the database and update its display with the information it retrieves. Just kick off a Thread that sleeps for a bit, wakes up, queries the db, updates the display, and goes back to sleep.

Maybe you are looking for