How to row identity to get its value

hai sir this is surendra i am doing a acadamic project that is a web site like orkut using jsp in that i have to show all the members of each group on click on the group name in the group table jsp.For that purpose i have to sent group name on click to another jsp.
I am using following jsp to display the all groups.
<%--
Document : friends
Created on : Jan 2, 2010, 9:16:59 AM
Author : surendra
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>groups</title>
</head>
<body bgcolor="#fff3cc">
<center>
<%@page import="java.sql.*" %>
<%
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/realheros?user=root&password=suri");
PreparedStatement ps = con.prepareStatement("select distinct gro from groups where Email=?");
HttpSession s = request.getSession();
String mail = (String) s.getAttribute("user");
ps.setString(1, mail);
ResultSet rs = ps.executeQuery();
%>
<table border="2px">
<%
while(rs.next())
%>
<tr>
<%
s.setAttribute("group",rs.getString(1));
%>
<td align="left"><%=rs.getString(1)%></td></tr>
<%
rs.close();
ps.close();
con.close();
catch(Exception ex)
%></table>
</center>
</body>
</html>
from this jsp i have to send clicked row id to "members.jsp"
and how to get the value in members.jsp
How is it possible.

You are doing it wrong. Use servlets and normal Java classes for code logic. Don't write java code in JSPs.

Similar Messages

  • How can my java application get its own PID?

    My java application runs under AIX?
    The application needs to get its own PID.
    There is a possibility to get it by
    Runtime.exec("ps -ef | grep <user.name>");
    But is there any other alternate possibility?
    Any idea would be great appreciated
    kind regards

    Hello! I found several ways for this in a blog from someone called Igor Minar on
    http://net3x.blogspot.com/2007/03/how-java-application-can-discover-its.html
    He found several ways:
    * Use Java management and monitoring API
    ManagementFactory.getRuntimeMXBean().getName();returns something like
    1826@localhost
    where 1826 is the PID of the JVM process, i.e. my application's process. But this hack is JVM dependent and may not work on JVM's other than Sun's
    * Use a shell script to put a property in place that is set to the PID:
    exec java -Dpid=$$ -jar myapp.jar* Java Native Interface - cumbersome and platform dependent solution
    * Use procfs (Linux solution: read /proc/self, nifty nifty, posted in the comments of the resp. post!)
    int pid = Integer.parseInt( ( new File("/proc/self")).getCanonicalFile().getName() );* From another comment: Reflection will work (on Unix): The Process class has a field called pid which can be queried:
    static int getPID(Process process) throws IllegalAccessException, IllegalArgumentException,
                                                                      NoSuchFieldException, SecurityException
         Field field = process.getClass().getDeclaredField("pid");
         field.setAccessible(true);
         return field.getInt(process);
    }But this solution looks a bit of a kludge to me. I think the /proc/self solution is best - it definitely rox my sox!
    Hope this helps!

  • Checkbox as a query item - how do I get its value into my SQL

    I have a search region where the user enters some parameters to filter the records returned from the query. I have a checkbox that represents Active or Inactive. I created it using the APEX_ITEM.CHECKBOX function. So if checked I want the sql to order by Active records else if unchecked to order by inactive records after they press the submit button. So how do I get the checked or unchecked value from this checkbox into my SQL query.
    Message was edited by:
    ca114422

    You can have a look here:
    http://htmldb.oracle.com/pls/otn/f?p=31517:99
    There is an example on how to include various item values
    into your query.
    By the way, what is your name?
    Denes Kubicek

  • How can i add or get a value in different rows like a condition

    Hi all,
    this is the example of some records in my flat file of a survey,
    Cliente- question - Answer
    1 - 1 -5
    1 - 2 -5
    1 - 3- 5
    2 - 1- 5
    2 - 2- 4
    2 - 3 -5
    i need count the clients who has answered in the three questions the answer 5, for example the client number 1 , the number 2 not because in the question number 2 he answered 4, how can i do this to count them in the query or in the load?, help

    If you wanted this to be done at the back end.. You can definitely do it with Routine Logics in place. (Let me know if you are planning for this?)
    In Case you want to handle it at query level,
    I hope the Answer and question are just numbers (Key Figures). The Client field needs to have restrictions based on Question and Answer as well as we need a Input Screen Variable that controls the value in Answer.
    The Question restriction should contain all the 3 values (1, 2 and 3). While executing the query the restriction on Answer should be there on the Input Screen where you can enter '5'. At the execution of this query definitely you will find only the clients that had the answer as 5 for all the three questions..
    Hope this helps!!

  • How to find custom parameters and its values?

    Hi,
    Please let me know how to find the list of custom parameters with its possible values and its use in programs?
    Thanks.

    There is no validation for the values that can be input so you can put anything in the value field. For example, try "BUK" and
    then a value for a company code you know does not exist.
    When you run a transaction with that it will default that value.

  • Routine does not get its value from: quantity* net price

    Dear all,
    I have a problem with routine. Could you suggest me any solution for it.
    If quantity =1 there is no problem. But if quantity different than 1 routine still calculates as quantity 1.
    What migh be problem here?
    I have routine as:xkwert = xworkk - xworki.
    I assigned it YODI condition.
    To give an example: xkwert = xworkk - xworki.
    NETW                                              200,00
    OWST                         16,00
         Sub Total                               216,00 = XWORKK
    YOFI                         100,00 =XWORKI
    YODI                                                   8,00 =XKWERT*Here routine calculates as XWORKK=108 and XWORKI= 100.
    How can  I fix it?
    Kind Regards,
    Edited by: Fsmehmet on May 13, 2011 7:02 AM

    Dear Amit,
    My routine: xkwert = xworkk - xworki. And it works when quantity is 1.
    But when quantity is different then one, calclation is wrong.
    For example;
    Quantity=2 Net Price=100 And NETW=2100=200*
    OWST 16,00
    Sub Total 216,00 = XWORKK
    YOFI 100,00 =XWORKI
    YODI 8,00 =XKWERT*Here routine calculates as XWORKK=108 and XWORKI= 100.
    Regards,

  • How to call exe and get returned values ?

    I wanna call pc exe from abap, after calling can i get results from exe ?

    Hi,
    for dos DIR you can use:
      DATA: COUNT TYPE I.
      DATA: WA_TAB_FILE   TYPE          FILE_INFO,
            TAB_FILE      TYPE TABLE OF FILE_INFO.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
        EXPORTING
          DIRECTORY  = 'C:\'
          FILTER     = '*'
        CHANGING
          FILE_TABLE = TAB_FILE
          COUNT      = COUNT.
      write: / 'count of files:', count.
      LOOP AT TAB_FILE INTO WA_TAB_FILE.
        WRITE: / WA_TAB_FILE-FILENAME(40),
                 WA_TAB_FILE-FILELENGTH,
                 WA_TAB_FILE-CREATEDATE,
                 WA_TAB_FILE-ISDIR.
      ENDLOOP.
    in CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES there are more posibilities.
    If you have another EXE on PC. Put the output of EXE in an FILE and read thie file via CL_GUI_FRONTEND_SERVICES.
    Regards, Dieter

  • How to get the values of all rows in advanced table

    HI All,
    I am using an advanced table to enter the values for the service contract line (its a custom page)in that advanced table i ahave column with lov called task number for that task number once i had choosed one task number and creating one more row using add anethor row button i want to restrict the user to not to choose the task number which was entered in the previus row.
    Or if this is not possible i want to restrict the user by showing an error message when click on the submit button by saying you have choosed the duplicate task number please choose a uniqu task number
    please give some hints
    thanks
    ajay

    Hi
    your approach will have two steps
    1.) use the row refernce and get the value of task number of the row which is enterd by user .
    2.) use getRows in range and compare values of task number of every row with the user selected value ,if value match then throw error.
    Thanks
    Pratap

  • Using groovy expressions to get a value of the current row

    Hi,
    I have a bounded task flow. The first step in the flow is calling an ExecuteWithParameters on one of my views. Based on the result of this query, I want to go to either Page1 or Page2.
    So I have a router. I first tried to route based on whether or not the result of the query contained only one row. That worked fine. But I want to add a condition to that.
    Basically, if the query returns one row AND that row has an attribute named 'Noc' == 1, then I want to go to Page2. Otherwise, go to Page 1.
    Right now to get the estimatedRowCount I am getting the iterator from the pageDef file created for my ExecuteWithParams object. To see if 'Noc' == 1, I tried this:
    #{data.rcl_view_reimbCode_search_results_task_flow_reimbCode_search_results_task_flow_ExecuteWithParamsPageDef.ReimbCodeSearchView1Iterator.currentRow.getAttribute("Noc") == 1}
    But it is complaining of grammar issues.
    What is the best way to go about getting the value of my attribute in a groovy expression?
    Thanks,
    Joel

    Hi,
    the best way is to use a managed bean reference
    1. create a binding for the router
    2. Expose the queried iterator in the PageDef file
    3. write a managed bean that accesses the binding
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentEntry();
    DCIteratorBinding iter = bindings.get("NameOfIterator");
    // i) get estimated row count
    // ii) get attribute value
    //iii) evaluate
    // iv) return true/false
    Reference the managed bean from the router
    Frank

  • Urgent -Getting modified Value of MessageTextInput

    Hi All,
    I am changing the value of messagetextinput field.
    How to get its value progrmatically?
    I am using currentRow.getAttribute but its not working out.
    This is returning null.

    If you trying this a table, then iterate through VO and get values from that row. If you are getting null in that row, try to print values in VO for each row to debug!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                               

  • Get/Set values from a drop down list

    I am trying to modify the http://www.netbeans.org/kb/60/web/web-jpa-part2.html so that instead of entering the data from a text field (in update & add) the values come from a drop down list from a table. I have drop down lists that are populated bothe from the DB and hard coding. When I run, I am able to see the options on the DDs. But none of the CRUD work. I think this is because my set and get for the drop down is wrong. Then again, I also have a few text fields from the original example which also don't seem to work. Here is a piece of my addButton():
            RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys();
            PaymentDetails[] pv = getSessionBean1().getPaymentVoucher();
            int rowId = Integer.parseInt(selectedRowKeys[0].getRowId());
            PaymentDetails upPV = pv[rowId];
            bankCodeDD.getSelected();
            statusDD.getSelected(); // hard coded value
          upPV.setPrepBy((String) prepByField.getText());
          PaymentDetailsController pvController = new PaymentDetailsController();
            pvController.addPaymentDetails(upPV);
            addRequest = false;
            return null;How do I set and get the values from the drop down so than it passed to my bean? When I choose a row to be updated, make changes and click Update, I get this message on my Tomcat:
    com.sun.webui.jsf.component.DropDown::The current value of component form1:deptCodeDD does not match any of the selections.
    Did you forget to reset the value after changing the options?Can someone please point me to a place which shows how I can add a default value from my DD? I tried to follow http://www.netbeans.org/kb/55/dropdowncomp.html, but unable to complete because I get an error for Options api. The auto-fix imported import org.apache.jasper.Options; But the package given in the tutorial is com.sun.webui.jsf.model.Option. My Java version is 1.6.0_07.
    private Options listOptions[];
    ...//getter setter goes here
    listOptions = new Option[noofDBRows + 1];Many Thanks!

    I don't guess what I may add.
    The contents of the table named lookup appear on the screenshot.
    cell A1 contains the string One-Piece, cell B1 contains the 'associated' value 160.
    cell A2 contains the string Two-Piece, cell B2 contains the 'associated' value 130.
    cell A3 contains the string Three-Quarter, cell B3 contains the 'associated' value 150.
    Now table Main
    In column B the cells contain a pop_up menu with four items like the ones described by Jerrold.
    In column C of the cells contain the formula :
    =IFERROR(VLOOKUP(B,Tableau 2 :: A:B,2,FALSE),"")
    I enhanced it since yesterdays because I forgot to treat the case when cell is blank in column B.
    I apologize but as I'm using my machine in French, the screenshot display the French formulas.
    I repeat that you may find useful infos in the PDFs files which we may download from the menus:
    Help > Numbers User Guide
    Help > iWork Formulas and Functions User Guide
    As you are in Stoke-on-Trent maybe your system is set to use the comma as decimal separator.
    If it's that, you must replace the comma by semi-colons in the formulas (you may see them in my screenshot).
    Yvan KOENIG (VALLAURIS, France) mercredi 24 mars 2010 09:27:53

  • Get field value in a BADI

    Hi everybody.
    Im implementing a Badi and I would like to get the value that has been filled by the user in the original dynpro. I can´t get this value from exporting and importing structures that are received in the badi.
    I know two ways to get the field:
    - With the FM CALL FUNCTION 'DYNP_VALUES_READ'.
    - With field symbols with the name of the program and the name of the field.
    The problem is that the filed I can get its value is and object text and this two ways doesn´t work.
    Neither I cant get this value with the function READ_TEXT.
    How could I get this value???
    Thanks a lot!!!!

    Come On!!
    yesterday I tried in my system and it worked.
    If you put (SAPLIQS0)LTXTTAB[] in the debugger variable window you can see entries in the internal table. I think you are mistaking while reading the content of the internal table to your internal table.
    And believe me you have the solution.
    Now try this following code in the BADI implementation.
    FIELD-SYMBOLS: <fs_ltxttab> TYPE tline_t.
    ASSIGN ('(SAPLIQS0)LTXTTAB[]') TO <fs_ltxttab>.
    IF sy-subrc eq 0.
    ENDIF.
    You will have the subject description content you maintained in the notification in <fs_ltxttab>.
    Thanks,
    Mainak

  • How to get different values in drop down in  table rows

    Hi
    I have an application, which has a drop down in the table. Each row is to have different values in its drop down based on the "characteristic" parameter. For eg. first row has characteristic as color, and the corresponding drop down will contain the color names. Second row has charateristic as weight, and the drop down will carry corresponding weight values.
    I am getting the data from the backend as a flat table i.e. charaterisitc - value pair.
    I think i will have to use the Drop Down by Index control, but i dont know how exactly to go about it.
    Can any one please help in this regard.
    Thanks & regards,
    Anupreet

    Hi Maksim
    I am sorry, but i am not able to get you.
    This is the piece of code that i wrote for populating the drop down:
    IPrivateMaintainDocAttribView.IDropElement dropEle = null;
    for(int i = 0;i<size;i++)
                 dropEle = wdContext.nodeDrop().createDropElement();
                 dropEle.setDropval(wdContext.nodeCtxNode_DocAttribs().getCtxNode_DocAttribsElementAt(i).getCmpCtx_Value());
                 wdContext.nodeDrop().addElement(dropEle);
    Here, Dropis the sub node to which i am putting the data and thisis linked to the table.
    CtxNode_DocAttribs is the model node from where i am picking the data and setting in the subnode.
    Thanks & regards,
    Anupreet

  • How can i get the value stored in the session object using its sessionid

    how can i get the value stored in the session object using its sessionid by running stand alone java application

    myforum wrote:
    how can i get the value stored in the session object using its sessionid by running stand alone java applicationThis does not seem to make sense! You need at least to give a lot more detail of what you are doing.

  • How to get its initial value?

    suppose I have a textfield with a initial value of "hello",
    when the first request is hit, this value is null,
    but if I refresh the page, the value is accessible.
    How to get the value during its first request?
    Thank.

    Hi
    can you please explain what is different between prerender / init / constructor of backing bean ?
    I read the java doc but i can not understand them correctly ?
    does constructor execute if we press a button on the page?
    Thanks

Maybe you are looking for

  • Problem with youtube and other video websites

    I have a problem with youtube and other video websites: Everything is up to date (flash, FF, my plug ins..) but i keep getting freezes when the video loads. I can hear sound but i can only see the first frame of the video. I've reinstalled flash/fire

  • Is there a way to delete multiple photos from your iPhone?

    I'm trying to free up some space on my iPhone by deleting photos. It is taking me forever though because I have to select them one by one to delete them and then do the same thing to permanently delete them. Is there a quicker solution?

  • Tecra M1 - Modem doesn't work (can't open a port)

    I have a problem: After reinstalling WinXP and drivers on my Tecra M1, modem doesn't function. It even can't diagnose itself - there always comes a warning: "Can't open a port (COM). It may be used by another device or application". I installed the l

  • Taxes in Sales

    Hi all, we have a process where we have to use VAT 4% on Line item 1 & 2 and VAT 12.50% on Line item 3 & 4 , here we are using Tax calculation through Tax Code i maintain tax % condition record with combination of CountryPlant RegionCustomer region i

  • I do not want to be too picky here, but does anyone hear a hum from C2D?

    Ok, let's get this straight. I have been through the whine, and that is something to complain about. What I am talking about is a smaller noiser that can be heard when my computer is on my iCurve. I am not sure if it is just the angle it sits at when