Validation for saving values in jsp--is validation compulsory?

Hi all,
in my application there is a jsp which uses a pagebean.
now i added somemore attributes to the pagebean and included them in the jsp as well.
there is javascript validation for the previous attributes.
the values can be modified and should be saved to the db2 database on cliking the modify botton.
my question is do i need to include java script validation for the new attributes that i added to the pagebean and jsp to get modified and stored to the database?
or can i modify and save the new values without validation?
is validation compulsory?
your reply is very imp to me friends
cheers and thanks in advance

well, validation in general isn't required, but if some bad value is entered and not otherwise checked for, you could get errors.
and if you use validation at all, then the server-side validation will always run even if the JS validation runs or not.

Similar Messages

  • How to check the default checked  value for radio button on jsp for struts

    Hello , I just want to check the default checked value in JSP for a radio button, how can i do that?
    <html:radio property="sale" value="permanent" style="vertical-align: middle;">Permanent</html:radio>
    <html:radio property="sale" value="temporary" style="vertical-align: middle;">Temporary</html:radio>

    you can set the default value for property ( which you want to default selected when the form is first loaded) in reset method of the form.
    <html:radio property="sale" value="permanent" style="vertical-align: middle;">Permanent</html:radio>
    <html:radio property="sale" value="temporary" style="vertical-align: middle;">Temporary</html:radio>
    In the above case you can write the code as follows in the perticular form of this jsp.
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
         sale = "permanent";
    This will show the first check box default selected when the first time the page is loaded.

  • Using a variable as a value in jsp:param

    I was wondering, I have a String variable, vid_1, and want to use a jsp:include and pass that in as one of the parameters. How can I do this? I have to do some testing to make sure vid_1 is valid and set a default if not. It contains a number referring to which video needs to be displayed.
    Is there anyway I can get this value to be used in jsp:param value?
    John

    RahulSharna wrote:
    Well,First thing you haven't pharsed your question properly.
    Anyways as per my understading.
    The first thing is make use of in this case as your defined requirement states you need to make use of variables of both the JSP's which need compile time include not at the runtime.use of
    <%@ include file="url" %>would be more appropriate as you want to use the variable of parent jsp to the child one.
    Anyways if you are thinking to apply a solution using <jsp:include/>
    <jsp:include page="url">
    <jsp:param name="paramName" value="<%=stringVariable>"/>
    </jsp:include>and extract the paramName's corresponding value as a request parameter in other JSP.
    Hope that might answer your question :)
    REGARDS,
    RaHuLRaHul,
    Thanks for the reply. The second example you gave is what I was trying to do. I thought I did exactly what you have there and it was not working. I will check it over again and post back on here when I have a chance.
    For now I was trying to use c:set to save the variable in the request and then using the EL expression ${requestScope.variable} to put it in the <jsp:param> element. I had some things working and others not when I quit. Hopefully tomorrow I can give you a full report and we can get this worked out.
    Maybe my problem is something else? Look at this post of mine:
    http://forum.java.sun.com/thread.jspa?threadID=5236252&tstart=10
    Thanks so much for the help.
    John

  • Fund transfer module for online banking in jsp

    i am working on safe and secured internet banking project . currently working on fund transfer module. any particular user can transfer money from his/her account to any account.my first jsp file for this is:- fundtrans.jsp
    in this jsp page there are 2 comboboxes :- from account and to account , i m getting accounts in these comboboxes from database.in my case i m using saving table where all information about user's saving account is placed.
    fundtrans.jsp:-
    <%@ page import="java.util.*, java.lang.*, java.sql.*" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <table width="1024" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
    <td width="119" height="164"></td>
    <td width="152"></td>
    <td width="162"></td>
    <td width="147"></td>
    <td width="444"></td>
    </tr>
    <tr>
    <td height="32"></td>
    <td valign="top">From Account</td>
    <td></td>
    <td valign="top">
    <form name="form1" method="post" action="">
    <label>
    // combobox 1 which gets account_no from database from which transfer to be made
    <select name="select2">
                   <%
              // code for getting account_no from database table saving     
              try     {
              Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://mridul:3306/bank","root" ,"root");
    PreparedStatement ps;
    Statement st=con.createStatement();
    ResultSet rs = st.executeQuery("select * from saving where saving.username = '" + session.getAttribute( "theName" ) + "'");
    %>     
    <%
         while(rs.next())
         String Account =rs.getString("account_no"); %>
    <option value=""> <%= Account %> </option>
    <%}%>
    <%
    rs.close();
    st.close();
    con.close();
    }%><%      
    catch(Exception e)
    e.printStackTrace();     
    %>
    </select>
    </label>
    </form> </td>
    <td></td>
    </tr>
    <tr>
    <td height="81"></td>
    <td> </td>
    <td></td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td height="34"></td>
    <td valign="top">To Account </td>
    <td></td>
    <td valign="top"><form name="form2" method="post" action="">
    <label>
    // combobox 2 which gets account_no from database to which transfer is made
    <select name="select">
              <%
    //this gets account_no from database table saving and placed in combobox          
    try     {
              Class.forName("com.mysql.jdbc.Driver").newInstance();
         Connection con = DriverManager.getConnection("jdbc:mysql://mridul:3306/bank","root" ,"root");
         Statement st=con.createStatement();
         PreparedStatement ps1 = con.prepareStatement("select distinct account_no from saving");
    ResultSet rs=ps1.executeQuery();
         System.out.println("SECOND Succesfully Executed");
    %>     
    <%
         while(rs.next())
         String Accountno = rs.getString("account_no"); %>
    <option value=""> <%=Accountno %> </option>
    <%}%>
    <%
         rs.close();
    st.close();
    con.close();
    }%><%      
    catch(Exception e)
    e.printStackTrace();     
    %>
    </select>
    </label>
    </form> </td>
    <td></td>
    </tr>
    <tr>
    <td height="52"></td>
    <td> </td>
    <td></td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td height="34"></td>
    <td valign="top">Amount</td>
    <td></td>
    <td valign="top"><form name="form3" method="post" action="">
    <label>
    // this is text box in which user gives amount to be transfered
    <input type="text" name="bal">
    </label>
    </form> </td>
    <td></td>
    </tr>
    <tr>
    <td height="83"></td>
    <td> </td>
    <td> </td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td height="37"></td>
    <td> </td>
    //this is a submitt type button which goes to the update.jsp for further processing
    <td valign="top"><form name="form4" method="post" action="update.jsp">
    <label>
    <input type="submit" name="b4" value="continue">
    </label>
    </form>
    </td>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td height="467"></td>
    <td> </td>
    <td> </td>
    <td></td>
    <td></td>
    </tr>
    </table>
    </body>
    </html>
    update.jsp:- in this file i wrote sql query for fund transfer. in this i m subtracting balance from one account_no and want to show updated saving table. i m not using query for addition of balance in another account_no becoz i m getting problem here.
    <%@ page import="java.util.*, java.lang.*, java.sql.*" %>
    <%
    String name,pwd;
    boolean found=false;
    String acc= request.getParameter("select2");
    String acc1= request.getParameter("select");
    String ammount= request.getParameter("bal");
    Integer ammount1 = Integer.valueOf((String)session.getAttribute("bal"));
         //Establish connection
         try
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con = DriverManager.getConnection("jdbc:mysql://mridul:3306/bank","root" ,"root");
         Statement st=con.createStatement();
    // ResultSet rs = st.executeQuery("update saving set balance = balance-ammount1 where saving.account_no = '" + acc +"'");
         ResultSet rs = st.executeQuery("select * from saving");
         while ( rs.next() ) {%>
         <tr>
    <td valign="top" height="43"><%=rs.getString(1) %></td>
    <td valign="top"> <%=rs.getString(2) %></td>
    <td valign="top"> <%= rs.getString(3) %></td>
    <td valign="top"> <%=rs.getString(4) %></td>
    <td valign="top"> <%=rs.getString(5) %></td>
    <td></td>
    </tr>
    <%}
              rs.close();
                   st.close();
              con.close();
    catch(Exception e)
    e.printStackTrace();     
    %>
    my prob is i m not able to print updated saving table i found 1 blank page or sometimes i find "sever is not capable for fulfilling the request". i m able to understand that whether my sql query is wrong or i m getting value from combobox via request.getParameter. please help me as soon as possible.

    can u give me table name with attribute.
    because i couldn't get it <%=rs.getString(1) %>
    Edited by: prakash83 on Mar 8, 2008 9:22 PM

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • How to validate a field of type text for similar values

    Hi,
    My requirement is to validate a field <b>Name1</b> of type Text[40] for similar values when a new record is created. So If the Name1 already exist in repository, the validation has to give warning message saying the customer with Name1 already exist.
    Regards,
    Madhu

    Hi Madhu
    To validate a particular field, when a new record comes along with the same value SAP MDM is not capable of generating warning messages, but we can have best method of Tracking at Import manager level.
    In the Import manager after successful mapping, access the MATCH RECORD tab. Go to the Default import action area there you can find Match type & Default import action. For example if you are sending same Material record which is already available in the Repository, Match type will have the value “EXACT” where as Default Import action will have “UPDATE (ALL MAPPED FIELDS or NULL FIELDS)”.
    Here I have copied various Match types as well as Default Import Actions along with the definitions, pls go thru the same and feel free to revert to me for further clarifications.
    <u><b>Default Import Action</b></u>
    <b>Skip -></b> Skip source value combinations that already
            exist.
    <b>Update(NULL Qualifiers Only) -></b>     Update just the NULL remaining qualifiers of each existing qualified lookup value.
    <b>Update (All Mapped Qualifiers)-></b> Update all the remaining qualifiers of each existing
    qualified lookup value.
    <b>Replace -></b> Replace all the remaining qualifiers of each existing qualified lookup value by first deleting them and then creating a new value combination.
    <b>Delete -></b> Delete this qualified lookup value during import Processing.
    <u><b>Match Type</b></u>
    <b>None -></b> None
    <b>Exact -> </b> Whether the match type for the destination record with the current source
    record is Exact.
    <b>Partial -></b> Whether the match type for the destination record with the current source
    record is Partial.
    <b>Conflict -></b> Whether the match type for the destination record with the current source
    record is Conflict.
    Thanks
    Alexander
    Message was edited by: Alexander Raja

  • Can't retrieve bean value from jsp!

    Here's the chain of events for my web app:
    JSP form (get info from user) -> forwarding jsp (uses bean to save info submitted to form)-> servlet (retrieves info from DB) -> JSP (presents DB info to user by populating values in text fields from original form)
    Right now, I can access all the values submitted to the first JSP from my servlet. However, after my servlet retrieves the info from a db and stores it in a bean and forwards the request (using requestdispatcher) to the 2nd JSP, I can't get the values from the bean from the 2nd jsp. I was able to use the bean to store the information submitted to the original JSP, however.
    Here's some relevant code:
    FROM FORWARDING JSP (which saves user-submitted info in bean)
    <jsp:useBean id="fxFormBean" class="fxmatcher.FxFormBean" scope="request"/>
    <jsp:setProperty name="fxFormBean" property="*" />
    <jsp:forward page="/FxMatcher" />
    FROM LAST JSP (which should populate form fields)
    header stuff:
    <jsp:useBean id="fxFormBean" class="fxmatcher.FxFormBean" scope="session"/>
    info retrieval:
    <INPUT TYPE="text" NAME="fx_key" value="<%= fxFormBean.getFx_key() %>">
    I wrote this JSP based on the example given here: http://www.jsptut.com/Editing.jsp, but I'm not getting the value from the bean. The result JSP just has value="".
    I'm pretty sure that my servlet is saving the info to bean correctly, but here's the code anyways:
    //retrieves info from DB
    FxFormBean fx = (FxFormBean) request.getAttribute("fxFormBean");
    fx.setFx_key (traderKey);
    fx.setAa_block(agent_block);
    fx.setAddition_to (additional_to);
    log("trader key: [" + fx.getFx_key() + "]"); //debugging code
    My debugging code did print out the correct info, so I don't think there's anything wrong with the bean or the servlet.
    I would appreciate any help. Thank you very much.

    The first JSP puts the bean in the request, the servlet retrieves the bean from the request and updates it but in the second JSP you set the scope to session:
    <jsp:useBean id="fxFormBean" class="fxmatcher.FxFormBean" scope="session"/>
    So the second JSP is looking in the wrong place for your bean. Change the scope in the second JSP to request:
    <jsp:useBean id="fxFormBean" class="fxmatcher.FxFormBean" scope="request"/>

  • Fraudulent digital certificates issued for high-value websites, iOS patch ?

    http://www.zdnet.com/blog/security/microsoft-warns-fraudulent-digital-certificat es-issued-for-high-value-websites/8488?tag=nl.e589
    http://www.h-online.com/security/news/item/SSL-meltdown-forces-browser-developer s-to-update-1213358.html
    this obviously means that iOS could be vulnerable. Mozilla has patched Firefox (all versions), MS just pushed an update, Google patched Chrome already a few days ago, how about Safari and iOS?
    edit: does iOS use OSCP validation?

    I see Safari desktop supports OCSP checking - if manually activated - but does Safari mobile too? as there's hardly any setting available for Safari on idevices it's hard to know...

  • Values from JSP to Struts Action Class

    Dear All,
    Am working on a small struts project, i want to get values from JSP in the Action class, i tried with sending variables using request through URL, it works fine, any other way is there to send the values from JSP to action class. Am not having any input fields in the JSP.I have links.
    Thanks,
    vyrav.

    I have a dispatch action for that am calling the action like this viewfiles.do?parameter=edit, and i have to send a variable ID from the same page, so am doing like this through java script, viewfiles.do?parameter=edit&id=10. Am able to get the id in the dispatch action edit, but when i start tomcat with security manager its not calling the action itself and its giving accesscontrol exception, but when i directly type viewfiles.do in URL its calling the action.
    I dont know wats the problem, tomcat security manager not allowing this. Please help me.
    Thanks,
    vyrav.

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

  • Passing value to jsp page by clicking a hyperlink

    I have a hyperlink in a jsp page1. The hyperlink is for another jsp page2. I have a string value in JSP page1, which I want to pass to jsp page2 when user clicks the hyperlink. Can anyone tell me what will be the suitable way to do this? Thanks.

    here's the source to two very simple jsps that do what you want..
    <HTML>
    <HEAD>
    <TITLE>
    ForwardValue
    </TITLE>
    </HEAD>
    <BODY>
    <H1>
    Go To GetValue.jsp
    </H1>
    </BODY>
    </HTML>
    <HTML>
    <HEAD>
    <TITLE>
    GetValue
    </TITLE>
    </HEAD>
    <BODY>
    <H1>
    <%= request.getParameter("value") %>
    </H1>
    </BODY>
    </HTML>

  • 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

  • Passing value from JSP to JApplet

    Hello,
    I am stuck up with a problem, can anyone please tell me how do i pass a value from a JSP page
    to a JApplet,
    and the parameter passed through JSP should be displaed in the JTextArea.
    It would be kindful if any of you could help.
    Thanks
    Sanam

    hello,
    thanks for reply.
    I know how to pass parameters from html,
    I want to pass values from jsp page,
    and i dono how to do it, may be we cann pass values through url connection but i dono how.
    if anone knows plz help me in solving this.
    i hvae posted my applet code.
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.JToolBar;
    import javax.swing.JButton;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    <applet code = "DocApplet" width = 500 height =5000>
    </applet>
    public class DocApplet extends JApplet
         private JPanel jp;
         private Container cp;
         private JTextArea jt;
         private JToolBar tb;     
         private JScrollPane sp;
         private String annotation;
         private String url;
         private Connection con;
         private Statement stmt;
         public void init()
              jp = new JPanel();
              cp = getContentPane();
              jt = new JTextArea();
              tb = new JToolBar();
              sp = new JScrollPane(jt);
              repaint();
         public void start()
              jp.setLayout(new BorderLayout());
              jp.add(tb, BorderLayout.NORTH);
              jp.add(sp, BorderLayout.CENTER);
              jt.setBackground(Color.BLACK);
              jt.setForeground(Color.WHITE);
              setContentPane(jp);
              addButtons(tb);
              repaint();
         public void run()
              repaint();
         public void paint()
         private void addButtons(JToolBar tb)
              JButton button = null;
              button = new JButton("Save");
              button.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
              tb.add(button);
    }

  • Passing value from JSP to scriptlet

    Hi
    I am trying to find a way to pass a value from jsp to the scriptlets, i.e.
    <c:set var="testValue" value="123" />
    <%
    System.out.println(testValue);
    %>
    the above code just demonstrates what I was trying to achieve, by passing the value from the jsp into the scriptlet.
    Can someone tell me if there's an easy way to do this?
    Thank you.

    Note, using scriptlet code on your page is generally something to be avoided. 99% of what you should be doing on a JSP page can be done with EL/JSTL. If you can't do it with EL/JSTL then it probably belongs in a servlet/bean.
    I always aim for 100% scriptlet free jsp pages.
    Having said that, I can still answer your question: EL attributes are stored in the scope - page, request, session, application
    ${testValue} is equivalent to pageContext.findAttribute("testValue").
    The <c:set> tag example doesn't specify a scope, so therefore you could get it like this:
    <c:set var="testValue" value="123" />
    <%
    String testValue = (String)pageContext.getAttribute("testValue");
    System.out.println(testValue);
    %>alternatively exploit the feature of the useBean tag that creates a scriptlet variable:
    <c:set var="testValue" value="123" />
    <jsp:useBean id="testValue" type="java.lang.String"/>
    <%
    System.out.println(testValue);
    %>Note that the EL variable and the Scriptlet variable are initially pointing at the same String.
    But changing the string in scriptlet code will change the value it is pointing at, while leaving the EL variable untouched.
    If you have a List in scope, and sharing it between EL and scriptlet variables then any changes to the list would be reflected because they both point at the same List object.
    cheers,
    evnafets

  • Pass values between jsp pages

    Admin1.jsp
    In this jsp page i have a drop down list with<select name=Update
    From this page i move to the page Adnim2.jsp
    Admin2.jsp
    In this page i request for the value of selected entry in the drop down list as follows
    String a=request.getParameter("Update");
    From this page i move onto a servlet UpdateContribution.java
    UpdateContribution.java
    Here i need the value of the selected entry in drop down list ie Update
    but String a=request.getParameter("Update"); does not work here and i get a Null Pointer Exception
    Please help me

    In Admin2.jsp, add a hidden form field and assign the selected value of drop-down to it. Now, you can obtain
    the selected value of drop-down in Servlet(UpdateContribution.java) using given hidden form field.
    Or,
    Store the selected value of drop-down list in session. Now, you can obtain the value in servlet(UpdateContribution.java) through session

Maybe you are looking for

  • Compilation problem in reports

    Hi all, I have my application build in oracle reports 3.0. But when i'am installing on client side i install developer runtime version and copy all fmx and rep files on client side. Problem is some reports are not running.Error it shows is "REP-0002

  • No possibility to activate iMessages with my iPhone 4

    Hi everibody ! I have an iPhone 4 ! I can't activate iMessages on it !! When I'm trying I get a message that told me to verify my connection but I'm connected in 3G and Wi-fi. I arrived to activate once but only with my email address. When I go on th

  • ISE Guest Conditions

    Hi, I'd like to place Guest Accounts in a different "UserGroup" depending on the base country of the sponsor, which is meantion in the LDAP CN-String used to authenticate sponsors. Unfortunately, the ISE (1.2, Patch Level 5) only provides the operato

  • NCS Licensing in High Availability

    We are transitioning from a single WCS to NCS, and are looking at high-availability and the costs associated with it. How does the licensing work if you want a NCS high availability environment?  If you have a 10,000 device license on your primary, d

  • Where is the bookmarks that I saved on Firefox.

    I saved bookmarks but can't find them.