Sitemap

Amicuk Programming Answers

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

2015-10-11   Views:0

Advertisement

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

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???

The replay answer
Advertisement
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.

Go to See the other 4 answers

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

Category:DefaultRelease time:2015-10-11Views:130

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[More]

Jsp:usebean, @page import & CLASSPATH

Category:DefaultRelease time:2015-10-11Views:130

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 workin[More]

How to assign the class value dynamically  in jsp:useBean ?its urgent

Category:DefaultRelease time:2015-10-11Views:130

Hi I want to set the class value of <jsp:useBean> dynamically when i am trying to this way <jsp:useBean id="<%=id %>" class="<%=beanclass %>" scope="request"> <jsp:setProperty name="<%=id %&[More]

Jsp:useBean and assigning a value to that bean

Category:DefaultRelease time:2015-10-11Views:130

Hello, I have a type called Country and I have declared a bean using the "jsp:useBean" syntax. I then try to assign a value to that bean in a scriptlet. Eventually I try to retrieve the values using "jsp:getProperty". The problem is th[More]

Jsp:useBean giving error while compiling JSP's in JDeveloper

Category:DefaultRelease time:2015-10-11Views:130

Hello, I am having another problem with JSP's in JDeveloper 10.1.3. jsp:useBean and jsp:setProperty are all giving problems. I am not sure what I need to do to get rid of this error Thanks, LakshmisriYour original post mentions issues with jsp:useBea[More]

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

Category:DefaultRelease time:2015-10-11Views:130

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;[More]

Why do we need jsp:useBean???

Category:DefaultRelease time:2015-10-11Views:130

Hi All, I am going over both the J2EE tutorial and JSP1.2 spec. As far as I read, it seems to me that "jsp:useBean" is a way of creating a bean object. <jsp:useBean id="local" scope="application" class="Mylocales"[More]

jsp: useBean.. and c: coding

Category:DefaultRelease time:2015-10-11Views:130

I am trying to understand this coding. 1. What does the <jsp: useBean .. class="coreservlets.ShoppingCart"> mean? Are we bringing in the content of the ShoppingCart class? If we use <% import="coreserlets.*"> at the top of[More]

Jsp:useBean

Category:DefaultRelease time:2015-10-11Views:130

I really shouldn't be trying to use JSP any more ... I have been having problems using JavaBeans in JSP pages now - every time a problem is solved, that other little thing that always wanted a go at annoying me arrives ... The code is: <jsp:useBean i[More]

HELP: jsp:useBean not "working"

Category:DefaultRelease time:2015-10-11Views:130

I have written a JSP that utilizes some JavaBeans. With one, I do something similar to the following: <jsp:useBean id="BeanA" class="mypackage.myFirstBean" /> That statement executes just fine, as the debug HTML statement that fo[More]

Jsp:useBean gives cannot be resolved to a type in Tomcat

Category:DefaultRelease time:2015-10-11Views:130

Hi, I am using Tomcat 5.5 I have a simple JavaBean for test purposes : import java.io.Serializable;     public class testBean implements Serializable {         int number;         public testBean() {         public int getNumber() {             retur[More]

Hot
Hello all, I recently installed Windows 8 Pro 64-bit on my Mid '09 MacBook. I had Windows 7 and 8 installed before and working, so I know it is compatible. Unfortunately, my trackpad does not work at all; No clicking, moving, nothing. I tried other s [More]
I've just performed a surface test on my internal HD It reports back one bad block, at # 1, 118, 671, 700.Filename = N/A. 1. Should I be concerned about this? I have not noticed any performance issues. 2. If I wanted to get rid of it anyway, how do I [More]
Many of the MP3 players Creative makes are called Zen. Searching the forums is very tedious since searching for Zen will pull up almost every post. Searching for the other models Zen X-Fi or just X-Fi will give you a message: "x" is a very commo [More]
Dear All, We are using payment terms in our business scenario. Our payment terms will follow customer received for calculation of discount. We are using Transportation documents for shipping the deliveries. Each transportation document will applicabl [More]
Hi all, I have a table that allows user to add rows to it. When the number of columns exceed the number of row the viewport can display, the freshest columns are not in the view. My question is, how do I force the viewport to view the last rows of th [More]
I want to watch what is on Apple TV on my iPad. Any suggestionsWhat specificlaly do you want to watch on iPad or are you looking at some form of mirroring?Read other 3 answers [More]
Hello, i will do an upgrade and i downloaded patch file "p6890831_111070_Linux-x86". So i extractet the folder and call ./runInstaller. But if i do this i get an error message: "./runInstaller: line 197: /home/oracle/patch: Datei oder Verze [More]
I often have documents consisting of both A4 and A3 pages. When I print them I would like the A4 pages to be printed double sided and the A3 pages to be printed single sided. How can I set Adobe reader/my printer to do this? Thanks!There is no way to [More]
Hi, I need to SPAN traffic comming one server inside UCS and the destination as my 6500 core. I tried to get some document to check how to configure RPSN between UCS and 6500. Please guide Thanks NibinYou've answered your own question in the first se [More]
I downloaded the JRC sdk (com.businessobjects.sdks_.jrc_.11.8.0_11.8.5.v1197.zip) from www.sdn.sap.com. The website states that the JRC SDK is 100% free. However I can't find license agreement for it. Is there an official license agreement for JRC sd [More]