How to share variable between jsp and JSF?

hi:
I have code :
<h:dataTable binding="#{Tables.dataTable}" value="#{Tables.query}" var="currentRow">
<h:column>
<h:outputText value="#{currentRow['factorycode']}"/>
</h:column>
<%
//here I want get upon variable currentRow and process some field.
// but how java code I can get the currentRow,
//currentRow is a ResultSet object
%>
</h:dataTable>
thanks

EL cannot pick up scripting variables. It picks up attributes from scope only.
Similarly it doesnt set any scripting variables too.
<%
              int g_nAge=12;
              pageContext.setAttribute ("g_nAge", new Integer(g_nAge));
%>
${g_nAge}cheers,
ram.

Similar Messages

  • How to deliver variable between jsp and EL ?

    this is the code of my *.jsp
    <%
    int g_nAge=12;
    %>
    ${g_nAge}
    I suppose that "12" is showed in my web-page,but actually I see nothing.
    This is an example in my jsp book showing the delivering variable between JSP and EL !
    how can it do that ?

    EL cannot pick up scripting variables. It picks up attributes from scope only.
    Similarly it doesnt set any scripting variables too.
    <%
                  int g_nAge=12;
                  pageContext.setAttribute ("g_nAge", new Integer(g_nAge));
    %>
    ${g_nAge}cheers,
    ram.

  • Share variables between JSP and Classes

    Hello !
    Is there any way to share the same variables between JSP�s and Classes?
    For example...
    I have 20 variables in a JSP page (with values, like constants...) and I want to view their contents inside the classes...
    Is there any way? Maybe a import or something like this...
    Thanks,
    Igor.

    If you search the forums you will find many answers to your questions. You can also try the servlet and JSP short courses listed below;
    Here is lthe link that will take you to the Java.sun.com Tutorial pages.
    http://developer.java.sun.com/developer/onlineTraining/
    Here is a tutorial on Servlets
    http://developer.java.sun.com/developer/onlineTraining/Servlets/Fundamentals/contents.html
    Here is the tutorial on the JSP
    http://developer.java.sun.com/developer/onlineTraining/JSPIntro/contents.html

  • What's the difference between jsp and jsf?

    who can tell me what's the difference between jsp and jsf?
    I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)

    Hi,
    Find the difference between JSP and JSF
    1. A developer has more control with JSP, but (should) get easier development with JSF
    2. Event handling is done differently in JSP (HTTP) and JSF (Java)
    3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
    4. The end product should also be defined differently - JSP page versus a JSF application.
    Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
    All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
    If you are in this vacuum here are some key points promoting JSF:
    1. Fundamental unit is the Component
    2. Built in event and state management
    3. Component sets can be provided by any vendor
    4. Closer to ASP.Net or Swing development
    5. Choice of UI technology
    6. Scale up (rich clients)
    7. Scale down (mobile devices)
    8. Built into J2EE containers in J2EE 5.0 (tentative)

  • Difference between JSP and JSF

    What is the difference between JSP and JSF?
    Is it necessary to learn JSP before starting with JSF?

    JSP is a view technology providing a template to write plain HTML/CSS/JS in. JSP supports Java based taglibs to generate output and/or control the page flow dynamically. A well known example is JSTL. JSP also supports access to backend data with help of EL (Expression Language).
    JSF is a component based MVC framework which provides taglibs for use in JSP, the JSF core tags in <f:xxx> and the JSF HTML tags in <h:xxx>. Those tags generate HTML output and are tied to JSF component tree in the server memory so that the FacesServlet can work on them to gather request parameters, validate/convert them, update the model values (javabean properties), invoke some actions (javabean action methods) and render the response.
    You can use JSF on top of either JSP or Facelets. Facelets is another view technology. JSP is ancient and has its shortcomings when JSF comes into picture. Facelets is designed with JSF in mind and much more well-suited for it and provides great templating/composition capabilities to reuse specific groups of components without the need to wrap them in another custom component (so that you don't duplicate the same code over and over, e.g. label+input+message.

  • How to share files between pc and mac via external hard drive

    how can i share my files(mp3,mp4,documents) from my harddisk with mac. i am a new mac user and i have a harddisk of NTFS format(as i was a pc user).I learned that mac supports FAT32 format and therefore i can't write data on my external hard drive.
    but, reading a section of OSX yosemite(under compatibility) it is said that now we can easily share files between pc and mac.
    So please suggest me easier way that how can i share files between macs and pc as my friends uses pc and in future i really want to share my data with them without any hustle and i dont wanna loose my data in future

    You can format the HDD to a common one like ExFAT or Fat32 but a reformat will delete all data off of the HDD.
    Your other option is to use a third party software such as Paragon or Tuxera that will allow you to write to a NFTS formatted HDD.
    Ciao.

  • How can I pass a variable between JSP and Role Form

    I need to pass a variable from (a copy of) applicationmodify.jsp to the IDM Role Form so that the variable is available within the Role Form at display. We've tried getAttribute and setAttribute modifying both the Role Form and the applicationmodify JSP and can get the form to the role form but not accessible but have had no other success. Has anyone had any success in doing this? Any suggestions would be appreciated.

    if by _root level you mean you're loading something into
    _level0 you can't won't be able to use the localconnection. the
    sharedobject is your only option.

  • How can I change between JSP and Java in the page language attribute

    Does any one know the answer to this? I am trying to Switch between the 2 in the middle of the page. I want to include a file that uses <%@ page language = "JAVA" %> but the main mage uses Java Script. How can I switch it for this one file. I can't find the answer anywhere. Thanks for your time, and please help me. Also can some one post a good link for Session Tracking. I can't find much good information on that. Thanks again.
    Eagles757(JAY)

    Wow this didn't make sense in so many ways. It's truly bordering on nonsense. I think it's written in English.
    <%@ page language="Java" %>This is optional. JSPs don't use any language other than Java. This is known as a JSP Directive. This line will be processed by the JSP/Servlet engine, and you won't see it in your output. If JSP ever supported a language other than Java, this would be where you would change it.
    <script type="text/javascript">
    <!--
    // -->
    </script>You can include a block like this in your JSP file. The JSP/Servlet engine will not process this script block at all (unless you include JSP <% %> tags somewhere in there, in which case they will be processed before the response is sent back to the web browser). This script block is where JavaScript goes. This code will be executed on the client's browser.
    This is about as clear as I can make things given how muddled your question is. Please ensure you understand the basic differences between JSP, Java, JavaScript, HTML, Servlet engine, web browser before proceeding. Understand what code executes where, and in what order.
    Brian

  • In a dynamic page how to share variable between PL/SQL and javascript

    For example, my dynamic page contains such PL/SQL codes:
    <ORACLE>
    DECLARE
    info varchar(100);
    rowid urowid;
    procedure doDelete(
    row_id in urowid
    ) IS
    begin
    Delete From xxx
    WHERE rowid = row_id;
    end doDelete;
    BEGIN
    Select name, rowid INTO info, rowid
    From xxx Where xxx;
    HTP.PRN(' <INPUT TYPE="button" VALUE="show value" onClick="alert(info);">');
    HTP.PRN(' <INPUT TYPE="button" VALUE="delete" onClick="doDelete(_row_id);">');
    END;
    </ORACLE>
    The variable 'info' and '_row_id' are correct, however the two HTP. sentence do not work. What's the problem?
    What I want to do is to show all the records in TABLE A in a page. And at the end of each line (record), there' re a 'delete' and a 'update' button to let user operate on this record. Is this possible? I know form can do delete an update, but it can not show all the records in a page like what report does. Besides dynamic page, is there any other better choice? Report can do it?
    One more question. In a report, I employed link on one field to a second report. It works well. But I want to open the second report in a new window when the link is click. Is this possible?
    I was almost driven crazy by these :( I so appreciate if anyone can help.

    The code written by you is insufficient for the funtionality you are trying to achieve. Below is a method to achieve the same.
    Note: Used standard scott.emp table for the example which is located in my db provider schema.
    Do the below modifications as per your local configuration
    xxxxx -> Replace it with your Portal schema
    yyyyy -> Replace it with your db provider schema
    <<module_id_of_form>> -> Replace with the module id of form created in step 1 & 2.
    First and foremost... oracle does not allows variables starting with '_'. So if you want to use it you have to place it in double quotes ("")
    rowid -> illegal
    "_row_id" -> legal.
    However, I will advice you not to use variable names starting with "_".
    Now lets get started...
    1. Create a form on the table you are using in the dynamic page. Just have the update button. Remove the other buttons.
    2. Get the module id of this form. Instruction for getting the module id:
    a) Right-click on the form's run link and copy the shortcut
    b) Get the value of p_moduleid parameter. This is your module id.
    3. Create a procedure "save_action_details" in your db provider schema. This procedure will accomplish the delete operation on the record.
         CREATE OR REPLACE Procedure save_action_details(
         p_rowid IN VARCHAR2,
         p_action IN VARCHAR2,
         p_dyn_ref_path IN VARCHAR2,
         p_dyn_page_url IN VARCHAR2)
         is
         l_sto_session xxxxx.wwsto_api_session;
         begin
         l_sto_session := xxxxx.wwsto_api_session.load_session(
         p_domain => 'DynStore',
         p_sub_domain => 'DynStore_' || p_dyn_ref_path
         l_sto_session.set_attribute(
         p_name => 'rowid',
         p_value => p_rowid
         l_sto_session.set_attribute(
         p_name => 'action',
         p_value => p_action
         l_sto_session.save_session;
         htp.init;
         owa_util.redirect_url(p_dyn_page_url);
         end save_action_details;
    Explaination: The above procedure creates a session and keeps the rowid and action in the session. This information is used by the below dynamic form to perform the necessary action. In our exampl, the action is always going to be delete so you may go ahead and hard code it, else leave it as it is.
    4. Grant execute privilege on the procedure "save_action_details" to public.
    sql> grant execute on save_action_details to public;
    5. Create your Dynamic page.
    a) In HTML code section have the below code. This code shows some columns from the table and "update" and "delete" buttons to perform the respective action.
         <ORACLE>select empno,ename,rowid,
         '<input type="button" value="Update" onClick="doAction(this.form,''UPD'',''xxx'','''
         || xxxxx.wwv_standard_util.url_encode(rowid) || '''); tWin();">
         <input type="button" value="delete" onclick="doAction(this.form,''DEL'',''' || rowid || ''',''xxx'');">' Action
         from yyyyy.emp</ORACLE>
    b) In additional pl/sql code section of dynamic page, have the below pl/sql block "in after displaying the header" section.
         declare
         l_sto_session xxxxx.wwsto_api_session;
         l_del_rowid varchar2(20);
         l_action varchar2(10);
         begin
         htp.comment('User code starts here ...');
         htp.p('<script>');
         htp.p('var winHandle;');
         htp.p('
         function doAction(formObj, action, rowid, erowid)
              if (action == "UPD")
              var formURL = "' || xxxxx.wwctx_api.get_proc_path('wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=<<module_id_of_form>>&p_arg_names=_rowid&p_arg_values=') || '" + erowid;
              winHandle = window.open(formURL, "winDynUpd", "width=750,height=500,resizable=yes");
              else
              formObj.p_rowid.value = rowid;
              formObj.p_action.value = action;
              formObj.submit();
         function tWin() {
              if (winHandle.closed) {
              document.location = document.location;
              else {
              setTimeout("tWin()", 500);
         htp.p('</script>');
         htp.p('<form name="dynRowProcess" method="POST" action="'
         || xxxxx.wwctx_api.get_proc_path('save_action_details','yyyyy')
         || '">');
         htp.p('<input type="hidden" name="p_rowid">');
         htp.p('<input type="hidden" name="p_action">');
         htp.p('<input type="hidden" name="p_dyn_ref_path" value="' || p_reference_path || '">');
         htp.p('<input type="hidden" name="p_dyn_page_url" value="' || p_page_url || '">');
         l_sto_session := xxxxx.wwsto_api_session.load_session(
         p_domain => 'DynStore',
         p_sub_domain => 'DynStore_' || p_reference_path
         l_del_rowid := l_sto_session.get_attribute_as_varchar2('rowid');
         l_action := l_sto_session.get_attribute_as_varchar2('action');
         if l_action = 'DEL' then
         delete from yyyyy.emp
         where rowid = l_del_rowid;
         end if;
         end;
    Explaination: The session information (rowid and action) stored by "save_action_details" procedure is retrieved by the dynamic page and is used to delete the record.
    6. Once you are through with the above steps, test it by placing the above "dynamic page" portlet on a page.
    a) When you click on delete button the record gets deleted and the automatically refreshed page will not show the deleted record.
    b) On clicking update button, a form will appear. do the necessary modifications in data and click update. the data in the form gets updated. Once you close the form the dynamic page gets refreshed automatically and it will show you the updated information.

  • How to access variables across JSP and JavaScript?

    Hi,
    I have some .js files and in those files, some of the methods need to access to the variables that I'd declare in the jsp files. How do I do it?
    Anne

    You can do it this way, but I'm not sure if this is what you had in mind.
    Say you had a java variable called XString. And you wanted to display
    the value of XString in a javascript Alert. Here's how:
    <html>
    <body>
    <% String XString = "Hi There!"; %>
    </body>
    <script language="javascript">
    alert("<%=XString%>");
    </html>Hope This Help,
    P.

  • How to share variable between

    HI, I want to write a program with two classes, and there is a variable that should be shared between these two classes. I don't know how to realize the sharing. Thanks

    Here you go:class A {
       // whatever type T is ...
       private T sharedVariable;
       // get/set it
       public void setSharedVariable(T that) { sharedVariable= that; }
       public T getSharedVariable() { return sharedVariable; }
       // etc. etc.
    class B {
       private A a;
       // pass the stuff to be shared ...
       public B(A a) { this.a= a; }
       // get/set it
       public void setSharedVariable(T that); { a.setSharedVariable(that); }
       public T getSharedVariable() { return a.getSharedVariable(); }
       // etc. etc.
    }kind regards,
    Jos

  • How to share Lists between ipad and iphone

    I have Notes on my ipad and iphone. Both have iCloud Sharing turned on. I am not able to share the Notes between the two devices so I can view the lists and notes on both. How do I do this??

    Also check Any Exchange accounts that you might be using - including any paid Google apps accounts. Look in Settings > Mail, Contacts, Calendars to be notes synching is off for those accounts.

  • How to share files between computers and TC

    What is the best way to share content/files between computers (iMac and MacBook Pro)?
    I thought about using Time Capsule for this...is this NOT wise?
    Thanks

    What is the best way to share content/files between computers (iMac and MacBook Pro)?
    The simplest way to do this would be to enable File Sharing on both Macs.
    On each Mac....
    Open System Preferences (gear icon on the dock)
    Open Sharing
    Enter a check mark next to File Sharing
    Now when you open the Finder or Macintosh HD, you will see the "other" Mac and you will be able to access files/folders, etc. on the other computer.
    I thought about using Time Capsule for this...is this NOT wise?
    The Time Capsule was designed to work with the Time Machine application to back up your Mac(s). As such, the TC will make a complete copy of each Mac on the first backup and backup any changes after that to keep a complete timeline of each Macs files. Each computer normally will only be able to access the backups for that given computer.
    While it is possible to store normal files or folders on the Time Capsule disk, this is not generally recommended as there will eventually be a struggle between Time Machine and the files on the disk as the drive begins to fill up. The other thing to keep in mind is that access to the drive for "normal" files will be quite slow.

  • NativeProcess: how to send variables between AIR and C#?

    Hi, how do I make AIR send variables to C#? And how do I make C# send variables back to AIR?
    Please help!

    You can send arguments back  through the standard output of  your c# code.
    maybe this can help ?
    http://www.adobe.com/devnet/air/flex/quickstart/articles/interacting_with_native_process.h tml
    regards,
    Alain

  • How can share data between jsp pages using beans??

    any one can give me code for 2 jsp pages with bean that share data for them

    <jsp:usebean name="yourBeanName" type="com.whatever.foo" scope="session"/>
    this will look for a bean named yourBeanName in the scope specified by the scope attribute. If none was found, the container will instantiate one with the no arg constructor for your bean and place it into the proper scope.
    if your bean had a method getName(), you could then on your jsp do:
    <%=yourBeanName.getName()%> to print the results of the method to the page. there are other ways to do the actual placing of the output on the page, but this is the most direct.

Maybe you are looking for

  • Undesireable Table Behavior After Patch 14582286 Installation

    I'm running our application on a stand-alone instance of WebLogic with the ADF runtime.  Here is a printout of of the opatch lsinventory: [code] Oracle Interim Patch Installer version 11.1.0.9.0 Copyright (c) 2011, Oracle Corporation.  All rights res

  • Need help adding AM/PM to my clock program

    Hi everyone I would be grateful if you could help me adding AM/PM to my clockDisplay program, been trying but i'm not very familiar with Java. Thanks I have used 2 classes: NumberDisplay and ClockDisplay the clock automatically convert hours after 12

  • Java application for Digital TV

    Hello i would like to start making application for digital TV: my idea is to implement an easy to use email service. What kind of tools do i need to implement difital TV application in java?` What kind of TV should i use? how much does it cost...? do

  • Where does data of controlling version store in PS

    Hi Folks, I have created controlling version "Z01" like standard version 0. now I want to change plan values for project stored in version Z01 manually. How can I perform this is there any table or transaction?

  • Download Fails LR5 & PS

    Just signed on to CC today. Adobe accepted my payment just fine but download/install repeatedly fails. This is on a Mac OS 10.9 and trying to install Lightroom 5 (which I actually already own on my computer) and Photoshop CC. When I click the "more i