Diff between the variable declaration in following way

hi,
can any body tell me the scope of variable which are declared in following way.
<%! int i=0;>
<%
int i=0;
%>
will both variables have the scope untill the service method completed..
regards,
sam

hi,
can any body tell me the scope of variable which are
declared in following way.
<%! int i=0;>Class member. Like this:
public class MyJSP_jsp
  int i = 0;
  public void _jspservice(HttpServletRequest request, HttpServletResonse response)
<%
int i=0;
%>local to the service method
public class MyJSP_jsp
  public void _jspservice(HttpServletRequest request, HttpServletResonse response)
    int i = 0;
}>
will both variables have the scope untill the service
method completed..No. It is best to avoid the first (<%! %>) form, as all users who do to that JSP will share the data and it can lead to wierd behavior. Limit the scope using the scriptlet (<% %>) whenever possible.
regards,
sam

Similar Messages

  • Why can't i edit the variable declaration in Netbeans GUI Applications?

    When i drag and drop jbutton,jlabel and other tools from toolbox on the jform the code is
    automatically generated by the Netbeans.
    At bottom the variable declaration for the jbutton and for the other tools is automatically
    generated.
    The part of that declaration is shaded as grey.
    Is it possible to edit those variables from Netbeans?

    Yup, as Chuck states, it is possible to edit that region of code, since the file is nothing more than a text file, but doing so "breaks" the code so that you cannot modify the GUI content in NetBeans WYSIWYG form editor. Please note, that there are ways of changing the characteristics of those variables without editing them directly. You should look into how to change properties of your GUI with NetBeans. The online tutorials can show you how.

  • Get all the variables declaration in a program

    Is there a possible way to get all the variables declarations ( name and type ) inside a java program and not only the fields that you can easily get with reflection mechanism but also local variables inside a method?

    Kayaman wrote:
    Jigsaw23 wrote:
    local variables inside a method?Nope, you'd have to get inside the call stack for that and there's no easy mechanism for that.Even that wouldn't do it, since not all code is on the call stack at all times. There are ways to do it, using bytecode engineering, but I'm not going to get into that because if you don't already know how to do it, I doubt you have a problem that genuinely requires it.
    It's a bogus requirement anyway. Whatever you're trying to do, OP, it's doomed to failure. What are you trying to do? I mean, what were you doing that led to you thinking "If I knew what those local variable were, I'd manage it!"?

  • DIFFERENCE BETWEEN THE DATA DECLARATIONS NVARCHAR2 AND VARCHAR2(x CHAR)

    CAN ANYONE HELP ME FIND THE DIFFERENCE BETWEEN THE DATA DECLARATIONS; NVARCHAR2 AND VARCHAR2(x CHAR), WHERE X IS THE SIZE OF DATA TO BE HELD WITH THE VARIABLE OR ATTRIBUTE

    Duplicate posting....
    Difference between nvarchar2(10) and varchar2(10 char )
    Difference between nvarchar2( 10) and varchar2( 10 char)
    Please refer also...
    Nvarchar2

  • Diff between the Start routine and Update rules?

    Hi Gurus
    Diff between the Start routine and Update rules?
    Thanks in advance
    Raj

    Hi,
    Routines are like conditions or business rules that could be applied to filter the data while entering the BW system or could be used to apply certain conditions on the info objects itself.Update rule level you manipulate your data and  write your start routine.
    There are 4 types of routines
    1. Start routine- Could be used at two levels (transfer rule level and the Update rule level)
    This Start routine written at the transfer rule level helps filter the necessary data coming from the source system.
    For Example: If you decide to extract data that contain only quantity greater than 500 , then you could specify the Start rouitne to achieve this.
    The Start routine at the Update rule level provides similar functionality but at this point it helps direct specific data to 
    different data targets.  For Example: If there 3 data targets being fed from the Infosource, you may want to apply some condition to each data target, like send year 2000 data ti Data target1, 2001 to data target 2 and so on.  This can be achieved by using Start routine at the Update rule level
    2. Transfer Routine: This feature is available at the transfer rule levels
    While performing the transfer rules operation, there are 4 features available to the developers to create business rules on top pf the Infoobjects.
    1. You could do a one to one mappping of the Infoobject
    2. Provide a constant value
    3. Include a formula
    4. Write an ABAP routine.
    These 4 options refers to the transfer routine
    3. Update Routine:
    The limitations of just having 4 options in the transfer routine is overcome at the update rule level. There are various other 
    sophisticated features avaialable apart from the 4 options mentioned above. These business rules could be specified pertaining to each data target.
    4. Conversion Routine: It provides functionality to do Currency and unit conversion.
    Regards.

  • The diff between the two 8 core 3Ghz mac pros?

    I am in the market for a mac pro. I will spend the money for an 8 core 3ghz cpu. I am a “do it your self” kind of guy. I am not afraid to do some installations myself (drives, Ram, GFX card, optic drive,)
    I mainly use CS3, cinema 3D and FCP, On XP, Nuke and Studio Max. Dual displays, One 24” LCD and One CRT.
    I have a few basic questions that maybe someone can point me to a link or better explain.
    What is the diff between the two mac pros listed below. All I can come up with is the graphics cards and the ram? Is this right?
    My plan is to upgrade the ram with the newer 800MHz DDR-2 ram, and graphics card. The stock 7300GT can get me by for now, than something else when the time is right (8800GT, I have not done my homework here, not a priority yet). I do zero gaming and don’t even care to spend money to play games. My priority is not in gaming and I feel a majority of folks are spending the money on the card to play games, so I am trying to find the pros for upgrading in my situation. Better open gl capturing, better graphics acceleration in CS3 better for 3d apps, most likely, but I can survive with the 7300GT for now right? I am fine with that now, but an upgrade in a year or so in the graphics card department is the plan. My priority for the money is order: ram, cpu, drives, Gfx card.
    So, recap, what disadvantage would I put myself in for going with the 1st model of mac pro listed below or spend the extra 600 for the second model of macpro? Again, ram will 100% for sure be upgraded as will the hard drives.
    Advice please.
    Here is a link to the two units I am looking at. It is a 600$ difference.
    http://www.macmall.com/macmall/families/new_promo~dp~7445233~family~macpro~promo ~23.asp
    http://www.macmall.com/macmall/families/new_promo~dp~7371992~family~macpro~promo ~10.asp

    Thanks Twist,
    That is very useful info off the top of your head there. I will hopefully find the time this weekend to read through all the info and translate everything suggested from the other reply @ macworld.
    If anyone else has any useful info that is clear like twist please give me your suggestions, for now I will read a bit more as suggested.
    Thank you.

  • Diff between the J2ee port,webdispatcher port and ICM port

    HI All,
    Can some one please explain the diff between the web dispatcher port and J2ee port, I am able to under stand the diff between the web dispatcher port and the ICM port. What I understood is that all the requests will be passed to ICM through the web dispatcher , but what is the j2ee port refers ?
    Thanks & Regard
    Rajesh Meda

    Hi Rajesh,
    The Webdispatcher,ICM servers as services to reach the ABAP and Java stack respectively. ICM is thread oriented.
    Any communication flows through Webdispatcher ---> ICM ---> ABAP/Java Stack.
    Every instance has a ICM process in it. Webdispatcher is mainly used for load balancing and to be placed in DMZ zone for more protection of the communication channel. All the communication happens via port . Each of the service can be reached by independent ports or via Webdispatcher>ICM> J2ee.
    Like direct port for J2ee we also have direct port for ABAP message server.
    Hope this clarrifies. Kindly let me know in case of further queries.

  • Need to know the size of the variable declared as Xstring

    Hi All,
    I have got all the files from the applications server(for a given path) and have zipped all in to one file. But now need to find the size of it and throw a error message if it is less than a byte.
    Variable whick holds all the zipped data is " zip_content ". it is declared as " data: zip_content type xstring ".
    Not sure how to get the size of the variable " zip_content ".  
    When checked around found FM : EPS_GET_FILE_ATTRIBUTES but this requires File name or path. In my case I have only the
    variable.
    Thanks in Advance
    Regards
    Jithu

    Hi,
    When using
    data: l_cnt type i.
    l_cnt = xstrlen( g_zip_content ) .
    xstrlen will return only in byte mode and not in character mode.
    Thus the value l_cnt = 12112 which you got is in bytes which can be used to check your condition.
    Regards,
    Vik
    Edited by: vikred on Jul 29, 2009 4:01 PM

  • What is the difference between the function declared in the package and pac

    What is the difference between defining a function in the package and package body ?
    Edited by: user10641405 on Nov 19, 2009 1:29 PM

    If you describe a package, you will only see the functions declared in the spec.
    If you only declare them in the body then they are not available to other packages (they are private to the package, not public)

  • What is the diff between the ipad 3 and the i pad 4th generation

    what are the main differences between the i pad 3 and the 4th generation

    http://www.techradar.com/news/mobile-computing/tablets/ipad-4-more-than-twice-as -fast-as-ipad-3-benchmarks-reveal-1108743
    http://www.digitaltrends.com/mobile/ipad-3-vs-ipad-4/
     Cheers, Tom

  • Not able to find the variable Declaration BBP_PDH_CHK-GV_NO_JUMP.

    Hello
    I am working in SRM 5.0.
    Here i  have a problem on Screen refresh. I have analyzed ITS & Dynpro screens, And found its working based on a flag of GV_NO_JUMP.
    This variable has used in BBP_PDH_CHK internet service, SAPLBBP_PDH_CHK-1000 template.
    I want to find out where this flag has declared and where is got changed.
    Please help me to find out, where the GV_NO_JUMP flag assignment logic is written.
    Thanks

    vademecum wrote:I have that error myself and I figured that the host of the lyrics database changed the way external applications are allowed to access the content, thus breaking ncmpcpp's method of access and so it just defaults to the URL instead of fetching the lyrics.
    Guess this will be fixed with the next version, if the author adapts the code of the lyrics module or adds new databases to replace the old ones.
    Yeah I guess waiting for the update is the most practical solution right now.
    Wintervenom wrote:Try the GIT version.  It will search from several lyrics databases at once.
    Thanks a lot. I feel kinda stupid for not thinking of this sooner. This'll have to be my temporary solution until the one in the repos gets fixed.

  • I have a new Macbook Pro - trying to migrate files etc from my Macbook Air using a Thunderbolt Cable between the two.  I follow the directions but the two computers never "discover" each other.  WiFi connect works but 70 hours is a rough deal.

    I have a new Macbook Pro.  Trying to migrate files etc from my Macbook Air using a Thunderbolt Cable between them.
    I follow the directions but the two computers never "discover" each other - using a WiFi connection works but 70 hours is a rough deal.
    (Mac OS 10.8.2 on both computers)

    Are you trying target disk mode?
    http://support.apple.com/kb/PH10725
    Ciao

  • How can i get the variable declared in jsp to a javascript function

    Hello all.
    I'm in a trouble.. i was developing a program in jsp oracle. and in some cases i use java scripts.. here in the HR program module i feel a trouble.
    the code here i'm sending is just a trial one.. the jdbc and all are doing in the jsp page itslef.
    egs.. : there is a table with 4 fields
    Empid Empname Empdetails EmpSal
    and in the table there are 100 records. Emp id is the primary key
    here what my problem starts..
    i want to list all the emp id in the combo box
    for that i used jsp program
    now when i select any one emp id i want to display the
    empname emp details and emp salary in another 3 text boxes
    i have successfully placed all the empid in the combo box
    now what i done is i wrote code in java script.. in onchange() for combo
    now i'm not getting the values
    here i'm sending the code.. below..
    please help me
    <html>
    <head>
    <title>DOLOGIN
    </title>
    </head>
    <%@ page language="java" session="true" import="java.sql.*" %>
    <body>
    <form method="POST" name="form1" action="--WEBBOT-SELF--">
         <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
    <select size="1" name="D1" onchange =xx() >
    <option> Select One</option>
    <%
    String age[] = new String[20];
    String ph[] = new String[20];
    int i=0;     
    try
         try
         {     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         catch(ClassNotFoundException e)
         {     out.println(e);
              String dbURL = "jdbc:odbc:trial";
              Connection dbCon;
              dbCon = DriverManager.getConnection(dbURL);
              String query = "Select * from table1";
              Statement stmt = dbCon.createStatement();
              ResultSet rs = stmt.executeQuery(query);
              while(rs.next())
              {     String name = rs.getString(1);
                   //out.println(name);
                   %>
                   <option value="<%=name%>"><%=name%></option>
                   <%
                   age= rs.getString(2);
                   ph[i] = rs.getString(3);
                   //out.println(age[i]);
                   //out.println(ph[i]);
                   i++;
         %>
         </select>
         <%
              out.println(age[4]);
              dbCon.close();
              stmt.close();
    catch(SQLException e)
    {     response.sendRedirect("error.html");
    %>
    </form>
    </body>
    </html>
    <SCRIPT LANGUAGE=javascript>
    <!--
    function xx()
    {     //alert("aravind")     
         alert(document.form1.D1.selectedIndex)
         alert(document.form1.D1.value)
         alert(age[document.form1.D1.selectedIndex]) //this is not executing//
    //-->
    </SCRIPT>
    here is the code..
    i want the age to run here
    please help me

    To ensure a custom ordering, sort the files in an album and rename the files with a sequentially numbered filename.
    File > Export > Version/Originals
    Then use "Filename > Sequential"
    or "Filename > Album name with index"

  • What is the main diff between the IDOC, RFC,PROXY

    HI,
      May i know in witch situation we will go for : 1) Idoc
               2) RFC
                   3) Proxy.
    i hope we use above three are for posting data in R3 system.
    can any one please clarify when exactly we use witch adapter.
    regards

    Hi
    IDoc
    It is used only for data transfer.It lies on ABAP Atack.also the underlying protocol is tRFC.
    RFC
    It is used when you need to process data and return values to remote system.That is it is used in synchronous scenarios.It lies on J2EE/Java Stack.It is not a data container like IDoc.It calls a functional module which gets executed.The underlying protocol is HTTP.Communication is done suing JCO/JCA.
    Performance wise IDocs are better.
    Proxies are used when large amount of data is involved.
    Also go through this.
    Choosing the Right Adapter.
    /people/ravikumar.allampallam/blog/2005/08/14/choose-the-right-adapter-to-integrate-with-sap-systems
    Thanks

  • Disk Utility: what's the diff between the drive icons in the left window?

    I don't partition my drives. In my left window of Disk Utility I see 2 lines for each drive in my computer. My main drive looks like this:
    465.8 GB ST3500630AS Media
    Main HD
    Main HD is obviously the name I gave my drive. So is the first line the drive and the 2nd line the volume? And if I partitioned, I assume they'd all be listed under the first line (465.8)?
    When working on a drive that is not partitioned like mine above such as when repairing permissions or the repairing the disk, does it matter which I select? The top line (465.8) or 2nd line (Main HD)?
    Thanks,
    Steven

    Your assumptions are correct.
    Some of the options in disk utility are for volumes and some are for the disk. If an option appears for both, then no, it doesn't matter which one is selected.

Maybe you are looking for

  • If I dont embed when sending form fcp how do I get it back?

    I'm new to motion so sorry if this is a real stupid question but.. I'm using motion to make my titles. I've done some tutorials and I've been selecting what I want to add the title to and go send to motion. When the widow opens I've been leaving the

  • Update to 10.8.4 asks reboot after reboot

    I run a MBP 13" on 10.8.3 and tried to update to 10.8.4 yesterday. The App Store download seemed to stop after ca. 10% but with no error message and just asked me for the expected reboot. So I did the reboot, the Mac comes back fine but surprisingly

  • Hiding the parent applet window when using separteFrame=true

    Using Oracle Forms 10.1.2.0.1 on UNIX Server (AIX) - IE version 6 - JInitiator 1.3.1.22 Hi. I've read some posts about using "HTMLbodyAttrs=onLoad='javascript:self.moveTo(1601,1201)'' in the formsweb.cfg file in order to hide the parent browser windo

  • K7N2G-ILSR sad but true

    after 6 proud month of owning this board.........i must say my time with msi has almost ended. the board has given up on the most important part of her duty and thats the SATA connection..... when i first got the board there were 2 connectors. well 1

  • How adding folder to existing SBO screen?

    Hi all, I'd like to add a folder in the "Employee Master Data" screen? Is it possible? If yes, how can I do? Thanks in advance, Sylvie.