JSP- Servlet-- Bean-- JSP how to implement

I have problem.
My JSP will take a emplyee id .
Now I want to show all the values regarding that employee in a JSP(JSP form) from the DB(Oracle).
So Iam planning like
JSP-->Servlet-->Bean-->JSP
So my doubts are.
1. Is it correct approach
2.If it is correct then which part of the flow connects to DB and stores the value before putting to JSP.
Iam using Tomcat 4.31
Plz help me

I have problem.
My JSP will take a emplyee id .
Now I want to show all the values regarding that
employee in a JSP(JSP form) from the DB(Oracle).
So Iam planning like
JSP-->Servlet-->Bean-->JSP
So my doubts are.
1. Is it correct approach
2.If it is correct then which part of the flow
connects to DB and stores the value before putting to
JSP.
Iam using Tomcat 4.31
Plz help meHI
What you are probably proposing is an MVC design pattern. I wonder if u have heard of the struts framework. Sruts uses MVC design pattern wherein the servlet u are talking about acts as a controller(C) and the bean acts as the model(M) .The JSPs present the view(V). Hence the name MVC.
Your approach is right. First get the employee ID from the jsp and get the corresponding data from database(This logic u implement in the servlet). Then save the fetched data in a bean so that the result jsp can fetch data from it.
Now this is not a strict MVC approach.
Learn more about struts. It presents a much more cleaner solution.

Similar Messages

  • Sample jsp servlet bean (MVC) code

    We want to look into the JSP/Servlet/Bean area for our next project. We wish to understand the technology and as such want to hand build simple applications, and as such do not want to use JDeveloper just yet.
    We have searched and searched for suitable material but cannot anywhere find a sample application that :
    A. Lists contents of a databse table
    B. Each item in trhe list is a link to a page that allows that item, to be edited.
    C. A new item can be added.
    D. Uses the MVC model of JSP/Servlet and bean (preferably with no custom tags)
    There are examples that are too simplistic and do not cover the whole picture. Having spent over 100 GBP on books lately, only to be disappointed with the examples provided, we need to see some sample code.
    The samples provided by Oracle are too simplistic. They should really have provided ones built around the EMP and DEPT tables.
    Anyone know where we can get hold of this sample code.

    At the risk of sounding really dumb the examples are just too complex. There does not appear to be anywhere on the web where I can find a simple JSP/servlet/bean example of the type I described. There is enouigh material describing each individual component, but what I need is an example to cement the ideas, but the ones suggested are too much for a newbie. Even the much vaunted Pet Store thingy causes my eyes to glaze over.
    I dont expect anyone to have written something with my exact requirements, but surely to goodness there must be something that:
    1. On entry presents a search form on a table (e.g. EMP)
    2. On submission list all rows in EMp matchiung the criteria.
    3. The user can either click the link 'Edit' which opens up a form dispalying the row allowing the user to edit and save the changes, or click the 'New' button to show a blank form to create a new EMP.
    All this via a Controller servlet, with the database logic handled by a java bean, and all the presentation done via JSP.
    To me this is the most obvious and instructive example of this technology, but after days of trawling the web, and looking through a number of books, I cannot find such a thing.
    CGI with Perl DBI/DBD was a breeze to work with compared to this stuff ..... maybe ASP with SQL/Server would be a more fruitful use of time.

  • Jsp-servlet-bean problem

    Please help!
    I have a servlet controller, a javabean for the data and a jsp for the view.
    I cannot get the jsp using
    <jsp:useBean id="pList" class="bbs.PostListCommand" scope="request" />
    to access the bean data
    However, when I access the bean in this way
    <%@ page import="bbs.PostListCommand" %>
    // html
    <% bbs.PostListCommand postList = null;
    synchronized(session){
         postList = (bbs.PostListCommand) session.getAttribute("PostListCommand");
         if (postList == null){ %>
              <H1>Nothing in request scope to retrieve ....</H1>
              <P>
    <%     }
         else{  %>
              <TABLE border="1">
    // etc
    � it works
    Does anyone know why the <jsp:useBean> tag does not find the bean
    I have installed tomcat 4.18 and set the environmental variables etc.
    Directory structure is
    E:\Tomcat41\webapps\examples\WEB-INF\jsp          for jsp�s
    E:\Tomcat41\webapps\examples\WEB-INF\classes\bbs     for bean and servlets
    Thanks in advance for any help.
    Chris

    GrayMan - Thanks for your help.
    Let me explain my problem in more detail ...
    Background:
    I have some servlet experience, but I am new to jsp - so sorry if this seems trivial to you ...
    I have a book called bitter java by bruce tate from manning.com . I am trying to get the chapter 3 examples to work
    There are three files
    PostListCommand          the bean
    PostListController     the servlet
    PostListResults          jsp
    And a new test file � PostListResults version 2 with scriptlet code to access the bean.
    There are a couple of typos in the downloaded source files, but nothing that causes the main problem of not being able to access the bean data.
    Program flow
    Servlet instantiates new bean
    Bean � gets data from db
    Servlet passes bean to jsp with a forward
    Jsp outputs data
    I have put the files in the directories �
    E:\Tomcat41\webapps\examples\WEB-INF\jsp          for jsp�s
    E:\Tomcat41\webapps\examples\WEB-INF\classes\bbs     for bean and servlets
    The complete source code for each file is given below.
    1 I have checked the db access � that�s ok
    2 I have also checked reading the bean data back in from the request scope and printing out the results from within the servlet.- ok
    3 I can access the data through a scriptlet (PostListResults version 2), but not with the original PostListResults which uses <jsp:useBean>
    thanks in advance, chris
    PostListController.java
    package bbs;
    // Imports
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    // Import for commands used by this class
    import bbs.PostListCommand;
    public class PostListController
    extends javax.servlet.http.HttpServlet
    implements Serializable {
    * DoGet
    * Pass get requests through to PerformTask
    public void doGet(
    HttpServletRequest request,
    HttpServletResponse response)
    throws javax.servlet.ServletException, java.io.IOException {
    performTask(request, response);
    public void performTask(
    HttpServletRequest request,
    HttpServletResponse response) {
    try {
    PostListCommand postList = (bbs.PostListCommand) java.beans.Beans.instantiate(getClass().getClassLoader(),"bbs.PostListCommand");
    postList.initialize();
    postList.execute();
    request.setAttribute("PostListCommand", postList);
    ServletContext sc = this.getServletContext();
    RequestDispatcher rd =
    sc.getRequestDispatcher("/jsp/PostListResults.jsp");
    rd.forward(request, response);
    } catch (Throwable theException) {
    theException.printStackTrace();
    PostListCommand.java
    package bbs;
    import java.io.*;
    import java.sql.*;
    //import COM.ibm.db2.jdbc.*;
    import java.util.*;
    * Insert the type's description here.
    * Creation date: (07/17/2001 5:07:55 PM)
    * @author: Administrator
    public class PostListCommand {
    // Field indexes for command properties     
    private static final int SUBJECT_COLUMN = 1;
    private static final int AUTHOR_COLUMN = 2;
    private static final int BOARD_COLUMN = 3;
    protected Vector author = new Vector();
    protected Vector subject = new Vector();
    protected Vector board = new Vector();
    // SQL result set
    protected ResultSet result;
    protected Connection connection = null;
    * execute
    * This is the work horse method for the command.
    * It will execute the query and get the result set.
    public void execute()
    throws
    java.lang.Exception,
    java.io.IOException {
    try {
    // retrieve data from the database
    Statement statement = connection.createStatement();
    result =
    statement.executeQuery("SELECT subject, author, board from posts");
    while (result.next()) {
    subject.addElement(result.getString(SUBJECT_COLUMN));
    author.addElement(result.getString(AUTHOR_COLUMN));
    board.addElement(result.getString(BOARD_COLUMN));
    result.close();
    statement.close();
    } catch (Throwable theException) {
    theException.printStackTrace();
    * getAuthor
    * This method will get the author property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getAuthor(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) author.elementAt(index);
    * getBoard
    * This method will get the board property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getBoard(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) board.elementAt(index);
    * getSubject
    * This method will get the subject property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getSubject(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) subject.elementAt(index);
    * initialize
    * This method will connect to the database.
    public void initialize()
    throws java.io.IOException {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    // URL is jdbc:db2:dbname
    String url = "jdbc:db2:board";
    // URL is jdbc:odbc:bitter3board
    String url = "jdbc:odbc:bitter3board";
    // connect with default id/password
    connection = DriverManager.getConnection(url);
    } catch (Throwable theException) {
    theException.printStackTrace();
    * Insert the method's description here.
    * Creation date: (07/17/2001 11:38:44 PM)
    * @return int
    * @exception java.lang.IndexOutOfBoundsException The exception description.
    public int getSize() {
    return author.size();
    PostListResults.jsp
    <HTML>
    <HEAD>
    <TITLE>Message Board Posts</TITLE>
    </HEAD>
    <BODY BGCOLOR=#C0C0C0>
    <H1>All Messages</H1>
    <P>
    <jsp:useBean id="postList" class="bbs.PostListCommand" scope="request"></jsp:useBean>
    <TABLE border="1">
    <TR>
    <TD>Subject</TD>
    <TD>Author</TD>
    <TD>Board</TD>
    </TR>
    <% for (int i=0; i < postList.getSize(); _i++) { %>
    <TR> <TD><%=postList.getSubject(_i) %></TD>
    <TD><%=postList.getAuthor(_i) %></TD>
    <TD><%=postList.getBoard(_i) %></TD>
    </TR>
    <% } %>
    </TABLE>
    <P>
    </BODY>
    </HTML>
    PostListResults.jsp version 2 � with scriplet code instead of useBean
    <HTML>
    <%@ page import="bbs.PostListCommand" %>
    <!-- This file was generated by the chris -->
    <HEAD>
    <TITLE>Message Board Posts</TITLE>
    </HEAD>
    <BODY BGCOLOR=#C0C0C0>
    <% bbs.PostListCommand postList = null;
    synchronized(request){
         postList = (bbs.PostListCommand) request.getAttribute("PostListCommand");
         if (postList == null){ %>
              <H1>Nothing in request scope to retrieve ....</H1>
              <P>
    <%     }
         else{  %>
              <TABLE border="1">
              <TR>
              <TD>Subject</TD>
              <TD>Author</TD>
              <TD>Board</TD>
              </TR>
         <% for (int i=0; i < postList.getSize(); _i++) { %>
                   <TR> <TD><%=postList.getSubject(_i) %></TD>
              <TD><%=postList.getAuthor(_i) %></TD>
              <TD><%=postList.getBoard(_i) %></TD>
              </TR>
         <% } %>
              </TABLE>
    <%     }
    }%>
    <P>
    goodnight
    </BODY>
    </HTML>

  • Jsp / Servlet / bean / upload

    Hello,
    I use a jsp to enter several fields. These fields are sent to a servlet by using a bean (recorded in the current session). Until now there is no problem. The servlet receives all information. Now I must also send 5 files which must be stored on the server. I have thus to add in my jsp 5 file fields.
    My question :
    Is it possible to integrate the FileUpload package for uploader my files without anything to change in my code (by using of a bean to exchange the data between my jsp and my servlet). ??
    In other words, it is possible to use my bean to also transport files. ??
    Tank u for u help

    Yes it is possible..
    download cos.jar from www.oreily.com for file upload..
    it will read dat from the form as two parts ..
    parameter part and file part..
    and you can implement it throgh a servlet easily..
    for more follow oreily JSP/servlets Cookbook

  • Jsp,servlet,bean question,please help

    The Tomcat Web server set up like this.......
    The directory structure is
    e:/sampleapp/WEB-INF/classes
    /lib
    And the web.xml is in the WEB-INF for the use of ay potential servlet.
    The basic understanding is that all the .java files go into the WEB-INF directory and the .class files go into the classes directory.
    All the .jsp files go into the sampleapp directory.Till here is correct I feel.
    Now for my qustion......
    I plan to use jsp,servlet and beans for a potential web application...,where do all these files go?,just the same as above or is there a difference.
    Hope that I have given a reasonable explaination to my question.
    Thanks for any replies
    AS

    All of your compiled servlet and java bean (java
    classes in general) will be placed into the following
    directory (under a directory structure matching the
    java package they are in):
    e:/sampleapp/WEB-INF/classesAll of your .jar files that are used as libraries (not
    your .jar files for applets):
    e:/sampleapp/WEB-INF/libAll of the rest of your JSP files, javascript files,
    HTML files, JAR files, images files, etc. will go into
    the following directory:
    e:/sampleappYou must make sure you put your sampleapp directory
    where tomcat can load it. Or use the admin tool to
    load it. If you make a .WAR file with a corresponding
    web.xml file in it, it will simplify loading it into
    tomcat. It also will help you do your servlet
    mappings, etc. I hope this helps.Thanks for your timely response.To add to it,let me tell you.
    The <b>bean</b> files are put into a package right,so they should be put into the WEB-INF/classes/<package name>
    What about The <b> servlet </b> files...... they are just put into the WEB-INF/classes/ directory????
    Kindly let me know.
    Thanks
    AS

  • JSP/Servlet/Bean help

    Pretty new to java and I am getting an error that I have tried to figure out for a few days here and ... well... not getting far.
    I have a servlet that calls one of two jsp pages depending on GET or POST. index.jsp is called on GET and works fine. On POST the servlet gets a db pool connection does a quick select count(*) query and then populates a bean with the results. This all works fine (as I have system.out.println's showing me the results)
    But when it forwards to the next jsp page the page bombs out because it can't seem to find the Bean.
    The error is below.
    my set up is Tomcat 4.x
    the main servlet AECPhoneServlet is in ...webapps/damn/WEB-INF/classes
    the bean (QueryBean) is in ...webapps/damn/WEB-INF/classes/com/phone
    jsp's are in ...webapps/damn
    web.xml looks like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>AECPhoneServlet</servlet-name>
    <servlet-class>AECPhoneServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>AECPhoneServlet</servlet-name>
    <url-pattern>/AECPhone</url-pattern>
    </servlet-mapping>
    </web-app>
    Classpath is
    echo $CLASSPATH
    :/usr/tomcat/jakarta-tomcat-4.1.24/webapps/damn/WEB-INF/classes/com/phone:.:/usr/tomcat/jakarta-tomcat-4.1.24/common/lib/servlet.jar
    I am beating my head against the wall here. Any and all help would be greatly appreciated. Assume I know nothing. lol. Because basically I don't.
    ype Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /rs.jsp
    Generated servlet error:
    [javac] Since fork is true, ignoring compiler setting.
    [javac] Compiling 1 source file
    [javac] Since fork is true, ignoring compiler setting.
    [javac] /usr/tomcat/jakarta-tomcat-4.1.24/work/Standalone/localhost/damn/rs_jsp.java:8: package com does not exist
    [javac] import com.phone;
    [javac] ^
    [javac] /usr/tomcat/jakarta-tomcat-4.1.24/work/Standalone/localhost/damn/rs_jsp.java:45: cannot resolve symbol
    [javac] symbol : class TestBean
    [javac] location: class org.apache.jsp.rs_jsp
    [javac] TestBean tBean = null;
    [javac] ^
    An error occurred at line: 2 in the jsp file: /rs.jsp
    Generated servlet error:
    [javac] /usr/tomcat/jakarta-tomcat-4.1.24/work/Standalone/localhost/damn/rs_jsp.java:47: cannot resolve symbol
    [javac] symbol : class TestBean
    [javac] location: class org.apache.jsp.rs_jsp
    [javac] tBean = (TestBean) pageContext.getAttribute("tBean", PageContext.PAGE_SCOPE);
    [javac] ^
    An error occurred at line: 2 in the jsp file: /rs.jsp
    Generated servlet error:
    [javac] /usr/tomcat/jakarta-tomcat-4.1.24/work/Standalone/localhost/damn/rs_jsp.java:50: cannot resolve symbol
    [javac] symbol : class TestBean
    [javac] location: class org.apache.jsp.rs_jsp
    [javac] tBean = (TestBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "TestBean");
    [javac] ^
    [javac] 4 errors
         at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
         at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
         at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
         at AECPhoneServlet.doPost(AECPhoneServlet.java:56)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)

    my set up is Tomcat 4.x
    the main servlet AECPhoneServlet is in
    ...webapps/damn/WEB-INF/classes
    the bean (QueryBean) is in
    ...webapps/damn/WEB-INF/classes/com/phone
    jsp's are in ...webapps/damn
    /usr/tomcat/jakarta-tomcat-4.1.24/work/Standalone/local
    ost/damn/rs_jsp.java:45: cannot resolve symbol
    [javac] symbol : class TestBean
    [javac] location: class org.apache.jsp.rs_jsp
    [javac] TestBean tBean = null;
    [javac] ^
    I don't know if this is a typo, but above you say the class name is QueryBean. However, the compiler errors refer to a class called TestBean.

  • Change Drop Down from Other JSP/Servlet/Bean

    I am wanting to have a select box populate from a database query based on the information pulled from another select box as the user chooses it (ie a user chooses a state and the city choices populate or something like that). I am using JSP, Servlets and Beans. Seems that I need to us JSF, but I was wondering if there is another way or better way.
    Thanks for the thoughts.

    user12081556 wrote:
    I meant to put in my question above, aren't jsf tags just imbedded in some jsp/html code?Not jsp code no. I don't know whether it's possible to use jsf and jsp together, but I wouldn't try.
    While JSP has evolved over time from Html and Java code mixed together to standard tags responsible mostly for displaying the data, it's still an old "hack" that compiles jsp pages into servlets.
    JSF at least alleviates some of those problems and works nicely with proper xhtml formatted views too (and there's facelets etc. etc. etc.).
    Granted, if you're shown some jsp tags and jsf tags, you might not appreciate the difference in the technologies.

  • Running jsp using Beans (jsp:useBean) on Tomcat 3.2.1 on Linux 7.0

    Hi all,
    In which folder do I keep my java bean class files so that my jsp can use jsp:useBean tag while my jsp's are stored in /webapps/examples/jsp/seet folder.
    Thanks in advance.
    Seetesh

    If their just .class files put them into /webapps/project/WEB-INF/classes
    If they're packaged as a JAR put them into /webapps/project/WEB-INF/lib
    These folders are automatically added to Tomcats classpath.

  • What are JSP, Servlet , Bean in MVC ??..how does it function?

    suppose there's a bean file (.java) consisting of SQL query, and a servlet (.java) used to show an image, and lastly a jsp page when clicked shows the image.............can you please explain how does this work,how the logic flows,what happens step by step.....i really need to understand this, thankz.

    A JSP page is essentially an easy way to create an abstract behind the scenes servlet where its whole purpose is to serve HTML. JSP tags and java code within the page are processed on the server side first and then a response is sent containing the HTML.
    The JSP can send its request to another handler or servlet that can do the processing.
    I don't understand where a java bean comes into play in this situation.

  • SOme more help on JSP-Servlets-Beans plz...!!

    Thanx a lot for your help !
    But I could not understand some things ...
    Suppose, I create 5 bean instances in my servlet, & "set" them with data from 5 tuples.
    Now, I need to pass these 5 bean objects to a JSP .
    HOW exactly can I pass them via a List object thru request attribute ?
    And, after doing that, HOW will I be able to access the individual Bean objects in the JSP ?
    Plz., see if you can send me some Code Snippets that illustrate the same.
    Once again, Thanks a lot for bearing with me !!
    Awaiting your response...
    Truly yours,
    Raghu

    Servlet:
    request.setAttribute ("someUniqueName", yourBeanList);
    JSP:
    Either <jsp:useBean> or insert a scriplet like <% List beanList = (List) request.getAttribute("someUniqueName"); %>

  • Performance testing of servlets / beans / jsp ?

    Hi. I'd like to performance test my applications, anyone have a clue on what software to use?
    I use Fort� for Java CE 3 as the IDE and TomCat 3.23 as the servlet / jsp container.
    Hopefully there are some opensource tools to use for this?
    Regards,
    Chris

    You can precompile JSP's, this removes the small hickup when they are requested the first time (making the server translate and compile them). Check the documentation of your specific web/application server on how to do this.
    Otherwise:
    - buy better hardware
    - use a better application server
    - make sure your network is properly configured (so packets don't get routed around the network four times before they reach their destination for example)
    - make sure your program logic doesn't create bottlenecks such as
    unnecessary HTTP requests, redundant loops, etc.
    - optimize your database access, use connection pooling
    - optimize your database queries. Create indexes, make sure the SQL queries themselves aren't doing unnecessary trips around the database, etc.

  • Jsp, servlet & bean: trying to display records in a jsp

    Hello i'm trying to display records from my MYSQL database into particular fields allready designed in a jsp. Via servlets and beans i want the records in a jsp.
    I can get the resultset of the record, but can't get the resultset in de fields of the jsp.
    Here are my files:
    SERVLET
    package ...;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class Zoekklantactie extends HttpServlet {
         ZoekklantBean ZoekklantBean = new ZoekklantBean();
         ZoekklantactieBean ZoekklantactieBean = new ZoekklantactieBean();
         DbBean db = new DbBean();
         public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
              verwerk(request, response);
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
         verwerk(request, response);
    public void verwerk(HttpServletRequest request, HttpServletResponse response) throws IOException {
         response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              String hachternaam = request.getParameter("hachternaam");
              String zoekklantnieuw = "SELECT hachternaam FROM klantgegevens WHERE hachternaam = ";
              String zoekklantnieuw2 = zoekklantnieuw + " '"+hachternaam+"' ";
              ResultSet rs = null;
                   //     out.println("debug 1<br>");
         /*     try {
                   //     Statement s;
                        db.connect();
                   //     s = db.getS();
                        rs = db.execSQL("SELECT hachternaam FROM klantgegevens WHERE hachternaam = 'Opgelder'");
                   //          out.println(rs.getString(1)+"hoi");
                        while (rs.next()) {
                   //                retrieve and print the values for the current row
                   //          out.println("debug1a --> "+rs.toString()+"<br>");
                             String str = rs.getString(1);
                   //          out.println("ROW = " + str );
                        } catch (SQLException e) {
                   //                TODO Auto-generated catch block
                   //          out.println("debug2 <br>"+e.toString());
                             e.printStackTrace();
                        } catch (ClassNotFoundException e) {
                   //                TODO Auto-generated catch block
                   //          out.println("debug3 <br>");
                             e.printStackTrace();
         /* ResultSet rs = null;
         out.println("debug 1<br>");
              try {
                   //     Statement s;
                   db.connect();
                   //     s = db.getS();
                   rs = db.execSQL("select * from klantgegevens where hachternaam = 'Opgelder'");
                   //          out.println(rs.getString(1)+"hoi");
                   while (rs.next()) {
                        rs.first();
                   //           retrieve and print the values for the current row
                        out.println("debug1a<br>");
                        String str = rs.getString(1);
                        System.out.println("ROW = " + str );
                   rs = (ResultSet) db.execSQL(zoekklantnieuw2);
                   out.print(rs.getString("hwoonplaats"));
                   out.print(zoekklantnieuw2);
              } catch (SQLException e) {
                   //                TODO Auto-generated catch block
                   out.println("debug2 <br>"+e.toString());
                   e.printStackTrace();
              } catch (ClassNotFoundException e) {
                   //                TODO Auto-generated catch block
                   out.println("debug3 <br>");
                   e.printStackTrace();
              if( hachternaam == "" ){
                   request.setAttribute("jesper",ZoekklantBean);
                   //          Get dispatcher with a relative URL
                   RequestDispatcher dis = request.getRequestDispatcher("Zoekklant.jsp");
                   //           include
                   try {
                        dis.include(request, response);
                   } catch (ServletException e) {
                        e.printStackTrace();
                   } catch (IOException e) {
                        e.printStackTrace();
                   //          or forward
                   try {
                        dis.forward(request, response);
                   } catch (ServletException e) {
                        e.printStackTrace();
                   } catch (IOException e) {
                        e.printStackTrace();
              else{
                   try {
                   //     Statement s;
                        db.connect();
                   //     s = db.getS();
                        rs = db.execSQL(zoekklantnieuw2.toString());
                   //          out.println(rs.getString(1)+"hoi");
                        while (rs.next()) {
                   //           retrieve and print the values for the current row
                   //          out.println("debug1a --> "+rs.toString()+"<br>");
                             String str = rs.getString(1);
                   //          out.println("ROW = " + str );
                   //          out.print(rs);
                        } catch (SQLException e) {
                   //                TODO Auto-generated catch block
                   //          out.println("debug2 <br>"+e.toString());
                             e.printStackTrace();
                        } catch (ClassNotFoundException e) {
                   //                TODO Auto-generated catch block
                   //          out.println("debug3 <br>");
                             e.printStackTrace();
                   request.setAttribute("jesper",ZoekklantactieBean);
                   //          Get dispatcher with a relative URL
                   RequestDispatcher dis = request.getRequestDispatcher("Zoekresultaatklant.jsp");
                   //          include
                   try {
                        dis.include(request, response);
                        } catch (ServletException e) {
                        e.printStackTrace();
                        } catch (IOException e) {
                        e.printStackTrace();
                   //          or forward
                   try {
                        dis.forward(request, response);
                        } catch (ServletException e) {
                        e.printStackTrace();
                        } catch (IOException e) {
                        e.printStackTrace();
    BEAN
    package ...;
    public class ZoekklantactieBean {
         private String hachternaam;
         private String hvoorletters;
         private String hgeslachtMan;
         private String hgeslachtVrouw;
         private String hgeboortePlaats;
         private String hgeboorteDatum;
         private String hnationaliteit;
         private String hsofinummer;
         private String hadres;
         private String hwoonplaats;
         private String hpostcode;
         private String htelefoonnummerPrive;
         private String htelefoonnummerMobiel;
         private String htelefoonnummerWerk;
         private String hemail;
         private String hburgelijkeStaat;
         private String hallimentatie;
         private String hrestduurAllimentatie;
         private Boolean hbetreftOversluiting;
         private String pachternaam;
         private String pvoorletters;
         private String pgeslachtMan;
         private String pgeslachtVrouw;
         private String pgeboortePlaats;
         private String pgeboorteDatum;
         private String pnationaliteit;
         private String psofinummer;
         private String padres;
         private String pwoonplaats;
         private String ppostcode;
         private String ptelefoonnummerPrive;
         private String ptelefoonnummerMobiel;
         private String ptelefoonnummerWerk;
         private String pemail;
         private String pburgelijkeStaat;
         private String pallimentatie;
         private String prestduurAllimentatie;
         private Boolean poversluiting;
         public void setHachternaam( String name )
         hachternaam = name;
         public String getHachternaam()
         return hachternaam;
         public void setHvoorletters( String name )
         hvoorletters = name;
         public String getHvoorletters()
         return hvoorletters;
         public void setHgeslachtMan( String gender )
         hgeslachtMan = gender;
         public String getHgeslachtMan()
         return hgeslachtMan;
         public void setHgeslachtVrouw( String gender )
         hgeslachtVrouw = gender;
         public String getHgeslachtVrouw()
         return hgeslachtVrouw;
         public void setHgeboortePlaats( String name )
         hgeboortePlaats = name;
         public String getHgeboortePlaats()
         return hgeboortePlaats;
         public void setHgeboorteDatum( String date )
         hgeboorteDatum = date;
         public String getHgeboorteDatum()
         return hgeboorteDatum;
         public void setHnationaliteit( String name )
         hnationaliteit = name;
         public String getHnationaliteit()
         return hnationaliteit;
         public void setHsofinummer( String number )
         hsofinummer = number;
         public String getHsofinummer()
         return hsofinummer;
         public void setHadres( String name )
         hadres = name;
         public String getHadres()
         return hadres;
         public void setHwoonplaats( String name )
         hwoonplaats = name;
         public String getHwoonplaats()
         return hwoonplaats;
         public void setHpostcode( String name )
         hpostcode = name;
         public String getHpostcode()
         return hpostcode;
         public void setHtelefoonnummerPrive( String number )
         htelefoonnummerPrive = number;
         public String getHtelefoonnummerPrive()
         return htelefoonnummerPrive;
         public void setHtelefoonnummerMobiel( String number )
         htelefoonnummerMobiel = number;
         public String getHtelefoonnummerMobiel()
         return htelefoonnummerMobiel;
         public void setHtelefoonnummerWerk( String number )
         htelefoonnummerWerk = number;
         public String getHtelefoonnummerWerk()
         return htelefoonnummerWerk;
         public void setHemail( String adress )
         hemail = adress;
         public String getHemail()
         return hemail;
         public void setHburgelijkeStaat( String name )
         hburgelijkeStaat = name;
         public String getHburgelijkeStaat()
         return hburgelijkeStaat;
         public void setHallimentatie( String number )
         hallimentatie = number;
         public String getHallimentatie()
         return hallimentatie;
         public void setHrestduurAllimentatie( String number )
         hrestduurAllimentatie = number;
         public String getHrestduurAllimentatie()
         return hrestduurAllimentatie;
         public void setHbetreftOversluiting( Boolean choise )
         hbetreftOversluiting = choise;
         public Boolean getHbetreftOversluiting()
         return hbetreftOversluiting;
         public void setPachternaam( String name )
         pachternaam = name;
         public String getPachternaam()
         return pachternaam;
         public void setPvoorletters( String name )
         pvoorletters = name;
         public String getPvoorletters()
         return pvoorletters;
         public void setPgeslachtMan( String gender )
         pgeslachtMan = gender;
         public String getPgeslachtMan()
         return pgeslachtMan;
         public void setPgeslachtVrouw( String gender )
         pgeslachtVrouw = gender;
         public String getPgeslachtVrouw()
         return pgeslachtVrouw;
         public void setPgeboortePlaats( String name )
         pgeboortePlaats = name;
         public String getPgeboortePlaats()
         return pgeboortePlaats;
         public void setPgeboorteDatum( String date )
         pgeboorteDatum = date;
         public String getPgeboorteDatum()
         return pgeboorteDatum;
         public void setPnationaliteit( String name )
         pnationaliteit = name;
         public String getPnationaliteit()
         return pnationaliteit;
         public void setPsofinummer( String number )
         psofinummer = number;
         public String getPsofinummer()
         return psofinummer;
         public void setPadres( String name )
         padres = name;
         public String getPadres()
         return padres;
         public void setPwoonplaats( String name )
         pwoonplaats = name;
         public String getPwoonplaats()
         return pwoonplaats;
         public void setPpostcode( String name )
         ppostcode = name;
         public String getPpostcode()
         return ppostcode;
         public void setPtelefoonnummerPrive( String number )
         ptelefoonnummerPrive = number;
         public String getPtelefoonnummerPrive()
         return ptelefoonnummerPrive;
         public void setPtelefoonnummerMobiel( String number )
         ptelefoonnummerMobiel = number;
         public String getPtelefoonnummerMobiel()
         return ptelefoonnummerMobiel;
         public void setPtelefoonnummerWerk( String number )
         ptelefoonnummerWerk = number;
         public String getPtelefoonnummerWerk()
         return ptelefoonnummerWerk;
         public void setPemail( String adress )
         pemail = adress;
         public String getPemail()
         return pemail;
         public void setPburgelijkeStaat( String name )
         pburgelijkeStaat = name;
         public String getPburgelijkeStaat()
         return pburgelijkeStaat;
         public void setPallimentatie( String number )
         pallimentatie = number;
         public String getPallimentatie()
         return pallimentatie;
         public void setPrestduurAllimentatie( String number )
         prestduurAllimentatie = number;
         public String getPrestduurAllimentatie()
         return prestduurAllimentatie;
         public void setPoversluiting( Boolean choise )
         poversluiting = choise;
         public Boolean getPoversluiting()
              return poversluiting;
    JSP
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="ErrorPage.jsp" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <jsp:useBean id = "db" scope = "request" class = "jesper.DbBean" />
    <jsp:useBean id = "ZoekklantactieBean" scope = "request" class = "jesper.ZoekklantactieBean" />
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Klantinvoer</title>
    <style type="text/css">
    <!--
    .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
    .style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; }
    -->
    </style></head>
    <body>
    <form id="Zoekklantactie" name="Zoekklantactie" method="post" action="Zoekklantactie">
    <table width="71%" height="447" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td width="20%"><span class="style1">Zoek klant </span></td>
    <td width="20%"><select name="select">
    <option>H. Patat</option>
    <option>B. Opgelder</option>
    <option>Y. de Koning</option>
    </select> </td>
    <td width="8%"> </td>
    <td width="18%"> </td>
    <td width="20%"> </td>
    <td width="14%"> </td>
    </tr>
    <tr>
    <td><span class="style3">Hoofdaanvrager</span></td>
    <td> </td>
    <td> </td>
    <td><span class="style3">Partner</span></td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Naam</span></td>
    <td><input type="text" name="hachternaam" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hachternaam" />"/></td>
    <td> </td>
    <td><span class="style1">Naam</span></td>
    <td><input type="text" name="pachternaam" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pachternaam" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Voorletters</span></td>
    <td><input type="text" name="hvoorletters" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hvoorletters" />"/></td>
    <td> </td>
    <td><span class="style1">Voorletters</span></td>
    <td><input type="text" name="pvoorletters" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pvoorletters" />"/></td>
    <td> </td>
    </tr>
         <tr>
    <td><span class="style1">Geslacht</span></td>
    <td><span class="style1">
    <label>
    <input name="hgeslachtMan" type="radio" value="<jsp:getProperty name ="ZoekklantactieBean" property ="hgeslachtMan"/>Man" />
    Man
    <input name="hgeslachtMan" type="radio" value="<jsp:getProperty name ="ZoekklantactieBean" property ="hgeslachtVrouw"/>Vrouw" />
    Vrouw </label>
    </span></td>
    <td><span class="style1"></span></td>
    <td><span class="style1">Geslacht</span></td>
    <td><span class="style1">
    <label>
    <input name="pgeslachtMan" type="radio" value="<jsp:getProperty name ="ZoekklantactieBean" property ="pgeslachtMan" />Man" />
              Man
              <input name="pgeslachtMan" type="radio" value="<jsp:getProperty name ="ZoekklantactieBean" property ="pgeslachtVrouw" />Vrouw" />
              Vrouw </label></span></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Geboortedatum</span></td>
    <td><input type="text" name="hgeboorteDatum" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hgeboorteDatum" />"/></td>
    <td> </td>
    <td><span class="style1">Geboortedatum</span></td>
    <td><input type="text" name="pgeboorteDatum" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pgeboorteDatum" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Geboorteplaats</span></td>
    <td><input type="text" name="hgeboortePlaats" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hgeboortePlaats" />"/></td>
    <td> </td>
    <td><span class="style1">Geboorteplaats
    </span></td>
    <td><span class="style1">
    <input type="text" name="pgeboortePlaats" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pgeboortePlaats" />"/>
    </span></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Nationaliteit</span></td>
    <td><input type="text" name="hnationaliteit" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hnationaliteit" />"/></td>
    <td> </td>
    <td><span class="style1">Nationaliteit</span></td>
    <td><input type="text" name="pnationaliteit" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pnationaliteit" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Sofinummer</span></td>
    <td><input type="text" name="hsofinummer" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hsofinummer" />"/></td>
    <td> </td>
    <td><span class="style1">Sofinummer</span></td>
    <td><input type="text" name="psofinummer" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="psofinummer" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Postcode</span></td>
    <td><input type="text" name="hpostcode" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hpostcode" />"/></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Adres</span></td>
    <td><input type="text" name="hadres" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hadres" />"/></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Woonplaats</span></td>
    <td><input type="text" name="hwoonplaats" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hwoonplaats" />"/></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Telefoon prive</span></td>
    <td><span class="style1">
    <input type="text" name="htelefoonnummerPrive" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="htelefoonnummerPrive" />"/></span></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Telefoon mobiel </span></td>
    <td><span class="style1">
    <input type="text" name="htelefoonnummerMobiel" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="htelefoonnummerMobiel" />"/></span></td>
    <td> </td>
    <td><span class="style1">Telefoon mobiel</span></td>
    <td><span class="style1">
    <input type="text" name="ptelefoonnummerMobiel" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="ptelefoonnummerMobiel" />"/></span></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Telefoon werk </span></td>
    <td><span class="style1">
    <input type="text" name="htelefoonnummerWerk" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="htelefoonnummerWerk" />"/></span></td>
    <td> </td>
    <td><span class="style1">Telefoon werk</span></td>
    <td><span class="style1">
    <input type="text" name="ptelefoonnummerWerk" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="ptelefoonnummerWerk" />"/></span></td>
    <td> </td>
    </tr>
    <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">E-mail</span></td>
    <td><input type="text" name="hemail" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hemail" />"/></td>
    <td> </td>
    <td><span class="style1">E-mail</span></td>
    <td><input type="text" name="pemail" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pemail" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Burgelijke staat </span></td>
    <td><select name="hburgelijkeStaat" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hburgelijkeStaat" />">
    <option selected="selected">gehuwd</option>
    <option>ongehuwd</option>
    <option>gescheiden</option>
    </select> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Allimentatie</span></td>
    <td><input type="text" name="hallimentatie" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hallimentatie" />"/></td>
    <td> </td>
    <td><span class="style1">Allimentatie</span></td>
    <td><input type="text" name="pallimentatie" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="pallimentatie" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Restduur allimentatie </span></td>
    <td><input type="text" name="hrestduurAllimentatie" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hrestduurAllimentatie" />"/></td>
    <td> </td>
    <td><span class="style1">Restduur allimentatie </span></td>
    <td><input type="text" name="prestduurAllimentatie" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="prestduurAllimentatie" />"/></td>
    <td> </td>
    </tr>
    <tr>
    <td><span class="style1">Betreft een oversluiting? </span></td>
    <td><input type="checkbox" name="hbetreftOversluiting" value ="<jsp:getProperty name ="ZoekklantactieBean" property ="hbetreftOversluiting" />Betreft oversluiting" /></td>
    <td> </td>
    </tr>
    </table>
    </form>
    <form name="Terug" method="post" action="Menu.jsp"><input name="Terug" type="submit" value="Terug naar hoofdmenu" /></form>
    </body>
    </html>
    Package everywhere the same.
    Have commented some of the code, because i was trying to debug, but just couldn't figure it out.
    Tnx in advance.
    gr. bopgelder

    put your bean in a different package from servlet and include this
    package in your servlet like
    import yourbeanpackage.yourbean
    and then create object of bean and use it

  • JSP- Servlet- Same JSP - Urgent HELP!

    I have a scenario as follows:
    The JSP is a Login JSP which forwards the request to the Servlet to validate the Login info from the HTML. This I do by submitting the JSP page to itself & in the beginning checking if the Submit button was clicked, if yes, then I extract all the form elements by request.getPArameter(element name) & set in on the request using request.setAttribute() methods! The servlet uses the values by doing a request.getAttribute() & say, a validate User failure, the servlet ahs tor edirect user to the same Login.jsp page, but the second time, the "Submit" button value is still true, since the servlet forwards the same request, response & this ends in an infinite loop, of JSP calling Servlet, the User validation fails & the Servlets calls the JSp again, and so on.
    How do I reset the HTML form element values in the JSP before forwarding to the Servlet? is there a request.setParameter() method? Or is there a way for the servlet to forward a new request & response to the same JSP?
    Thanks in advance.

    if the user is invalid.. redirect them to the error page and in the error page pu this javascript... It will refresh the page so the loop will not happen.
    <script language="JavaScript">
    var sec2count = "2"
    var redirectpage = "Login.jsp"
    function countdown() {
    if (sec2count == "0") {
    document.location = redirectpage
    else {
    sec2count = sec2count - 1
    document.form1234.counter.value = sec2count
    setTimeout("countdown()", 1000)
    countdown()
    </script>

  • Books / literature on JSP/servets/beans

    Hi,
    Can some one suggest good books/web sites which talks about using JSP/Servlets/Beans in one application
    Thanks
    Raj

    A good site I can think of is "Theserverside.com".

  • Java, JSP, Servlet....!!!!????Can you help me?

    Hi all,
    Now I want to use Java (JSP, Bean, Servlet and EJB) for programming (application/web/internet/database). Which architects I should use?
    JSP --> Database.
    JSP --> Beans --> Database.
    Servlet --> Database.
    JSP & Servlet --> Database
    JSP & EJB --> Database...
    Can I use COM/DCOM such as ASP pages?
    And which databases (SQL Server, Oracle, Access, DB...) I should use? Which web servers (Jrun, JWS, Apache, JWS, Orion...)?
    Are there some stuff on Internet relate to this topic (some samples)?
    Thanks so much.

    Hi all,
    Now I want to use Java (JSP, Bean, Servlet and EJB)
    for programming (application/web/internet/database).
    Which architects I should use?you can use the Model-View-Controller or MVC model.
    Model = JavaBeans --> for your business logic/process
    View = JSP --> for your presentation like HTML
    Controller = Servlet --> as your router or dispatcher of the JSPs.
    And which databases (SQL Server, Oracle, Access,
    DB...) I should use? for large business applications that would require security, optimization, etc., i suggest that you go for a good dbase and i'm referring to Oracle, SQL Server, Sybase, Informix, and the likes. But, if you're going to do simple application, MS Access can do the job. Since it comes with MS Office installation, you'll not find it any harder to configure your dbase.
    Which web servers (Jrun, JWS, Apache, JWS, Orion...)?you can use the following apache, IIS, Websphere, etc...
    don't forget that you also need an application server. say, tomcat application server and apache web server.

Maybe you are looking for

  • Yoga 2 Pro keyboard light

    Hi, I have a Yoga 2 Pro for just a few days. I noticed that the keyboard light is not workiing properly. Sometimes it lights up, sometimes it does not. Sometimes I can turn it on and off (fn + left space), sometimes I cannot. Once it came on by itsel

  • Acrobat Pro 9 - Disable thumbnail preview in PDF file icons on Desktop

    After upgrading to Acrobat Pro 9, the file icons of PDF files on my Windows 7  desktop changed to showing a thumbnail preview. I want to get the standard PDF file icon back for all PDF files. Can someone please tell me how? Thanks.

  • How can I publish my site on host

    This is my first site , so I do not know how to publish my site on the host. I buy host from IX WEB HOSTING. I use Dreamweaver 8.0 to design my site. Thanks for any help.

  • In Mountain Lion, Safari 6 address bar is blank

    No matter what website im on, the web address bar is blank. Unless I click on it, I cant see the web address. Please help.

  • Workflow Triggering unlimited times

    Hi All, I am having a very WEIRD problem. A workflow starts correctly then it errors, but then the workflow restarts every 30 seconds and keeps going and going and there are 100's of the same instance in SWI1. I have tried deleting all workflows but