.java files in J2EE

Where do I find files like HttpServlet.java in the j2ee 1.3.1 download? I installed into c:\j2sdkee1.3.1 on Windows 2000. Thanks.

I'm not sure but look in the zipfile src.jar in the java installation directory

Similar Messages

  • How to compile a java file(Servlet) in J2EE v1.3.1

    This is my first time using J2EE instead of J2SE!!HOw to compile a java file in J2ee\bin because there is no javac in j2ee and when i compile in J2se i got
    G:\j2sdk1.4.1_01\bin>javac HelloServlet.java
    HelloServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    This mean it doen;t support servlet in J2se!!so how can /what command to compile a servlet java file in j2ee.Thanks

    You'll need to add the j2ee.jar to your classpath. Usually you'll have to add some jars from your app server to your classpath as well.
    For example (using weblogic):
    javac -classpath c:\java\j2ee\j2ee1.3.1\lib\j2ee.jar;c:\tools\appserver\weblogic\wl7.1\lib\weblogic.jar
    HelloServlet.java

  • Error while compiling QuoteRenderer.java file

    Currently I am working on Quotes customizations. As part of customizations, I need to modify the seeded java file (i.e., $JAVA_TOP/oracle/apps/qot/util/QuoteRenderer.java)
    Since i have only class files, I have decompiled the class file using JAD and modified the code and placed in the same path and tried to compile. Then I am getting the below errors: [I am getting the same errors even if i placed the decompiled file without any modifications]. Can you help in resolving this issue.
    Errors:
    oracle/apps/qot/util/QuoteRenderer.java:16: package javax.servlet.jsp does not exist
    import javax.servlet.jsp.JspWriter;
    ^
    oracle/apps/qot/util/QuoteRenderer.java:17: package javax.servlet.jsp does not exist
    import javax.servlet.jsp.PageContext;
    ^
    oracle/apps/qot/util/QuoteRenderer.java:127: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    public static void loadQuoteLines(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext, int i)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:664: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    public static void loadQuoteLines(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext, String s, String s1)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:775: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    public static void loadQuoteLines(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext, String s)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:838: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    private static void partialLoadQuoteLines(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext, int i)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:916: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    public static void loadExpandList(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:975: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    public static void renderQuoteLines(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext, String s, String s1)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:1652: cannot find symbol
    symbol : class PageContext
    location: class oracle.apps.qot.util.QuoteRenderer
    public static void renderQuoteLineSmry(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, PageContext pagecontext, String s)
    ^
    oracle/apps/qot/util/QuoteRenderer.java:386: reference to QuoteException is ambiguous, both method QuoteException(java.lang.String,java.lang.Object[]) in oracle.apps.qot.core.QuoteException and method QuoteException(java.lang.String,java.lang.String) in oracle.apps.qot.core.QuoteException match
    throw new QuoteException(s2, null);
    ^
    oracle/apps/qot/util/QuoteRenderer.java:982: cannot find symbol
    symbol : class JspWriter
    location: class oracle.apps.qot.util.QuoteRenderer
    JspWriter jspwriter = pagecontext.getOut();
    ^
    oracle/apps/qot/util/QuoteRenderer.java:1659: cannot find symbol
    symbol : class JspWriter
    location: class oracle.apps.qot.util.QuoteRenderer
    JspWriter jspwriter = pagecontext.getOut();
    ^
    Note: oracle/apps/qot/util/QuoteRenderer.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.

    Hi,
    You need to add librabry for j2ee-1.4.jar in your classpath this can be found under JSP Runtime library in your jdevhome\jdevbin folder.
    ~Ankul

  • Error while compiling java file

    Hi, im newby in java,
    i was trying to compile java files, and after that i will use it in JSP as javabean.
    I have 2 files already, the first file is a connection code, and its compiled successfully, it looks like this
    i named this as ConnectionBean.java
    package my_package;
    import java.sql.*;
    public class ConnectionBean {
         private Connection con;
         private static final String driver = "org.postgresql.Driver";
         private static final String url = "jdbc:postgresql://localhost:5432/PSQLDS";
         private static final String username = "postgres";
         private static final String password = "mypassword";
         public ConnectionBean() {
         public Connection logOn() {
              try {
                   Class.forName(driver); con = DriverManager.getConnection(url, username, password); }
              catch(ClassNotFoundException e) {
                   System.err.println("ConnectionBean: driver unavailable..."); con = null; }
              catch (SQLException e) {
                   System.err.println("ConnectionBean: driver not loaded..."); con = null; }
              return con;
         public void logOff() {
              try {
                   con.close(); }
              catch (Exception e) {
                   e.printStackTrace(); }
    as you can see above im using "package", and yes i have manage to put all my java files within the correct path (ROOT\WEB-INF\classes\my_package)
    And also, i have test this class as javabean on JSP file and it works.
    There for i continue to create the second java file, as a purpose to create a back engine for JSP. I use the same package as ConnectionBean.java, it looks like this
    i named this as ListPageEngine.java
    package my_package;
    import java.beans.*;
    import java.sql.*;
    public class ListPageEngine {
         public static void main(String[] args) {
              ConnectionBean conBean = new ConnectionBean();}
    on compiling process using command "javac ListPageEngine.java", i get this error message
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    2 errors
    I think, i am pretty much sure that all my configuration (wheater its Apache TomCat, Environment Variable or PostgreSQL server) was good, as a prove, i was able to use ConnectionBean.class in my JSP file.
    I susspect the problem is related with "package", seems i cannot use ConnectionBean class within ListPageEngine class when i use package.
    For another information, i didn't install such thing as J2EE, i only install JDK 1.5, i also guess this might be the cause.
    Right now im all stuck, i try to find thread which might be related with my problem but i failed to find it, most of them get the same answer by UncleSAM which are
    Try the following forum (about JSP technology)
    http://forum.java.sun.com/forum.jspa?forumID=45
    JavaBeans spec contains nothing about JSP, but JSP spec describes using of beans.
    i hope my question is clear so anyone who might have experience or clue with this problem might be able to help me.
    Thanks before

    finally folks, i found answer to my own problem hehehehe..
    the problem is on the compiling command (javac ... my_file.java), i found that i need to add some parameter on the command to make it works.
    This problem solved.

  • How to Compile Servlet Java Files

    hello ...
    i am a beginner at JSPs and java servlets ... i have been searchin' hopelessly for the past couple of days. Could someone please guide me on how to compile source files for servlets ... namely how can i include the packages javax.servlet.* since the compiler gives me an error that there is no class name ... I am using jdk1.3
    Do I need to get the java server development kit ... but i cant seem to find it any where on the sun's site ... and do i need to download the j2ee sdk too ...
    As you can gather that i am completely comfused and lost ... After doing programmin with asps and previous java experience, i had thought that the migration to a java platform on would be a breeze but the lack of any solid documentation which addresses the above questions is dampenin my spirits ... and the cryptic documentation with tomcat doesnt help either. :)
    pleaze reply soon ... i have to implement a project for my company ... otherwise i would have to put servlets and jsp back in the closet and return back to asp.

    Try http://java.sun.com/j2ee/docs.html specifically, the links on that page called Download Instructions, Installation Instructions, Java Servlets Tutorial and JavaServer Pages QuickStart Guide
    By the way, J2EE SDK's reference implementation is based on Tomcat itself but is more than a web container.

  • Confuse..where are the java files(bean) related to JSP in Portal??

    Hi..
    Can anybody plz help me..
    I already deploy the new JPDK Jan 2003.
    It's works fine in the Portal.
    Just, i don't understand, where they put the java files(bean) related?
    For example..the Lottery (lotto.jsp)
    it called this bean..
    "<jsp:usebean id = "picker" class = "oracle.portal.sample.devguide.lottery.LottoPicker" scope = "page" />"
    but, when i searched in the Server, i cannot find this LottoPicker.java.....
    Pls help me, it is urgent..

    Hi,
    All the bean files are in samplev2.jar at %OC4J_HOME%/j2ee/home/applications/jpdk/jpdk/WEB-INF/lib. If you extract the zip you will see all the class files for samples in JPDK.
    btw, as per J2EE container specification, the default location for any java class file (i.e. '.class' files) is WEB-INF/lib (packaged as a jar) or inside WEB-INF/classes as individial class files (with their complete package structure)
    Regards,
    Abhinav

  • How to access application vars into JavaBeans or Java File?

    I have the application directory strcuture like this. I am using Apache Tomcat/6.0.14 and Eclipse IDE.
    -/MyFirstServlet
    -/MyFirstServlet/WebContent
    -/MyFirstServlet/WebContent/WEB-INF/web.xml
    -/MyFirstServlet/WebContent/web.jsp
    -/MyFirstServlet/Src
         - com.model.DAO/userDAO.java (java class within package)
    I have put following code into "web.xml".
    ==================================
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
         <display-name>
         MyFirstServlet
         </display-name>
         <context-param>
              <param-name>DBDriver</param-name>
              <param-value>com.microsoft.sqlserver.jdbc.SQLServerDriver</param-value>
         </context-param>
         <context-param>
              <param-name>connectionUrl</param-name>
    <param-value>jdbc:sqlserver://localhost:1433;databaseName=MyFirstServletDB;user=hitesh;password=hit
    esh;</param-value>
         </context-param>
         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>          
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>
    </web-app>
    I am easily able to access from "web.jsp"
    ===================================
    String DBDriver = application.getInitParameter("DBDriver");
    out.println("<br>DBDriver:==="+DBDriver);
    String connectionUrl = application.getInitParameter("connectionUrl");
    out.println("<br>connectionUrl:==="+connectionUrl);
    BUT when I try to access withing userDAO.java it gives "application is not resolved"
    ========================================================================
    String DBDriver = (String)application.getInitParameter("DBDriver");
    NOTE: I understand I need to import some inbuilt java package which will allow to use applcation vars
    within java class.
    What is that package? and how to do that?
    Is there any other easy method to use global/application vars which can be used in all
    JSP/JavaBeans/Java files?
    Thanks in advance.

    It might be easier to put that code somewhere else. JSP's are for presentation, not for accessing databases, business logic, etc.

  • Calling a java application from j2ee web application

    Hi,
    I have a j2ee application in which i am making a call to a jar file which is a java application.
    Runtime a4 = Runtime.getRuntime();
    Runtime a = Runtime.getRuntime();
    String cmd[] = new String[14];
    cmd[0] = "cmd";
    cmd[1] = "/c";
    cmd[2] = "start";
    cmd[3] = "javaw";
    cmd[4] = "-jar";
    cmd[5] = CATALINA_HOME+"\\webapps\\AveksaTesting\\AveksaTestingJava\\dist\\AveksaTestingJava.jar";
    cmd[6] = SERVER_TESTS;
    cmd[7] = COLLECTOR_TESTS;
    cmd[8] = SYSTEM_TESTS;
    cmd[9] = CREATE_ORACLE;
    cmd[10] = DB_NAME;
    cmd[11] = DB_DUMP;
    cmd[12] = email;
    cmd[13] = isMIGRATE;
    try{
    java.lang.Process p = a.exec(cmd);
    Now in the called java application, i am first shutting down the tomcat server by calling shutdown.bat script and then starting it using startup.bat. But the problem i am facing is when i restart the server from java application, it says address already in use(i.e. port 8445 on which tomcat is runninng).
    Id i just call the java application and do the same operation it works fine. I guess when i am calling java from j2ee application, j2ee still has some threads holding java and not shutting down tomcat properly.
    Can anyone suggest me what can be done in this case. I have to call a java application from j2ee and restart the tomcat server many times.
    Thanks in advance
    -Vikram

    Annoyingly crossposted.
    http://forum.java.sun.com/thread.jspa?threadID=730657

  • Call a Java file from ABAP

    Hi,
    I would like your help in identifying a mechanism in calling a Java Program from an ABAP program. The requirement is that I need to pass enough parameters(possibly in a single object like a <i>table</i>) and fetch that in a Java Program residing in a jar in the J2EE engine. The possibility of this java file interpreting this incoming object and also be able to return something to ABAP which can eventually be printed on the screen needs to be known.
    I also would like to validate an assumption of mine which is that, the jar(the receipient java file) file needs to be put under the directory
    "\usr\sap\<i>SystemID</i>\<i>instancenumber</i>j2ee\deploying\lib"
    Appreciate your time and effort in helping me with this.
    Regards,
    Sam.

    i am not sure about
    I also would like to validate an assumption of mine which is that, the jar(the receipient java file) file needs to be put under the directory
    "\usr\sap\SystemID\instancenumberj2ee\deploying\lib"
    but for your case what you could do is, on the java side get developed a jsp page which will receive data and use the jar to proces and return the results as xml. once thats done.
    from abap you can use cl_http_client class to call this jsp page to pass parameters and get the processed results from jsp page.
    Raja

  • Problem compiling a simple java file

    Hi,
    When I try to compile the following simple java file
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HowdyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    out.println("<html>");
    out.println("<body>");
    out.println("<center><h1>Hi</h1></center>");
    out.println("</body>");
    out.println("</html>");
    at the command prompt as follows
    C:\Shared\CBT\Java 2 JSP and Java Servlets\03\servlet1>javac -classpath
    "C:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip" *.java
    Or
    C:\Shared\CBT\Java 2 JSP and Java Servlets\03\servlet1>javac *.java
    Or
    C:\Shared\CBT\Java 2 JSP and Java Servlets\03\servlet1>javac HowdyServlet.java
    I get the following errors and I cannot compile this java file -
    HowdyServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    HowdyServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    HowdyServlet.java:5: cannot find symbol
    symbol: class HttpServlet
    public class HowdyServlet extends HttpServlet {
    ^
    HowdyServlet.java:6: cannot find symbol
    symbol : class HttpServletRequest
    location: class HowdyServlet
    public void doGet(HttpServletRequest request,
    ^
    HowdyServlet.java:7: cannot find symbol
    symbol : class HttpServletResponse
    location: class HowdyServlet
    HttpServletResponse response)
    ^
    HowdyServlet.java:8: cannot find symbol
    symbol : class ServletException
    location: class HowdyServlet
    throws IOException, ServletException {
    ^
    6 errors
    I have installed the latest JEE 5 SDK on Win XP Home. I have the following variable set as follows,
    CLASSPATH = .;C:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip
    PATH = C:\Sun\AppServer\jdk\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\QuickTime\QTSystem;C:\Sun\AppServer\lib\ant\bin
    ANT_HOME = C:\Sun\AppServer\lib\ant
    I have spent hours scratching my head but don?t have a clue. I was wondering if you have any idea as why I might be getting these errors.
    Thank you for your time.
    Green

    Hello, did you read the answers?
    You have to put j2ee.jar or servlet-api.jar in your classpath. Those JAR files are included in the Java EE package somewhere. Remove the QTJava.zip junk from the classpath.
    If you don't know what the classpath is and how to set it, read this:
    Setting the class path
    How Classes are Found
    And I'll repeat what the others say: if you are very new to Java, then Java EE will probably be way over your head. First learn the language and the standard API. If you understand that well, start with Java EE. Or do you already know what servlets are, and that you need a servlet container to run them, and how to deploy them etc.?

  • Importing bundle of project files (from j2ee tutorial)

    I'm trying to import "guessNumber application" (http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFIntro5.html) from <INSTALL>/j2eetutorial14/examples/web/ directory. How to do it in the RIGHT way (instead of copying this files to JDeveloper/.../myworks directory with the help of Windows Explorer)?

    Under the file menu in JDeveloper there is an import option that will let you create a project from the WAR file.

  • Deployment issues java.io.IOException: [J2EE Deployment SPI:260]"

    I m using weblogic.Deployer to deploy webservice and getting this error
    java.io.IOException: [J2EE Deployment SPI:260080]Unable to define application install directory at '/tmp/WebService.war'. Directory could not be created or is a file.
    at weblogic.deploy.api.internal.utils.InstallDir.<init>(InstallDir.java:60)
    at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.upload(ServerConnectionImpl.java:624)
    at weblogic.deploy.api.spi.deploy.internal.BasicOperation.uploadFiles(BasicOperation.java:300)
    at weblogic.deploy.api.spi.deploy.internal.BasicOperation.execute(BasicOperation.java:385)
    at weblogic.deploy.api.spi.deploy.internal.BasicOperation.run(BasicOperation.java:169)
    at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.deploy(WebLogicDeploymentManagerImpl.java:369)
    at weblogic.deploy.api.tools.deployer.DeployOperation.execute(DeployOperation.java:47)
    at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:145)
    at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:93)
    at weblogic.utils.compiler.Tool.run(Tool.java:158)
    at weblogic.utils.compiler.Tool.run(Tool.java:115)
    at weblogic.Deployer.run(Deployer.java:70)
    at weblogic.Deployer.main(Deployer.java:54)
    I tried to set different tmp dir location as "-Djava.io.tmpdir=${WL_DOMAIN_HOME}/tempdir", but still i get the same Error.
    Any thoughts/help, how to set the location while deploying using weblogic.Deployer.
    Thanks
    Kraz
    Edited by: user10687441 on Dec 5, 2008 4:57 PM

    java weblogic.Deployer -usenonexclusivelock -adminurl http://153.2.3.101:5432 -username test -password test-t -upload -debug -deploy -source ../current-testnet/UdcWebService.war -targets udc
    I added this "-Djava.io.tmpdir=${WL_DOMAIN_HOME}/tempdir" in the start scripts of my admin and managed instances. Thinking by default the deployments were using /tmp/filename
    After some trial-n-error, renaming the war to UdcWS.war ....worked and I m happy :)
    But still curious how it is related to the name "WebService"
    Same command with only name change was successful, nothing changed inside the .war nor start scripts
    java weblogic.Deployer -usenonexclusivelock -adminurl http://153.2.3.101:5432 -username test -password test-t -upload -debug -deploy -source ../current-testnet/UdcWS.war -targets udc
    Any thoughts ?
    Edited by: user10687441 on Dec 6, 2008 5:41 PM

  • Connecting java file to jsp

    Hi i'm working on a jsp file and i want my jsp file to access the methods in a java file of mine.I have an idea its got something to do with beans. But i have no knowledge about beans. does anyone know how i can acheive it.

    The following ( from the java tutorial with samples is downloadable) gave me the clarity in understanding how .jsp interact with classes (modified beans)
    This tutorial is available at
    http://java.sun.com
    and follow thelinks for the tutorial.
    Here Goes.....
    Home | Download | PDF | API | FAQ | Search | Feedback | History
    JavaBeans Components
    JavaBeans components are Java classes that can be easily reused and composed together into applications. Any Java class that follows certain design conventions is a JavaBeans component.
    JavaServer Pages technology directly supports using JavaBeans components with standard JSP language elements. You can easily create and initialize beans and get and set the values of their properties.
    JavaBeans Component Design Conventions
    JavaBeans component design conventions govern the properties of the class and govern the public methods that give access to the properties.
    A JavaBeans component property can be
    Read/write, read-only, or write-only
    Simple, which means it contains a single value, or indexed, which means it represents an array of values
    A property does not have to be implemented by an instance variable. It must simply be accessible using public methods that conform to the following conventions:
    For each readable property, the bean must have a method of the form
    PropertyClass getProperty() { ... }
    For each writable property, the bean must have a method of the form
    setProperty(PropertyClass pc) { ... }
    In addition to the property methods, a JavaBeans component must define a constructor that takes no parameters.
    The Duke's Bookstore application JSP pages bookstore.jsp, bookdetails.jsp, catalog.jsp, and showcart.jsp use the database.BookDB and database.BookDetails JavaBeans components. BookDB provides a JavaBeans component front end to the access object database.BookDBAO. The JSP pages showcart.jsp and cashier.jsp access the bean cart.ShoppingCart, which represents a user's shopping cart.
    The BookDB bean has two writable properties, bookId and database, and three readable properties: bookDetails, numberOfBooks, and books. These latter properties do not correspond to any instance variables but rather are a function of the bookId and database properties.
    package database;
    public class BookDB {
    private String bookId = "0";
    private BookDBAO database = null;
    public BookDB () {
    public void setBookId(String bookId) {
    this.bookId = bookId;
    public void setDatabase(BookDBAO database) {
    this.database = database;
    public BookDetails getBookDetails() throws
    BookNotFoundException {
    return (BookDetails)database.getBookDetails(bookId);
    public List getBooks() throws BooksNotFoundException {
    return database.getBooks();
    public void buyBooks(ShoppingCart cart)
    throws OrderException {
    database.buyBooks(cart);
    public int getNumberOfBooks() throws BooksNotFoundException {
    return database.getNumberOfBooks();
    Creating and Using a JavaBeans Component
    To declare that your JSP page will use a JavaBeans component, you use a jsp:useBean element. There are two forms:
    <jsp:useBean id="beanName"
    class="fully_qualified_classname" scope="scope"/>
    and
    <jsp:useBean id="beanName"
    class="fully_qualified_classname" scope="scope">
    <jsp:setProperty .../>
    </jsp:useBean>
    The second form is used when you want to include jsp:setProperty statements, described in the next section, for initializing bean properties.
    The jsp:useBean element declares that the page will use a bean that is stored within and is accessible from the specified scope, which can be application, session, request, or page. If no such bean exists, the statement creates the bean and stores it as an attribute of the scope object (see Using Scope Objects). The value of the id attribute determines the name of the bean in the scope and the identifier used to reference the bean in EL expressions, other JSP elements, and scripting expressions (see Chapter 16). The value supplied for the class attribute must be a fully qualified class name. Note that beans cannot be in the unnamed package. Thus the format of the value must be package_name.class_name.
    The following element creates an instance of mypkg.myLocales if none exists, stores it as an attribute of the application scope, and makes the bean available throughout the application by the identifier locales:
    <jsp:useBean id="locales" scope="application"
    class="mypkg.MyLocales"/>
    Setting JavaBeans Component Properties
    The standard way to set JavaBeans component properties in a JSP page is by using the jsp:setProperty element. The syntax of the jsp:setProperty element depends on the source of the property value. Table 12-3 summarizes the various ways to set a property of a JavaBeans component using the jsp:setProperty element.
    Table 12-3 Valid Bean Property Assignments from String Values Value Source Element Syntax
    String constant <jsp:setProperty name="beanName"
    property="propName" value="string constant"/>
    Request parameter <jsp:setProperty name="beanName"
    property="propName" param="paramName"/>
    Request parameter name that matches bean property <jsp:setProperty name="beanName"
    property="propName"/>
    <jsp:setProperty name="beanName"
    property="*"/>
    Expression <jsp:setProperty name="beanName"
    property="propName" value="expression"/>
    <jsp:setProperty name="beanName"
    property="propName" >
    <jsp:attribute name="value">
    expression
    </jsp:attribute>
    </jsp:setProperty>
    1. beanName must be the same as that specified for the id attribute in a useBean element.
    2. There must be a setPropName method in the JavaBeans component.
    3. paramName must be a request parameter name.
    A property set from a constant string or request parameter must have one of the types listed in Table 12-4. Because constants and request parameters are strings, the web container automatically converts the value to the property's type; the conversion applied is shown in the table.
    String values can be used to assign values to a property that has a PropertyEditor class. When that is the case, the setAsText(String) method is used. A conversion failure arises if the method throws an IllegalArgumentException.
    The value assigned to an indexed property must be an array, and the rules just described apply to the elements.
    Table 12-4 Valid Property Value Assignments from String Values Property Type Conversion on String Value
    Bean Property Uses setAsText(string-literal)
    boolean or Boolean As indicated in java.lang.Boolean.valueOf(String)
    byte or Byte As indicated in java.lang.Byte.valueOf(String)
    char or Character As indicated in java.lang.String.charAt(0)
    double or Double As indicated in java.lang.Double.valueOf(String)
    int or Integer As indicated in java.lang.Integer.valueOf(String)
    float or Float As indicated in java.lang.Float.valueOf(String)
    long or Long As indicated in java.lang.Long.valueOf(String)
    short or Short As indicated in java.lang.Short.valueOf(String)
    Object new String(string-literal)
    You use an expression to set the value of a property whose type is a compound Java programming language type. The type returned from an expression must match or be castable to the type of the property.
    The Duke's Bookstore application demonstrates how to use the setProperty element to set the current book from a request parameter in the database bean in bookstore2/web/bookdetails.jsp:
    <c:set var="bid" value="${param.bookId}"/>
    <jsp:setProperty name="bookDB" property="bookId"
    value="${bid}" />
    The following fragment from the page bookstore2/web/bookshowcart.jsp illustrates how to initialize a BookDB bean with a database object. Because the initialization is nested in a useBean element, it is executed only when the bean is created.
    <jsp:useBean id="bookDB" class="database.BookDB" scope="page">
    <jsp:setProperty name="bookDB" property="database"
    value="${bookDBAO}" />
    </jsp:useBean>
    Retrieving JavaBeans Component Properties
    The main way to retrieve JavaBeans component properties is by using the JSP EL expressions. Thus, to retrieve a book title, the Duke's Bookstore application uses the following expression:
    ${bookDB.bookDetails.title}
    Another way to retrieve component properties is to use the jsp:getProperty element. This element converts the value of the property into a String and inserts the value into the response stream:
    <jsp:getProperty name="beanName" property="propName"/>
    Note that beanName must be the same as that specified for the id attribute in a useBean element, and there must be a getPropName method in the JavaBeans component. Although the preferred approach to getting properties is to use an EL expression, the getProperty element is available if you need to disable expression evaluation.
    All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.
    hope this helps
    regards,

  • I am trying to use java  file as Model layer and jsf as presentation layer

    I am trying to use java file as Model layer and jsf as presentation layer and need some help
    I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
    I create java file
    package oracle.model;
    import java.sql.;*
    import java.util.;*
    *public class TableBean {*
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    *public List getperInfoAll() {*
    perInfoAll.add(0,new perInfo("name","username","blablabla"));
    return perInfoAll;
    *public class perInfo {*
    String uname;
    String firstName;
    String lastName;
    *public perInfo(String firstName,String lastName,String uname) {*
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    *public String getUname() {*
    return uname;
    *public String getFirstName() {*
    return firstName;
    *public String getLastName() {*
    return lastName;
    right click on the file and choose 'create data control'
    then i wrote the jsf file:
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<f:view>*
    *<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
    var="item" bgcolor="#F1F1F1" border="10"
    cellpadding="5" cellspacing="3" rows="4" width="50%"
    dir="LTR" frame="hsides" rules="all"
    *>*
    *<f:facet name="header">*
    *<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
    *</f:facet>*
    *<h:column id="c2">*
    *<f:facet name="header">*
    *<h:outputText value="First Name" id="ot1"/>*
    *</f:facet>*
    *<h:outputText style="" value="#{item.firstName}"*
    id="ot2"/>
    *</h:column>*
    *<h:column id="c4">*
    *<f:facet name="header">*
    *<h:outputText value="Last Name" id="ot9"/>*
    *</f:facet>*
    *<h:outputText value="#{item.lastName}" id="ot8"/>*
    *</h:column>*
    *<h:column id="c3">*
    *<f:facet name="header">*
    *<h:outputText value="Username" id="ot7"/>*
    *</f:facet>*
    *<h:outputText value="#{item.uname}" id="ot4"/>*
    *</h:column>*
    *<f:facet name="footer">*
    *<h:outputText value="The End" id="ot3"/>*
    *</f:facet>*
    *</h:dataTable>*
    *</center>*
    *</af:document>*
    *</f:view>*
    but nothing is appear in my table
    I know that there is something wrong in calling the binding object
    I need help pls and where can i find some help to deal with another tag types
    thanks

    i dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
    and this code is generated
    *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
    *"http://www.w3.org/TR/html4/loose.dtd">*
    *<%@ page contentType="text/html;charset=UTF-8"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
    *<f:view>*
    *<af:document id="d1">*
    *<af:messages id="m1"/>*
    *<af:form id="f1">*
    *<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
    *rows="#{bindings.perInfoAll1.rangeSize}"*
    *emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
    *fetchSize="#{bindings.perInfoAll1.rangeSize}"*
    *rowBandingInterval="0"*
    *selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
    *rowSelection="multiple" id="t1">*
    *<af:column sortProperty="uname" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.uname.label}"*
    *id="c1">*
    *<af:inputText value="#{row.bindings.uname.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.uname.label}"*
    *required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
    *id="it3">*
    *<f:validator binding="#{row.bindings.uname.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="firstName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
    *id="c2">*
    *<af:inputText value="#{row.bindings.firstName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.firstName.label}"*
    *required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
    *id="it2">*
    *<f:validator binding="#{row.bindings.firstName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="lastName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
    *id="c3">*
    *<af:inputText value="#{row.bindings.lastName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.lastName.label}"*
    *required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{row.bindings.lastName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *</af:table>*
    *</af:form>*
    *</af:document>*
    *</f:view>*
    but when run it i see the following errors
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    :(

  • View Object to read data from a java file

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my application.
    For one of my view objects , I want the data to be read from a java file which exposes some method to return a collection.
    I cannot use a static view object in this case.
    Please suggest the best way to implement this requirement.Basically build a view object that should read data from a java file.
    Thanks,
    Praveen

    Depending on your use case you can either use a programmatic VO or directly expose the JV class as a data control.
    http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_36/jdtut_11r2_36.html

Maybe you are looking for

  • Word document links not converting to WebHelp

    I have an Word 2007 document that contains hyperlinks to send an email and to jump to another place in the same document. I imported the document into my RoboHelp project and all looks fine. But when I create the WebHelp the links do not work. This i

  • None of the music I downloaded is showing in my library. How can I get this back?

    I have an itunes account and have lots of music I have downloaded. I no longer have an iphone, but my music appears to be no longer available to me, even though it's all paid for. How can I access my music from my pc when it's not available in my lib

  • LS Protocol Stack 14428

    Hello, I'm stuck on this issue. I got this error on Front-end server. Can someone help me on this. TLS outgoing connection failures. Over the past 28 minutes, Lync Server has experienced TLS outgoing connection failures 15 time(s). The error code of

  • Scanning with Epson RX500 and trying Image Capture

    I have an Epson RX500.It prints and copies fine. It was scanning fine, using Photoshop Elements,for two years but now it is not recognized (I think this has something to do with updated Tiger 10.4.8. I've tried to reinstall the TWAIN and scanning sof

  • Migration process License Key

    Hello, I've get an error during migration to Hana db. During Create ICM userstore phase I get and error, and the output of saplikey.log is: SAP License Key Administration  -  Copyright (C) 2003 - 2012 SAP AG Could not install temporary license key -