What is better to use?

Hi all,
1) request.getSession(true) or request.getSession(false), I know the different and yet what is the best to use?
2) In every jsp page of my application I use session = request.getSession(false/true). (Depends on the first answer), are this ok? Or I shell not use it and only use session. (I did (false) becuase I wanted to know if session is dead).
Thanks all in advance,
Sasi

Hi all,
1) request.getSession(true) or
request.getSession(false), I know the different and
yet what is the best to use?The best one to use is the one that does the one you want. Do you want to create a new session? Then use (true). Want to get null if there is no session? Then use (false).
2) In every jsp page of my application I use session
= request.getSession(false/true). (Depends on the
first answer), are this ok? Or I shell not use it and
only use session. (I did (false) becuase I wanted to
know if session is dead).There is actually a few ways to check if the session died. One is to use getSession(true) so you always get a session, then test session.isNew(). This will have the same effect as calling getSession(false), and checking if session == null (and if it is, at some point creating a new session).
If you always want a new session made, then you should probably use getSession(true) with the isNew() check. If there are cases you want to prevent session creation, or delay it for a while then you should use getSession(false).
>
Thanks all in advance,
Sasi

Similar Messages

  • What is better ti use entourage or my .mac account to vidoe chat?

    What is better to use entourage or my .mac account to video chat?
    How do I add a buddy into my entourage buddy list?
    Message was edited by: fotomike

    Entourage is a Microsoft application and is probably Linked to MSN for Mac.
    I have Office:Mac 2000 and this version of MSN does not Video.
    9:24 PM Tuesday; December 18, 2007

  • What is better to use a calculation field or to use stored procedure

    Dear All
    i want to know what is better to use a calculation field on oracle forms , or to do the calculation using a stored procedure at the data base level and fetch the results to the fields on the form
    Best Regards

    Hello Mohannad
    the stored procedure approach might be more readable and maintainable when the calculation gets complicated.
    And it might be easier to reuse when it's needed in another part of your application.
    Bernd

  • What is better to use and why?

    Hi,
    What is better to use and why?
    We have written follwing statements to check the existence of interested record in table.
    1).
    select count(*) from emp where deptno = 20;
    2).
    select 'X'
    from dual
    where exists (
    select 'X' from emp
    where deptno = 20);
    Thanks and Regards,
    Rushang Kansara

    Assuming a large table, number two would be the fastest. If empno in unique, you can leave out the where exists part and just select x from emp where empno = 20. If empno is not unique, then using where exists can be faster. Assuming that empno is not unique, query 1 may elect to scan the whole table looking for that empno. Number 2 can use the index and return your result in, typically, three LIOs.
    Again, it all depends on your indexing, size of tables, and uniqueness of key upon which you are searching.

  • What is better to use for CTM: PDS or PPM?

    what is better to use for CTM: PDS or PPM?
    what is easier to manage and use in CTM : PDS or PPM? and why?thanks
    elena

    Hi ,
    In CTM I will recommend  PDS over PPM.
    You can directly CIF PDS as SNP PDS from ECC, you do not have to convert from PPDS to SNP unilke PPM.
    PDS supports VC, Phantom assemblies.
    PDS can be maintained in ECC and change transfer is easy.
    Validity period of components can be specified in the PDS , Which is not possible in PPM.
    SAP is developing PDS for future use compared to PPM.
    Regards,
    Pavan Verma

  • What is better to use: digital out or 5 channel speaker level out

    Hi
    Is it better to use digital out on sound card or 5 channel speaker level output?If you could explain it to me...(i'm new so that's why i am asking this)
    Thank you

    First you need to determine what options you have, if you have an amp/decoder
    use digital out because that then frees up the line-outs which you can use for other devices. Quality wise not much difference.

  • I'd like to buy iPhone 5 GSM 900 1800 32 GB.What is better for using in Uzbekistan for price 750$?

    Id like to buy iPhone 5 GSM 900 1800 32 GB for price 750$. Which is better for using in Uzbekistan?

    Just be aware if you come to the US and purchase the iPhone you will have to return to the US for warranty service.
    You only listed one phone so what is the other option?

  • What is better to use for school, an ipad or a laptop?

    Hi, I'm in highschool and I am into technology. I use an hp laptop for school, but its kind of big and takes a minute to turn on. It seems like the iPad would be faster ad easier to carry around. I was wondering which is better for taking notes during class, iPad of laptop?
    Thanks
    Madison

    I was wondering which is better for taking notes during class, iPad of laptop?
    Something with a real keyboard, so if you get an iPad to replace the laptop, also get a Bluetooth keyboard to use with it.

  • Need an advice what is better to use in project

    The future project will look like some game & will contain such logic:
    Some objects with concrete form, size , speed & position will interact with each other & change all premises properties as frequently as possible.
    Would you be so kind to recommend me the best technologies or ideas which I can use to realize such task in the easiest and productive way?
    The most important for me now is to listen for &catch the events of contiguity between the objects.
    Thank's a lot in advance for any responce !

    I was wondering which is better for taking notes during class, iPad of laptop?
    Something with a real keyboard, so if you get an iPad to replace the laptop, also get a Bluetooth keyboard to use with it.

  • What is better to use- Financial Plan Vs. Budget

    Hi,
    We are on 12.1.3 and using Project Costing & Billing.
    Now the requirement is to capture expenditure estimates at lowest task level and later compare it with actuals.
    I'm having few doubts, pls help throwing some light on these:
    1. How do we decide which one to use between budgets or financial plans.
    2. Is it possible to load either budgets or FP through excel.
    3. How can we compare estimated expenditure with actuals at a lowest task level.
    Pls help me on these doubts.
    P.S. We are not using GL Budgets, PA resource lists etc. We are looking at this budgeting requirement at very basic level-  just entering estimates at task level and comparing with actuals.
    Thanks

    I would recommend financial plans, …. biggest advantage we found with them was the ability to enter your cost budget and revenue budget at the saem time, in the same screen, …..
    And yes, you can laod FP's from excel, don't think you can with budgets, you would have to use a tol like dataloader i would guess, ...
    Comparing actuals with the estimates ? just write a report, ....
    Regrads,
    Eric.

  • What is better to use for whine?

    What will eat less power? The mirror widget or running photobooth? What to you guys/gals recommend? I see that the quiet MBP is not working on 10.4.6 too good.
    Mirror or photobooth?
    thx

    QuietMBP works for me on 10.4.6. I don't know what it does to battery life, though.
    What would really work is for Apple to fix this issue already
    MacBook Pro, PowerMac G5, iBook   Mac OS X (10.4.6)  

  • What is better to use? The onboard sound for the NF4 Plat/SLi or AUdigy 1?

    ?

    Quote from: Luke51087123 on 09-July-05, 03:10:17
    yeah i was just sayin the ls sucks and i havent had any issues with the onboard
    A Xmas present NEVER sucks.    
    Quote
    so as long as the audigy i get isnt an LS, im good?
    I'd say so.  The onboard sound isn't bad, but you get a more powerful DSP with much cooler driver mods(should you want something like that)

  • SP2013 - What better to use for custom webservice creation, which will be save filled in Infopath form to sharepoint library

    Client use SharePoint 2013. I have to develop a custom webservice for this SharePoint. Webservice will receive some information as request, will fill in a InfoPath form (on based existing infopath template from library) with this information and save result
    to SharePoint library.
    Could advice how it right  organize? What is better to use for custom webservice in SharePoint 2013 (REST api or something else), how better fill in and save infopath form to library? 
    thanks

    Hi,
    In SharePoint 2013, you can still reference the way what it used to be in SharePoint 2010 or previous version.
    The two demos would also work in SharePoint 2013:
    http://blogs.msdn.com/b/jannemattila/archive/2007/01/21/infopath-and-web-service-data-connection.aspx
    http://wmostafaw.wordpress.com/2012/08/07/calling-web-service-from-infopath-2010-with-parameters/
    If the customer just want an interactive form for easy input, there are also other options in SharePoint 2013 like:
    Customization on the default form pages of a list using JavaScript Client Object Model;
    Create a SharePoint App which will enable you implement more complex requirements with Client Object Model and REST API, you can even upload it to the App store to share it with
    other people.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • What programs are better to use than iChat for video conferencing?

    Please help I keep using iChat and it never works any more. What is better to use? Just name some so I can video conference. Thank you for your help

    Hi,
    Scroll this section fro items 5 through 12
    http://www.ralphjohns.co.uk/page5.html#_other
    Also this page http://www.ralphjohns.co.uk/EZJim/EZJimpage7.html for APps in general.
    9:51 PM Wednesday; January 27, 2010
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • What is better and fast to use between decode and case

    Hi friends,
    i wanted to know what is better to use decode or case in sql,which gives faster result.
    thks
    sonal....

    Here's a very simple timing comparison. This table (actually it's a partition) has a little over 1 million rows.
    As you can see, the timing difference is trivial. (I ran an earlier query to fetch the blocks from disk).
    SQL> select sum(decode(balloon_flag
      2                   ,'Y',1
      3                   ,0
      4                   )
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.65
    SQL> select sum(case balloon_flag
      2                  when 'Y' then 1
      3                  else  0
      4             end
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.68
    SQL> select sum(case
      2                  when balloon_flag = 'Y' then 1
      3                  else  0
      4             end
      5            ) bal_count
      6  from   prod.loan_master
      7  where  report_date = to_date('31-DEC-2005');
               BAL_COUNT
                    9036
    Elapsed: 00:00:07.46

Maybe you are looking for

  • Oracle database (10.2.0.4) and HTTP server / HTML DB conflict

    Hi there, I installed a fresh 10.2.0.1 (patched with 10.2.0.4) oracle database on Oracle Entreprise linux 5.7, and HTTP server + HTML DB products from the companion CD. Both are located in different home directory: ODB:  $ORACLE_BASE/product/10.2.0/d

  • Different pages output

    for example: <?php create table testtable ( company varchar2(6), order_number number(4), item_id number(4), quantity number(8), item_desc varchar2(16) insert into testtable values ('A',1001,1,10,'apple'); insert into testtable values ('A',1001,2,20,'

  • Moving Sections of a Sequence

    Once a section of a sequence is selected and copied how can I create an insert rather than overwrite edit when it is pasted at a new position on the timeline? This is something I did all the time on avid, using the clipboard, but can't find a similar

  • My Internet Connection is Fast, but Web Pages load slowl

    I have tested my connection on several websites. I am using RoadRunner and I consistently get speeds between 3500-4500 kbps. In the past few days I have the same internet speed but all my web pages load really slow. Up until this problem I would clic

  • Photoshop elements 3 ?

    Whenever I want to print a picture from " My photos", photoshop elements 3 starts up without me even asking for it. What can I do so that this program ONLY opens when I want to, and not trying to interfer in my other actions.