Using JSP-Beans in Apache

Hi all!
I'm trying to deploy a jsp page in Tomcat 4.1.19. This page uses Java Beans to set and get various properties. I've put the class file of Java Bean in WEB-INF/classes directory and jsp page in Dir root. But whenever I run the jsp page it shows error page saying the bean name as unresolved symbol.
Please tell me the steps that are involved in setting up a Java Bean for jsp in tomcat and also if any special lines are needed to be added to Deployment Descriptor.
Thanx
Varun

sorry for tha :) maybe my english sucks to much...
here's what sun says:
"Note: In the section JSP Scripting Elements we mentioned that you must import any classes and packages used by a JSP page. This rule is slightly altered if the class is only referenced by useBean elements. In these cases,
---***you must only import the class if the class is in the unnamed package***---.
For example, in What Is a JSP Page? (page 246), the page index.jsp imports the MyLocales class. However, in the Duke's Bookstore example, all classes are contained in packages and thus are not explicitly imported."
as mentioned here:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPBeans4.html#64054

Similar Messages

  • Using jsp:beans

    hi guys
    Pls look at my scenario:
    I have an html file with a username and password fields.
    on "submit" it access "register.jsp" page:
    here is the code for my register.jsp:
    <jsp:useBean id="user" scope="session"
    class="test.redusername"/>
    <jsp:setProperty name="user" property="*"/>
    <html>
    <head>
    <title>bean</title>
    </head>
    <body>
    hello,<jsp:getproperty name="user" property="username">
    </body>
    </html>
    and the redusername.java code follows:
    //import java.sql.*;
    package test;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class redusername
    String username;
    String password;
    Connection conn;
    boolean registered;
    String usr;
    String pwd;
    public String setUsername(String username)
         username=username;
         return username;
    public String setPassword(String password)
         password=password;
         return password;
    public String getusername()
         return username;
    public String getpassword()
         return password;
    public redusername()
    String temp="unknown";
    try
    Class.forName("oracle.jdbc.OracleDriver");
         }catch(ClassNotFoundException cnfe) {System.out.println(cnfe);}
    try
    conn=DriverManager.getConnection
                   ("jdbc:oracle:thin:@localhost:1521:Autonomy","SYSTEM","autonomy");
         }catch(SQLException e) {System.out.println(e);}
         try
         String stm=("select username,password from passwordtable where username=? AND password=?");
         PreparedStatement stmt=conn.prepareStatement(stm);
         stmt.setString(1,username);
         stmt.setString(2,password);
    ResultSet rs=stmt.executeQuery();
    while(rs.next())
              setUsername(rs.getString("username"));
              setPassword(rs.getString("password"));
    rs.close();
    }catch(Exception e)
    {System.out.println(e);}
    The problem is when I use the code I believe it is not accessing the database.
    How to check whether it is connected to oracle database.
    When I compile the java code using the main() and System.out.println
    it gives me the driver version.
    But when using the beans Iam not sure whether it is connecting the database.
    My aim is to check this username and password in passwordtable in oracle and if the username and password is right it should print some value.
    Any help is highly appreciated.
    Thanks in advance!!

    try to close "conn" & "stmt"
    flo
    try
    stmt.close();
    conn.close();
    catch(Exception e){......}

  • Please!!!!!!   How can i add rows in html table dynamically [use jsp,bean]

    hello, i am a fresher in jsp. i want to add new rows in html table dynamically.In my coding, just only shows in one row . please help my problem with correct coding and i don't want to use database. Thanks ...............!
    Here is my coding-------------------
    ---------------- form.jsp --------------------->
    <%@ page import="java.util.*,newtest1.Validation" %>
    <jsp:useBean id="mybean" scope="page" class="newtest1.Validation" />
    <jsp:setProperty name="mybean" property="name" param="name" />
    <jsp:setProperty name="mybean" property="age" param="age" />
    <% s[i][j] %>
    <html>
    <head><title>Form</title></head>
    <body>
    <form method="get">
    <table border="0" width="700">
    <tr>
    <td width="150" align="right">Name</td>
    <td width="550" align="left"><input type="text" name="name" size="35"></td>
    </tr>
    <tr>
    <td width="150" align="right">Age</td>
    <td width="550" align="left"><input type="text" name="age" size="35"></td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr><td> </td></tr>
    <tr><td><input type="submit" name="submit" value="ADD"></td></tr>
    <tr><td> </td></tr>
    <tr><td width="100%" align="center" border=1>
    <% int count=mybean.getStart();
    for(int i=count; i<count+1; i++) { %>
    <tr>
    <td><jsp:getProperty name="mybean" property="name" /></td>
    <td><jsp:getProperty name="mybean" property="age" /></td>
    <td><%= count %></td>
    <% count+=1; %>
    </tr>
    <% } %></td></tr>
    </table>
    </form>
    </body>
    </html>
    ----------------- Validation.java ----------------->
    package newtest1;
    import java.util.*;
    public class Validation {
    private String name;
    private String age;
    static int start=0;
    public Validation() {    name=null;
    age=null;
    ++start;}
    public void setName(String username) { if(username!="")
    name=username;
    public String getName() { return name;  }
    public void setAge(String userage) {  if (age!="")
    {age=userage;}
    public String getAge() {  return age;   }
    public int getStart() {
    return start; }

    Hi, Do you mean to say,
    You have an HTML page in which you have a text field and an add button. If you enter anything in that text field and click on Add button the text field contents should be displayed in the same HTML page and you should be able to go on entering new values into the text field and you should be able to retain and display all the previously entered values..
    and finally the list of added items are not stored in the database..
    If this is the case
    i. Your html form should be submitted to the same page.
    ii. You need to have a Vector which holds the entered values.
    iii. Bind the vector object to the request object and collect the same vector object from the request and display its contents...
    I think this would help...

  • Error while using Jsp Beans

    Hi, i just have written my first bean but i'm getting this erro message:
    java.lang.ClassNotFoundException: Unable to load class userinfo.FormBean
    Can somebody pls help me out.
    Thanks in advance
    JBP
    Below are my codes for the bean and my jsp codes
    Bean:
    package userinfo;
    import java.io.*;
    public class FormBean implements Serializable
    private String name;
    private String email;
    public FormBean()
    name = "test";
    email = "test";
    public void setName(String name)
    this.name = name;
    public String getName()
    return name;
    public void setEmail(String email)
    this.email = email;
    public String getEmail()
    return email;
    Jsp Codes:
    <html>
    <head>
    <title>Login</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <jsp:useBean id="formbean" class="userinfo.FormBean"/>
    <jsp:setProperty name="formbean" property="*" />
    <body bgcolor="#FFFFFF" text="#000000">
    <% if (request.getParameter("name")==null
    && request.getParameter("email"==null)
    { %>
    <form name="form1" method="post" action="process.jsp">
    Name:
    <input type="text" name="textfield">
    <br>
    <br>
    Email:
    <input type="text" name="textfield2">
    <br>
    <br>
    <input type="submit" name="Submit" value="Process">
    </form>
    <% } else {%>
    <p>
    <b>you have provided the following info</b>
    <p>
    <b>Name</b>:<jsp:getProperty name="formbean" property="name"/>
    <p>
    <b>Email</b>:<jsp:getProperty name="formbean" property="email"/>
    <p>
    <%}%>
    </body>
    </html>

    Hi!
    I tried ur bean in my program on javawebserver.
    It didn't work.
    gave error:
    java.lang.ClassNotFoundException: Unable to load class userinfo.FormBean
    then I just added
    import java.io.Serializable;
    in ur bean and tried.
    It gave me error:
    D:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_examples\_jsp\_samples\_Brand__new\_mail1.java:19: '}' expected.
    static char[][] jspxhtml_data = null;
    I think the problem with bean is solved.
    U check for the same.
    check the settings of server and classpath .
    write whether it works,
    bye,
    Samir

  • File Transfer b/w Client - Server using JSP

    Hi,
    I need to implement a file transfer between the client and the server using JSP / Beans. The files can be XML Documents, Images (.gif,.jpeg) or even MS Word documents.
    The user has a set directory on his file system where the files are to be saved upon download and retrieved upon upload. This system is similar to a check-in check-out system.
    How do I get a reference to the directory on the users file system and then either save the downloaded files there or retrieve the files that need to be uploaded.
    Thanks
    coffeejava

    The only way you can do this is by using an applet, a jsp page or servlet does not have access to the system that the browser is running on. Furthermore if you were planning on using the html file form object you cannot set a value for that programmatically. It's not allowed for security reasons.

  • Problem using a bean in JSP on Tomcat 5.0.28

    Hi,
    I'm new to JSP, I've installed Tomcat 5.0.28 and I'm able to run JSP but when I try an asp wich uses a bean it gives me this error, the directory structure is
    testingProject with the first.jsp
    testingProject\WEB-INF\classes\myPackage with the test.class
    the first.asp
    <%@ page import="myPackage.Test" %>
    <html><head><title>Test</title></head>
    <body bgcolor=white>
    <jsp:useBean id="list" class="myPackage.Test"> </jsp:useBean>
    <jsp:getProperty name="list" property="value1" />
    <%=list.value1%>
    <p>
    </body></html>
    the Test.java
    package myPackage;
    public class Test{
    String value1="testinggggggggg";
    public void Test(){
    public String getValue1(){ return value1}
    the error
    thanks in advance
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 6 in the jsp file: /first.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat 5.0\work\Catalina\localhost\testingProject\org\apache\jsp\first_jsp.java:60: cannot resolve symbol
    symbol : variable value1
    location: class myPackage.Test
    out.print(list.value1);
    ^
    1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)

    There are two ways of getting info from the bean.
    1) the jsp:getProperty tag, which seems correct in your code
    2) the <%= ... tag. In that case you must write a valid java expression. In your case: list.getValue1()

  • Using java bean with jsp

    hello friends,
    i'm new to jsp. i want to create an html form that accepts username and a value from four radio buttons and display back the entered name and checked radio button's value using java bean.
    i use the <jsp:setProperty id="" property="*"> method. i don't know how to access the radio buttons value from the html.
    also when i use an additional field other than username the jsp page is showing error.
    Please give me the correct method to use java bean with jsp in this circumstance.
    thank you.

    thank you, but i have a problem left. the case is like this.
    i got the jsp and bean worked fine when i have a sinle input text field.
    but when i added a second text field i recieved the following error.
    javax.servlet.ServletException: basket.newbean.getUserPass()Ljava/lang/String;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.newform.process_jsp._jspService(process_jsp.java:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    where userPass is the new form element. I have made the subsequent chanes in my bean program and jsp file.
    pls hlp.

  • Calling bean using jsp

    i've installed tomcat v3.3.2, and set the environment variable as normal procedure has mentioned..i have j2sdk 1.4.2_08, and recently has try to expirment calling java beans using jsp file located at D:\jakarta-tomcat-3.3.2\webapps\helloworld.jsp, and my bean file is located at D:\jakarta-tomcat-3.3.2\webapps\ROOT\WEB-INF\classes\com\bean\test\hellobean.class, and my hellobean.java source is :
    package com.bean.test;
    public class hellobean implements java.io.Serializable
    private String Name;
    public hellobean() {}
    public String getName()
    {return Name;}
    public void setName(String Name)
    {this.Name=Name;}
    and my jsp file source:
    <html>
    <body>
    <jsp:useBean id="hello" class="hellobean">
    <jsp:setProperty name="hello" property="Name" value="Alan"/>
    </jsp:useBean>
    <h1>hello, <jsp:getProperty name="hello" property="Name"/></h1>
    </body>
    </html>
    and when i run start.bat and type http://localhost:8080/helloworld.jsp, it gave me this error:
    Error: 500
    Location: /helloworld.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: hellobean
         at org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:140)
         at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:59)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:747)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:176)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:131)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:169)
         at org.apache.tomcat.facade.JasperLiaison.jsp2java(JspInterceptor.java:765)
         at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:706)
         at org.apache.tomcat.facade.JspInterceptor.preInitCheck(JspInterceptor.java:493)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:413)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:874)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:790)
         at org.apache.coyote.tomcat3.Tomcat3Adapter.service(Tomcat3Adapter.java:64)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
         at java.lang.Thread.run(Thread.java:534)
    Root cause:
    java.lang.ClassNotFoundException: hellobean
         at org.apache.tomcat.util.depend.DependClassLoader12Impl.loadClassInternal1(DependClassLoader12.java:205)
         at org.apache.tomcat.util.depend.DependClassLoader12Impl$1.run(DependClassLoader12.java:78)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.tomcat.util.depend.DependClassLoader12Impl.loadClass(DependClassLoader12.java:76)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:138)
         at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:59)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:747)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:176)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:131)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:169)
         at org.apache.tomcat.facade.JasperLiaison.jsp2java(JspInterceptor.java:765)
         at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:706)
         at org.apache.tomcat.facade.JspInterceptor.preInitCheck(JspInterceptor.java:493)
         at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:413)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:874)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:790)
         at org.apache.coyote.tomcat3.Tomcat3Adapter.service(Tomcat3Adapter.java:64)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
         at java.lang.Thread.run(Thread.java:534)
    can anybody help me? thanks

    Hi
    Same problem as above and did everything as posted here in the page, but still doesn't solve my problem.
    Here's the bean :
    package com.partha;
    public class CounterBean
    private int counter=0;
    public int getCounter()
    return counter;
    public void incrementCounter()
    counter++;
    Here's the JSP Page :
    <%@ page language="java" %>
    <jsp:useBean id="session_counter" class="com.partha.CounterBean" scope="session"/>
    <jsp:useBean id="application_counter" class="com.partha.CounterBean" scope="application" />
    <html>
         <head>
              <title>Exercise 3</title>
         </head>
         <body>
              <%= session_counter.incrementCounter() %>
              <%= application_counter.incrementCounter()%>
              The number of times this session was accessed :
              <jsp:getProperty name="session_counter" property="counter" />
              <br>
              The number of times this page was accessed :
              <jsp:getProperty name="application_counter" property="counter" />
         </body>
    </html>
    I am still getting a classnot found exception . Here's what I am getting :
    java.lang.ClassNotFoundException: com.partha.FormBean
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1407)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1252)
         at org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:133)
         at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:650)
         at org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:507)
         at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:983)
         at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1025)
    Please help me out ..

  • Javax.servlet.jsp.JspException: Cannot find bean: "org.apache.struts.taglib

    Hi
    i have a form from which i am gettin values and i am using struts to get those values and perform actions in my DAO,
    i am able to retrieve values from DAO but the value is not gettin printed in front end.. its throwing
    "javax.servlet.jsp.JspException: Cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope" error
    got any suggestions
    thankx

    Got the solution,. i had closed my <html:form> before closing one of my <html:form>
    thankx

  • Insert data into table from JSP page using Entity Beans(EJB 3.0)

    I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
    1. I have a table 'FRIENDS', (in Oracle 10g database).
    2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
    3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
    4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
    5. I am using JDev as editor.
    Please provide me code ASAP or link with similar example.
    Thank you.
    Anurag

    Hi,
    I am also trying that scenario. So u can
    Post the jsp form data to a Servlet which will act as a Controller.
    In the servlet invoke the business method.
    Similar kind of app is in www.roseindia.net
    Hope this would help u.
    Meanwhile if u get any optimal solution, pls post it.
    Thanks,
    Happy Java Coding.

  • Defining the path for the use of beans in a JSP

              Hello,
              I would like to use a bean in a JSP file, via the <jsp:usebean> directive.
              I didn't find any property (weblogic property) which could define the path
              to the directory of my beans classes.
              So :
              1) i have put the path of this directory in the weblogic classpath in the weblogic
              start script.
              2) i made the same with the java classpath.
              Both solutions don't work at all.
              Any suggestion would be appreciated.
              Thanks in advance.
              

              We use the \weblogic\myserver\serverclasses for beans..
              of course we pack beans into jar files, and these jar files are included into
              the wls classpath..
              "Sylvain R." <[email protected]> wrote:
              >
              >Hello,
              >I would like to use a bean in a JSP file, via the <jsp:usebean> directive.
              >I didn't find any property (weblogic property) which could define the
              >path
              > to the directory of my beans classes.
              >So :
              >1) i have put the path of this directory in the weblogic classpath in
              >the weblogic
              >start script.
              >2) i made the same with the java classpath.
              >
              >Both solutions don't work at all.
              >
              >Any suggestion would be appreciated.
              >Thanks in advance.
              >
              

  • Using web beans in JSP

    I would like to know how create a tree using Web Beans that Jdeveloper provides. Using the web object editor I could add two Beans which mapped to JSTree and JSTreeData(in oracle.jdeveloper.jsp.wb package), though I don't know the difference between them. I tried to include Both these beans in the JSP(which appear as tags) but I am unable to render the tree. Let's say I have a parent node (text: row1, url: url1, 3 childs) and 3 child nodes (text: row2..row4, url: url2..url4, each with no childs). How do I write it in the JSP to render it properly
    -Rajeev

    I would like to know how create a tree using Web Beans that Jdeveloper provides. Using the web object editor I could add two Beans which mapped to JSTree and JSTreeData(in oracle.jdeveloper.jsp.wb package), though I don't know the difference between them. I tried to include Both these beans in the JSP(which appear as tags) but I am unable to render the tree. Let's say I have a parent node (text: row1, url: url1, 3 childs) and 3 child nodes (text: row2..row4, url: url2..url4, each with no childs). How do I write it in the JSP to render it properly
    -Rajeev

  • Using BI Bean in JSP

    Hi,
    Can anyone please provider some pointers on using BIBeans in a JSP page. There are few options in my knowledge.
    1)Using BI-Beans API for writing our own JSP tags.
    2)In Jdev(10g) there seems to be some support for Graphs through ADF.
    3)JSP and UIX tags provided BI-Graph beans.
    thanks
    Rahul

    U may be used the code similar to following :
    Context context = new InitialContext.();
    Object obj = (Object)context.lookup("Your JNDI name");
    YourHome home = (YourHome)obj.portableRemoteObject.narrow(obj,
    YourHome.class);
    YourRemote remote = home.create();
    System.out.println("your Business methods : "+remote.businessMethod1());
    Put this code or whatever code used in ur console client in JSP and invoke the businessMethods using remote object.
    I worked with BEAWeblogic 5.1, I think similar case may be there with BEA Weblogic7 also.
    First, make a jar file with ome.Remote and Bean by using the deploymenttool, then compile with ejb compiler, the new Jar is the complete deployable file. Take this file and register in weblogic.properties file that is specify the path of the Jar file in the weblogic.properties file. and put the JSP in public-html directory and start the server. if the bean is deployed successfully, open JSP file in a browser then it will work.... if the bean is not deployed you won't get any result.
    I can say, just placing the initialContext part of code on the JSP and running the JSP. I think, this may helps u...
    Ramana

  • Drop-down in JSP using a bean as back-end

    Hi everyone,
    I like to create a dynamic drop-down (reading from a database) using JSP but accessing a bean. My code on the bean is:
    public void DepartmentName() {
    try
    stmt1 = tConnection.createStatement();
    rs1 = stmt1.executeQuery ("select DEPT_NAME from DEPARTMENT");
    while ( rs1.next() )
    String DptName = rs1.getString("DEPT_NAME");
    System.out.println(DptName);
    Can anybody tell me how to call this DepartmentName bean in JSP? So far my JSP looks like this...
    <table width="100%"><tr>
    <form action="next.jsp" method="POST">
    <input type="hidden" name="type" value="listemp">
    <td width="100">
    <b>Department</b></td>
    <td wifth="100">
    <SELECT name=cust multiple size=4>
    <option>??????? HELP ???????????</option>
    </SELECT>
    </td>
    <td><input type="submit" value="Submit" name="dept">
    </td></tr></table>
    Many thanks.

    First you need to modify your bean to return some sort of data structure of String objects. How about a Vector? Then you could call Vector.elements() on the return statement of the DepartmentName() method, like this...
    public Enumeration DepartmentName()
      Vector myVector = new Vector(0);
      while(rs.next())
        myVector.add(rs.getString(1));
      return myVector.elements();
    }Then in your JSP you'll need to use the JSP useBean tag
    <jsp:useBean id="myBean" class="com.myco.myapp.MyBean" scope="page|request|session|application" />And before the option tag call the bean and get the enumeration of String objects, then loop through them like this:
    while(enum.hasMoreElements())
      out.println(((String) enum.nextElement()));
    }

  • How to use JSP in apache web server

    hi all,
    can anybody tell me how to use JSPs in Apache Web Server.
    Thanks
    sir

    You would need a servlet container to run Servlets and JSPs. And Apache's Tomcat is one such free container available. Download Tomcat from http://jakarta.apache.org and integrate with Apache WS
    HTH

Maybe you are looking for

  • How to find out the set handler for a particular signal?

    I have an interesting puzzle to solve. l'm investigating problems with someone else's code and I'd like to get the name of the handler that is set for SEGV. psig shows that the process catches SEGV, however I don't have access to the source code for

  • Supplied word docs with upper case text

    I'm guessing this might be a bit of an old chestnut, but getting stumped on a quick way to eradicate this when clients supplying it - whacking stuff into the document with their caps locks on, and of course branding in the final output from InDesign

  • "No image found in subtitle script line" -- What's wrong with my FAB file import?

    I've used Encore for years, version 4 and now 5.1 on both Mac and PC (Windows 7). I export FAB files with bitmaps from my subtitling program and import them into subtitle tracks in Encore. The last few times this has not worked.  Every time I export

  • SQL for finding identical domains in e-mail addresses

    Hi, guys can anyone help me designing a query which will guve me the names and email addresses of all people who have the identical registered domain names Edited by: user12258774 on Nov 22, 2009 1:35 PM Edited by: user12258774 on Nov 28, 2009 1:09 P

  • Smart Collection Inheritance

    One should be able to make a smart collection that is based on another smart collection, such that it inherits all of the conditions of its parent and then imposes its own additional set of conditions. This would make many things SO MUCH EASIER... Fo