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
Dear sir, I'm using blackberry 9320.. Now the problem is facebook is not work properly in my web browser.. This problem is only for facebook site.. Other sites is work well.. When I open facebook my web browser is showing error like this ..( Destinat [More]
Hi there, We have different company codes in the same client. These companies are situated in various countries. I like to use the same document type with several exchange types M and X(specific for countries). Posting in MM and SD are ok by defining [More]
I have MPEG Movie Clip (.mpg) files from my Sony camcorder which I am trying to backup to DVD's.  When I import them some are importing as MPEG video correctly and some are appearing as MPEG audio incorectly. The ones showing as audio files are defie [More]
Hi, Have been stuck with this for quite some mins now, When I execute this simple -valid- create package statement in Oracle SQL Developer: http://www.pastebin.ca/757859 It shows it's not compiled and has errors, when I check the Packages part in Ora [More]
Hello, Got the following error on a SOAP receiver. Its a synchones interface. I get the following error: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: In [More]
Hi, In our business process in one of operation we need to send the material to jobwork and client want to track that amount and want to include in cost rollup? In out scenerio, first two operations will be held inside and third operation will be sen [More]
Hi All, I want to create a Domain and then a managed server. On this managed server I want to install OR-Back Office. I need to do all of this in silent mode(command prompt.) i know i can create domain using unpack command from command prompt but don [More]
I'm trying to use photobooth to take photos with the program manycam but every time I take a Photo it show up white and and some of it but barely any of the photo lightish blue like its devoloping into the full picture but it just stays like that. Ta [More]
Hello, We have a NAC System which has the ADSSO not 100% work. Sometimes the agent pops up and ask for credentials and sometimes it logs in automatically (ADSSO works). Does anybody have the same experience before? ThanksAre you running OOB Layer-3 w [More]
I'm starting a HD project that will be output to DVD. The main feature will be about 90 to 120 minutes in length. What is the best capture settings for footage acquired using a Sony Zu1 HD, on sony HDV mini dv tapes? I don't have Studio 2 or quad 2.5 [More]