Jsp:usebean How to get value of an object from a bean

I am new to JSP and am struggling from past few days to solve a problem. Consider the below scenario
Class Book{
private String author;
public void setAuthor(String author)
public String getAuthor(){
return author; }
Class Rack{
private Book []books;
public []Book getbooks()
return books;
public void setbooks([]Book val){....}
Suppose Books gets populated only using Rack and I have Rack populate in my session, using jsp:usebean or any other tag how can I get value of author? Does using tag handle null value check of books, if books are not set by any chance?
Regards,
Dhyan

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.

Similar Messages

  • XSL-How to get value of a variable from inside loop-- to the outside loop?

    Pls help
    hi im currently working on this xsl file..
    This works on generating a txt file,my problem right now is
    ' how can i get the value of a variable generated from the inside forloop,
    i have to get the total,sum value of this variables after performing the loop
    ***this is the for loop
    <xsl:for-each select="OutboundPayment">
    <xsl:variable name='id' select='generate-id(OutboundPayment)'/>
    <xsl:sort select="PaymentNumber/CheckNumber" data-type="text" />
    <xsl:variable name='PValue' select='format-number(100*PaymentAmount/Value,"0000000000000")'/>
    <xsl:value-of select='$id'/>
    <xsl:text>D</xsl:text>
    <xsl:value-of select='$DDate'/>
    <xsl:value-of select='$Batch'/>
    <xsl:text>3</xsl:text>
    <xsl:value-of select='format-number(PaymentNumber/PaymentReferenceNumber,"0000000000")'/>
    <xsl:value-of select='format-number(PayeeBankAccount/BankAccountNumber,"0000000000")'/>
    <xsl:value-of select='substring(Payee/Name,1,20)'/>
    <xsl:value-of select='$PValue'/>
    <xsl:variable name='Addend' select='concat($DDate,substring($DAcct,5,5),$Batch)'/>
    <xsl:variable name="LHash">
    <xsl:call-template name="GetHash">
    <xsl:with-param name="A1" select="$PValue" />
    <xsl:with-param name="A2" select="$Addend" />
    </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="concat('[',$LHash,']')" />
    <!--LHash*i have to get the total amount of this one from the outside loop /---->
    <xsl:call-template name='NewLine'/>
    </xsl:for-each>
    <!--I have to put in here the total value of that LHash/---->
    <!--This is the template on how to get the value of that variable in the inside loop/---->
    <xsl:template name="GetHash">
    <xsl:param name='A1'/>
    <xsl:param name='A2'/>
    <xsl:variable name='TwoSum' select='format-number($A1+$A2,"000000000000000")'/>
    <xsl:variable name='Weight' select='317191314191112'/>
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="15"/>
    <xsl:with-param name="Sum" select="$TwoSum"/>
    <xsl:with-param name="Wgt" select="$Weight"/>
    <xsl:with-param name="Tot" select="0"/>
    </xsl:call-template>
    </xsl:template>
    <xsl:template name='WDigit'>
    <xsl:param name='Cnt'/>
    <xsl:param name='Sum'/>
    <xsl:param name='Wgt'/>
    <xsl:param name='Tot'/>
    <xsl:choose>
    <xsl:when test="$Cnt > 0">
    <xsl:variable name='Multip' select='substring($Wgt,$Cnt,1)'/>
    <xsl:variable name='Factor' select='substring($Sum,$Cnt,1)'/>
    <xsl:variable name='Prduct' select='$Multip$Factor'/>
    <!--xsl:value-of select="concat($Tot,'[',$Cnt,']')"/-->
    <!--xsl:value-of select="concat($Multip,'x',$Factor,'=',$Prduct)"/-->
    <!--xsl:call-template name='NewLine'/-->
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="$Cnt - 1"/>
    <xsl:with-param name="Sum" select="$Sum"/>
    <xsl:with-param name="Wgt" select="$Wgt"/>
    <xsl:with-param name="Tot" select="$Tot+$Prduct"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:variable name="Rem" select="$Tot mod 11"/>
    <xsl:variable name="Chk" select="11 - $Rem"/>
    <xsl:value-of select="format-number(concat($Tot,$Chk),'00000')"/>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:template name='GetTotal'>
    </xsl:template>
    Thanks in advance for those who are willing to help.
    -Leighya

    It would have helped if you had posted your code as CODE but as it is, I could hardly read it. My guess about what you are asking is, if you want a template to return a value, just write that value to the result stream inside the template.
    If that wasn't what you were asking, then please post your code in a readable format.

  • How to get value in dashboard prompt from database

    Hi All,
    I am using dashboard prompt (Year Prompt) to filter reports on year basis.
    fact table stores the hit date on a particular site linked with date dimension table .
    I have Datas in fact table say from year 2005 to 2009 .In dashboard Prompt it is showing me all the years 1990 to 2021(that are in date dimension).
    I hard coded the value of years in prompt now it only showing me years 2005 to 2009.
    My question is that is their any way that prompt automatically take values from database, those years which are stored in fact table ?
    Thanks in advance.

    Hi...
    Try writing query for dashboard prompt to get desired values..
    *select distinct year(FactTable.HitDate) from SubjectAreaName*
    To work this.. you should have HitDate column in presentation layer. (You can drag this column from fact in BMM and drop in any dimensions of presentation Layer, and name it as HitDate (Fact).. some thing like this...

  • How to get value of some key from Registry Edit in a Java class?

    Hi,
    I want to write a program which needs to access the value for HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0\MSI' paths 'INSTALLDIR' key's value.
    Does anybody have pointers on this?
    Thanks In Advance,
    Kalyani.....

    hi,
    this is the code i am employing and i want to know why i am failing:
    import com.ice.jni.registry.Registry;
    import com.ice.jni.registry.RegistryException;
    import com.ice.jni.registry.RegistryKey;
    import com.ice.jni.registry.RegStringValue;
    import com.ice.jni.registry.RegistryValue;
    * @author ayesha
    public class ReadingRegistryValueFromRegistry {
         private static String TOP_KEY_NAME="HKEY_LOCAL_MACHINE";
         private static String KEY_NAME="SOFTWARE\\JavaSoft\\Java Development Kit\\1.5.0_08 ";
         private static String ARG_KEY="JavaHome";
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
    System.out.println(getGMDBPathFromRegistry()+"111111111111111111111111111111111111111111111111111111111");
         private static String getGMDBPathFromRegistry(){
              String gmDBPath=null;
              RegistryKey topKey=null;
              String topKeyName=TOP_KEY_NAME;
              //System.out.println(topKeyName+"33333333333333333333topkeyname");
              String keyName=KEY_NAME;
              //System.out.println(keyName+"5555555555555555555555555555555keyName");
              String argKey=ARG_KEY;
              //System.out.println(argKey+"66666666666666666666666666666666666666666666666666666666argKey");
              topKey=Registry.getTopLevelKey(topKeyName);
              System.out.println(topKey+"somethingsomething");
              if(topKey==null){
                   return gmDBPath;
              RegistryKey subKey=Registry.openSubkey(topKey,keyName,RegistryKey.ACCESS_READ);
              try{
              System.out.println(subKey.toString()+"value i got in here");
              catch(Exception e){
                   System.out.println(e.getCause().toString());
              if(subKey==null){
                   return gmDBPath;
              try{
                   gmDBPath=subKey.getStringValue(argKey);
              catch(RegistryException ex){
                   return gmDBPath;
              return gmDBPath;
    I want to read from the registry entry the value of java.
    Any suggestions are eagerly awaited.
    ayesha.

  • How to get value of a structure from a standrd program to Z program

    There is a standard program which generates a file when it is run a file is created
    The name of the file is stored in a structure. I am submitting this standard program in my Z program I have to get the file name from the structure

    Hi,
    Does this help?
    you can retrieve the content of a structure from another shared memory by assigning it with a field symbol:
    e.g.
    FIELD-SYMBOLS: <staffel> TYPE table.
    * get itab data from SAPMV13A
    ASSIGN ('(SAPMV13A)STAFFEL[]')  TO <staffel>.
    Kind regards, Rob Dielemans

  • How to get value of html combo box (i.e select) in jsp?

    Hello,
    I was just wondering how to get value of html combo box in jsp page. My code for combo box is:
    <select name="combo" size="1">
    <%
    List<Project> projects = mgr.getProjects();
    for(Project project : projects){
    %>
    <option value="<%= project.getId()%>"><%= project.getName()%></option>
    <%
    %>
    </select>
    I thought combo.value might give me the value, but it throws exception.
    Any help is appreciated.
    Thanks.

    The combo does not exists in Java, but only in HTML. You have to submit the form containing the combo and then use request.getParameter("combo") to get it's value ;-)

  • How to get value in showModalDialog()

    Hi,
    I would like to know how to get value pass into showModalDialog() to be used by the server (using request.getParameter())
    TQ

    please try out this kind of code
    <script language="javascript">
         function trial(){
              var retVal = new Object();
              retVal = ShowModalDialog("ur JSp");
    </script>
    <script>
    <form >
    <input type="hidden" name ="mylink "value= javascript:trial();>
    </form>
    <%
         String str=request.getParameter("mylink");
    %>
    and plz let me know .. if it works

  • How to get value by jstl?

    select IEPort,seqNo,IEDate,trafMode from TImport
    this is in hibernate hql
    List queryResult = dao.getList(session, form);so in the list is not a bean but an Object, so in the Object do not hava attribute name, i don't know how to get value by JSTL in the jsp, who can help me

    JSTL can figure out what the specific type of the Object is on its own. Just reference the attributes of your bean using the expression language like you would normally do. If you are uncertain print out the classname of the objects in the list like this:
    ${obj.class.name}where obj is an object from the list. This should print out the name of your beans if hibernate did its job properly. JSTL will know what properties these objects has even if you only pass it an Object reference.

  • HELP! I need help to understand how to get value on radio buttons!

    hello,
    I realy need the help from anyone that knows how to get value from radio buttons in a JSP.
    I have this :
    <%
    java.util.Vector vLinha = (java.util.Vector) datos.get("ConsNefect");
              java.util.Hashtable ordens;
              java.util.Enumeration eLinha = vLinha.elements();
              String t = "radio";
              String x = "escolha";
              String l = "";
    int i = 0;
              //int esc = 0;
    String fila = "";                         
              boolean bol = true;
    while (eLinha.hasMoreElements())
    ordens = (com.ibm.dse.base.Hashtable) eLinha.nextElement();     
              if (++i%2 == 0)
    fila = "formgriscla";
    else
    fila = "formgrisosc";
    out.println("<tr>");
    out.println("<td class=\"" + fila + "\">");
    out.print("<p class=\"dato2\">");          
              out.print("<a href=" + urls.get("action"));
         out.print("&sequencia=" + (String) ordens.get("sequencia"));                    
         out.print(">");
              out.print((String) ordens.get("descricao"));
         out.print("</a></p></td>");
              out.println("<td class=\"" + fila + "\">");
    out.print("<p class=\"datop\">");          
              out.print((String) ordens.get("datap"));
    out.print("</p>");
    out.println("<td class=\"" + fila + "\">");
    out.print("<p class=\"datop\">");
    out.print((String) ordens.get("erro"));
              out.print("</p>");
              out.println("<td class=\"" + fila + "\">");
              out.print("<p class=\"datop\">");     
              l = (String) ordens.get("sequencia");     
              out.println("<input type=\"" + t + "\" name=\"" + x + "\" value=\"" + l + "\">");          
              out.print("</p></td>");      
              out.println("</tr>");
              //esc++;
    %>
    <!--input type="Hidden" name="escolha" value=<!--%l%>-->
    <!--input type="Hidden" name="escolha" value="<!--%=escolha%>"-->
    </td>
    </tr>
    I don�t know how to take the value... PLEASE HELP ME OUT!
    THANKS TO ALL!,
    Best wishes,
    Alex (portugal)

    You must wrap your contents into a FORM element and, then, using getParameter("escolha"), retrieve your value.

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • How to get value in a web page automatically  and sava output in database

    how to get value this table output is
    row 1, cell 1
    row 1, cell 2
    row 2, cell 1
    row 2, cell 2
    <table border="1">
    <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    </table>

    Note: This thread was originally posted in the [Java Technologies for Web Services|http://forums.sun.com/forum.jspa?forumID=331] forum, but moved to this forum for closer topic alignment.

  • How to get value in function insert table test ?

    Hi
    I use function insert table test in order to get value in table for use in code page but i don't know how to get value in table.If somebody have any idea.Please give me some advice.
    Thank you,
    Waruja

    You will need to grab the contents with VBA
    Table test is user interface only.
    This thread may help
    http://qazone.empirix.com/thread.jspa?threadID=748&tstart=0

  • How to get value of URL parameter

    Hi,
    If an ABAP Web Dynpro URL looks like this: http://<server>:<port>/sap/bc/webdynpro/sap/zny_test1?sap-client=100&sap-language=EN, how to get value of the URL parameter “sap-client” at runtime in the application?
    Thanks,
    Nancy

    The framework currently strips all the framework specific params.
    Perhaps the will be made available in a future release.  Thomas, any comments ?
    However, I dont understand the requriement to know the sap-client URL value.
    If your code is running, a user has successfully connected to system a therefore he has a session open and this session is associated with exactly 1 client at any point in time.
    See SYSTEM VARAIBLE   SY-MANDT.
    this represents the client in which the users session is running and negates the need to see
    sap-client URL value.
    regards
    Phil.

  • How to get Value of tree node without Reload Page

    hi,
    i worked with apex 4.2 and i created Tree and tabular form to retrieve the date according the value of tree select node the code of tree something like this
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "ENAME" as title,
    null as icon,
    "EMPNO" as value,
    null as tooltip,
    'f?p=36648:34:5234984107903::::P40_SELECTED_NODE:'||empno as link
    from "DEPT"."EMP"
    start with "MGR" is null
    connect by prior "EMPNO" = "MGR"
    order siblings by "ENAME
    and i put Selected Node Page Item: P40_SELECTED_NODE . the tree worked good and retrieve the data into tabular form according to tree node value
    my Question :
    1- i want to retrieve the data without submit the page where each time i select value from tree make page reload to update the tabular form with new value ,there is any way to pass the value of tree node to P40_SELECTED_NODE item and refresh tabular form without page reload .
    2- i want when selected from tree run page process according to value of tree node i tray to create Dynamic action with *(jquery selector : div.tree li>a)* but the Value of node incorrect.
    Regards
    Ahmed;

    look at this link
    Re: How to get Value of tree node without Reload Page ..!

Maybe you are looking for

  • Won't show March 2013

    iCal consistently won't show March 2013 on my iPad. Anyone else got this problem? All other months are ok.....!

  • Fotostream

    I cant use photostream on my IMAC - no problem with the iphone or Ipad. When I login on ICloud, open Iphoto and ask to connect to photostream I am told: " Iphoto could not connect to Photostream" What is wrong ?

  • Video & Podcast has sound but NO video

    When I sync video or podcast to my 30g Ipod, It just shows a small still picture with the title beside it. It does play sound but absolutly no video. How do I fix this problem?

  • How can I hide fields when printing?

    On a form I have created for our field staff, we have many conditions of what options will show based on different selections on the form. When printing their responses, the entire form prints, even with items that have nothing to do with the selecti

  • Battery Problems

    Hey everyone, Just bought a used iPod Nano (first generation) off eBay and, surprise surprise, I'm having some troubles with it. Essentially, the problem seems to be that the iPod thinks its always plugged in to a power source. Here are the symptoms