Which one better to use - jsp:useBean or import statement

Hi,
I just want to know that which one is better to use jsp:useBean or import statement .
I can instantiate and call method of myclass -
1) by importing the class through import tag in jsp as <%@page import="myclass"%. or
2). by using <jsp:useBean tag....
i have these two option to do the same thing. i know that basically useBean is used to call setter and getter method of bean class and but it can be used to call a normal java file that have some logic .
so what should i used , which one is better and why?
useBean provides scope and object instance so no need to create object by new operator. and with import you have to create an instance .
but which tag should i use in my jsp?
i am confused???

ok, means i can use jsp:useBean tag for all my
classes that are not actually bean. so it will be
instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
>
but when should i use import statement in my jsp and
it happen at translation time so will it create any
type of burden for my code if i import multiple
classes.For non-java beans, you need to import the classes, period.
It's not a burden, it's a necessity.

Similar Messages

  • Which is better to use: BEx query or Web Application as an iView in portal?

    Hi gurus!
    Are there any experienced opinions, which is better - publish a BEx query in portal or publish a BEx Web Application in portal? Is it easier to alter the layout attributes etc. if I create a BEx Web Application first before publishing?
    What is the way of fixing for example filter item height if I publish BEx query in portal - is there a Web Application that it uses anyhow which I can fix? Or can I use in that case iView -properties in portal?
    Thankful for advice
    Sari

    ok, means i can use jsp:useBean tag for all my
    classes that are not actually bean. so it will be
    instantiated at run time and provide efficiency .No. Jsp:useBean is used for java bean components.
    >
    but when should i use import statement in my jsp and
    it happen at translation time so will it create any
    type of burden for my code if i import multiple
    classes.For non-java beans, you need to import the classes, period.
    It's not a burden, it's a necessity.

  • Why do you use jsp:useBean?

    Hi,
    I have one "simple" question :) : When or why do you are using <jsp:useBean>,<jsp:getProperty> and <jsp:setProperty>?
    For practice, I am creating a form, sends the data to a servlet and the servlet "packs" the parameter into a Bean and put this Bean into a request- or SessionScope. After that, my resultpage could access the property name of the bean with (for instance) sessionScope.Bean.name.
    I wanted to use the 3 tags above first, but after I realised the way I describes above I didn't have to use these three jsp tags. Therefore I wonder when you are using these tags.
    Thnx
    Alex

    hi
    The component model for JSP technology is based on JavaBeans component architecture. JavaBeans components are nothing but Java objects which follow a well-defined design/naming pattern: the bean encapsulates its properties by declaring them private and provides public accessor (getter/setter) methods for reading and modifying their values.
    Before you can access a bean within a JSP page, it is necessary to identify the bean and obtain a reference to it. The <jsp:useBean> tag tries to obtain a reference to an existing instance using the specified id and scope, as the bean may have been previously created and placed into the session or application scope from within a different JSP page. The bean is newly instantiated using the Java class name specified through the class attribute only if a reference was not obtained from the specified scope. Consider the tag:
    sun site

  • Two graphics card on macbook pro which one do I use?

    I have two graphics cards on my macbook pro. ADM random 6490m (256mb vram) and Intel HD graphics 3000 (512mb vram). My question is which one should I use? I don't do any hardcore gaming or photoshop. I guess that I am just looking for the best display and least buffering if that even has anything to do with the graphics card. I just want to get the most out of my macbook. I appreciate any advice. Thank you.

    Your MBP more or less chooses which graphics card to use automatically.  In System Preferences>Energy Saver, check Automatic graphics switching.  When it's checked on, it will use the higher power and higher quality dedicated AMD 6490 when you're plugged into the wall, and uses the Intel 3000HD when on battery.
    I have downloaded gfxCardStatus to give me more control over which graphics card to use.  There are times I might want the AMD while on battery, even though it runs hotter and uses more battery life. 
    Either card will do well with HD movies, though I notice a lot more artifacts with the Intel 3000 when the movie has a lot of action or explosions or sounds.  If you want to do hardcore gaming, you need the AMD of course.  Photoshop is more dependent on the central processor rather than the graphics card, so I'm not sure you'd have much issue using either one.

  • Which is better to use in a corprate enviornment for back up Windows 2008 Vs. Mozy

    Which is better to use in a corprate enviornment for back up Windows 2008 Vs. Mozy

    Hi, 
    Microsoft provide the built-in backup utility Windows Server Backup to backup Windows server 2008. For more detailed information, please refer to the articles below:
    Windows Server Backup Step-by-Step Guide for Windows Server 2008
    http://technet.microsoft.com/en-us/library/cc770266(v=ws.10).aspx
    Save big bucks without risk: Get the most from Windows Server 2008 Backup Utility
    http://www.techrepublic.com/blog/data-center/save-big-bucks-without-risk-get-the-most-from-windows-server-2008-backup-utility/
    Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    For Microsoft does not provide any third party software, you need to check with the third party software yourself.
    Regards,
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Why assertion instead of if statement ?  Which is better to use ?

    Why assertion instead of if statement ? Which is better to use ?

    Never assertion instead of if statement. The two have fundamentally different intents. Using assert to control program flow is a bad idea

  • Which is better to use spotlight or finder

    I have been a Mac user for six years. Still, I am unsure how to find things most easily on my computer. I was searching for a folder I knew I had, using its exact name in Finder, and I could not locate it. I used it in Spotlight and found it right away. I've not used Spotlight too much, but should I use that instead of Finder?

    No rule on which is better to use, I suppose it is matter of preferences.
    You can certainly expand or restrict what Spotlight searches (indexes) for you via Spotlight's preferences.
    Here is a good free app that IMHO does a good job, EasyFind, at finding contents along with file names quite well.
    https://itunes.apple.com/us/app/easyfind/id411673888
    from this group
    http://www.devontechnologies.com/download/products.html

  • TLFTextField or TLF, which is better to use in CS5?

    Hi,
    I have been developing content using TLF with CS4 and in Flash Builder. Recently when I switched to CS5, there was this cool TLFTextField. So now I wonder, TLFTextField or TLF, which is better to use in CS5? Almost all of my text will be dynamically generated. Please share your thoughts - possibly with pros and cons.
    ~ Shiyaz

    I assume you've found TLFTextField in Flash Pro (I can't remember if Flash Builder made a TLFTextField class or not). Anyway, if you're considering using Flash Pro, here's some background on the TLFTextField class:
    This class was created primarily for backwards compatibility with Classic Text coding. If you used Flash Pro CS 4 or earlier versions, and you wrote ActionScript for your text objects, you were using TextField objects. So, when you upgraded to CS 5, and you decided to convert all your old Classic text objects to the new TLF objects, all your code would have broken were it not for TLFTextField class. TLFTextField implements the TextField API so that your existing TextField code can be used in the TLF environment.
    So, if you're an ActionScript programmer who is already comfortable programming using the TextField API, it certainly makes sense to continue doing so but using TLFTextField objects. However, if you want to take advantage of the new TLF features, the old API doesn't really give you the ability to do that. So, the TLFTextField provided a new API:
    function get textFlow():TextFlow;
    The TextFlow class is the top level class of the TLF model objects. Using that object, you can then set attributes on your text just as if you were working with TextFlow in Flash Builder. So, in essence, TLFTextField provides backwards compatibility, continued use of the familiar API set, and access to the TextFlow model class.
    Another nuance to be aware of is that if you choose to embed fonts, TLF requires the newer "DF4" (for DefineFont4, based on the SWF Tag name) vs. the older "DF3" fonts that TextField requires. For text on the stage, Flash Pro will do all the tricky work for deciding when to embed DF3 and when to embed DF4 fonts, but just be aware that mixing Classic text and TLF text when using embedded fonts can cause a "double tax" on your SWF size because it may embed the same font both as DF3 and DF4.
    Good Luck!
    Rusty

  • I want to display the website which i have designed using jsp in telugu....

    Hi,
    I want to display the website which i have designed using jsp,mysql in telugu.I have searched a number of articles but couldn't get sufficient information.I read articles on internationalise jsp based websites but they were about converting in other languages rather than indic languages.
    Could anyone let me know the procedure to convert it into indic languages.What all are required.
    Thanks.

    (Please keep the subject line to a short descriptive sentence. Don't put your entire question there.)
    LabVIEW can communicate via serial port. If the microcontroller listens to serial data, there must be a certain command to light a LED connected to a certain port. All you need is to check the manual to find out what the serial data needs to be.
    LabVIEW Champion . Do more with less code and in less time .

  • Unable to use jsp:useBean tag

    when I use
    <jsp:useBean id="addressBean" class="AddressBean" scope="session"/>
    I get the following error
    Exception Details: org.apache.jasper.JasperException
    Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path.
    So my question is how to use the <jsp:useBean> tag in JSC

    Please see my message How to set developer's mode for oracle jsp engine.
    As a very early warning of the future, this way of setting configuration paramemter in web.xml for oracle jsp engine will be deprecated in the next major version of oc4j and desupported probably later on. Yes, it is still supported in 10.1.3 and the next major version, though.

  • Difference between photoshop cc and photoshop cc 2014   how do i know which one I am using?

    difference between photoshop cc and photoshop cc 2014   how do i know which one I am using?

    Hi Petereas,
    Both are different version of Photoshop application.
    In Photoshop CC 2014 there are several new feature introduced than CC.
    Please refer the following page on whats new in Photoshop 2014.
    Photoshop Help | New features summary
    When you go to Help>About Photoshop then Photoshop 2014 shows version 2014.0.0 Release.
    Hope this helps.
    Thanks and Regards,
    Sumit Singh

  • 2 Graphic cards installed, which one I am using?

    Hi, I have a macbook pro with 2 graphic cards, an Intel HD graphics 3000 and a AMD Radeon HD 6750, I want to know which one am I using by default, and how can I get the best performance for use in graphics software, like photoshop cs5. Thanks

    Your system will automatically switch between the integrated GPU (HD 3000) or the AMD video card (more powerful) depending on the application you are using.  There is an excellent application (free) called gfxCardStatus.  This will put a little icon in your menubar showing you which card is in use.  It will also allow you to lock in either if you choose to do so:
    http://codykrieger.com/gfxCardStatus

  • AppleCare for Macbook - Which one can I use M8852LL   /A  or  /B ?

    AppleCare for Macbook -
    Which one can I use M8852LL /A or /B ?
    /A is older version /B newer version , I think both are good for Macbook, but can't get a definite answer from Apple. Anyone here know ?
    Macbook 1.83   Mac OS X (10.4.7)   Combo Drive, 2G, 120G HD

    more to say...
    Deciding factor should be price.I've found these folks have the best price on AppleCare.
    http://lacomputercompany.com
    Jim
    PowerBook G3 500 Mhz "Pismo"/ 2.0Ghz BlackBook 2GB OWC RAM   Mac OS X (10.4.7)  

  • Jsp:usebean, @page import & CLASSPATH

    I hav given jsp:usebean for using the classes and then used import package mypack.* in my jsp file. But this is not recognised. I tried putting mypack (which has the class files) in webapps/ROOT/WEB-INF/classes. Still it is not working. My jsp working directory is /usr/tomcat405/webapps/examples/jsp/mydir wher my jsp file resides. I tried giving this dir in CLASSPATH and exported it in my .bashrc file in my linux system. Still the import is not working. What could b the reason?

    If you put your jsp in the examples context, then put your classes into
    /usr/tomcat405/webapps/examples/WEB-INF/classes/mypack
    This should work even without the import line because the "classes" directory is in Tomcat's classpath.
    Also be aware of case sensitivity.
    hav given jsp:usebean you should use
    <jsp:useBean (upper case B)

  • Which is better? single jsp or inc or diff jsp

    hi,
    I have 3 modes as a combo in the top of my form say new, enquiry and amend. If the user selects, new, a new screen should appear.The user can enter values and submit, so that it can be updated into the databse.
    If the user selects Enquiry, getting some key fields from the user, the form should get submitted and display the result in the screen fields taking from the database.If it is amend, the user can do select and change and update the database..
    In this scenaio, which one is advisable? having three different Jsps or having three different includes or working with single jsp(with bean).currently iam working with single jsp(code comes around 4000 lines + bean code comes around 1500 lines), debugging is bit tedious.
    The screen has many dynamic combos, growing grids, popups generated from the grids.
    Suggest me a solution.
    Thanks in Advance,
    Shyam

    Hi , If i understood properly , u r stuck with design problems. so u follow the MVC controller technique to solve this problem. split all jsp in 4 parts or more than that if posibble. just pass the controll to the MVC object with the parameter based upon the selection of combobox. this MVC will analyse the objects parameter and based upon that will redirect to jsp's
    u have to now seperate the business logic as well as the presentation logic. use Jsp's for presentation logic and for dynamic popup of the message boxes or loading combo boxes. Use JSP for business objects and use the usebean tags in the jsp's.
    This will solve u r problem . try to break evry thing as simple objects as posibble. let it be even a chain of objects . it will be easy for u to debug as well as for the session management.
    Good Luck.
    if u need any more please feel free to mail me at [email protected]

Maybe you are looking for

  • MacBook Pro speakers not working.

    I was using my (mid-2010) MacBook Pro running Lion and then started watching a video and suddenly the internal speakers stopped working. There was no red light coming from the headphones jack. The volume was not muted. I tried plugging headphones in

  • Solaris 10 x86 install didnt ask me for network setting?

    Just realised that the install didnt ask me for any network settings during the install... Checked /etc/hosts and all thats there is the loopback address. How do I set up networking now?

  • Combining logo elements in Illustrator

    Hello, Is there some way to combine different logo elements so it becomes one element and you can't ungroup it anymore? I mean other way than Pathfinder - Unite (this means flattening color). Thanks for your help and suggestions!

  • Regular expression​.vi doesn't work correctly

    I try to parse the output from "Flatten To XML" using "Find Regular Expression" but I get unexpected results. Input: "<LvVariant><Name>myName</Name><Cluster>...</Clust​er></LvVariant>" Regular expression: "<(.+)><Name>(\w+)</Name>(.+)</\1>" Expected

  • UAD-2 Solo & Mountain Lion Crashing

    I just updated to the new Mountain Lion software and right when I plug in my Universal Audio UAD-2 Solo into the express card slot it crashes. The computer recognizes something is inserted because that Apple equivalent to a Windows blue screen of dea