Help a new guys with JSP!

Hi,
i'm a new programer with JSP.
I've created a class files that connect a database.
But i would like to know how to write text with JSP?
I would like to write a 'thank you' message after saving a form in a database.
does its possible to have it in my class files?
thanks for your help.

Im not an expert on jsp or java but i will try to give my ideas.. i hope i can help you =)
/* you could actually forward your servlet to your confirmation file like this : */
          ServletContext sc = getServletContext();
.// just fill up here the variable msg , u cud write to its value your thank you message or something else like error messages
          RequestDispatcher rd = sc.getRequestDispatcher("/Confirmation.jsp?msg="+msg);          
          rd.forward(req, res);     
/******* or u cud also throw ur request to the same jsp and display the ***/
/******* message thru a form tag using javascript like this : ***/
suppose your main jsp is this:
<html>
<head>
<STYLE TYPE="text/css">
     .noBorder{
          border: white 0px solid;
          background-color: white;
          font-family:Arial;
          font-size:13px;
          font-weight: bold;
          color:green;
          width:300px;
          text-align:center;
</STYLE>
</head>
<%!
Connection conn;
PreparedStatement pstmt;
private doInsert(String name){
// this is an oracle connection
String sql = "INSERT INTO TABLENAME(FIELD1) VALUES(?)"
try{     
Class.forName("oracle.jdbc.driver.OracleDriver");
// just fill up the dburl , dnusername and dbpassword
conn = DriverManager.getConnection(dburl,dbusername,dbpassword);
pstmt = conn.prepareStatement(sql);
pstmt.clearParameters(); // clear any previous parameter values
pstmt.setString(1,name);
pstmt.close();
}catch(SQLException se){     
}catch(Exception e){          
}finally{
if(conn!=null){
     try{
     conn.close();
     }catch(SQLException se){}
%>
<body>
<form method=post"" name="msgscr">
<tr><td colspan="2"><input type="text" name="msg" value="" class="noBorder" disabled/></td></tr>
</form>
<%
if(request.getParamater("submit")!=null){
// you could also add a return value for doInsert method to check whether the dbase insertion
// is successful or not if the return value is true then the value for the document.msgscr.msg.value
// is thank you otherwise u cud put "Unable to process your request" or other message
doInsert(request.getParameter("name"));
out.println("<script>document.msgscr.msg.value='Thanks you!!!!';</script>")
%>
<!-- this means that the request qill be thrown on this file-->
<form method="post">
<tr>
<td>NAme : </td>
<td><input type="text" name="name" value=""/></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit " value="Submit"></td></tr>
</form>
</body>
</html>     
/**** or you could also do the confirmation message just by adding an **/
/**** alert message using javascript like this: **/
<head>
<script language="javascript">
function ValidateCreate(theform){
     if(theform.name.value==""){
     alert("name is required");
     return false;
     }else{
     alert("Thank you!!!!");
return true;
</script>
</head>
<body>
<form method="post" onsubmit="return ValidateCreate(this)">
<tr>
<td>NAme : </td>
<td><input type="text" name="name" value=""/></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" name="submit " value="Submit"></td></tr>
</form>

Similar Messages

  • Please help the new guy with a picture issue :) Thanks

    Hey guys,
    DrOnePocket here...  I am on my second BB now and love it.  I retired  my curve finally and got a Verizon Tour 9630
    I have some pictures that I have taken with my phone and when I used Media Manager on my desktop to save the pics to a file on my PC, I can't open them.  Windows has no clue what program to use to open them and I did a basic google search and landed here. 
    Example file name
    IMG00016-20100327-1607.jpg
    Both my Desktop Manager and my Media Manager sometimes freeze up Vista as well. 
    Help is appreciated very much!!!

    Don't use Media Manager.
    Transfer the file(s) to your PC per instructions here, using Mass Storage Mode on your BlackBerry.
    1. Go to Options >> Media Card
    (some themes or BlackBerrys may call this "Settings >> Media Card")
    2. Check the following settings (if they are not listed this way, then change to reflect the following:
    a) Media Card Support: On
    b) Mass Storage Mode Support: On
    c) Auto Enable Mass Storage: Yes
    3. Save the settings and exit
    4. Connect your BlackBerry to the PC via a USB cable. Upon connection you may see a Removable Drive appear in your file manager on the PC, or look in My Computer. From there navigate to the newly added Removable drives and explore. Copy the file needed to your PC.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • TS4079 Please help. New iPad with OS 7.0.2 shows no Siri field in Settings General

    New iPad2 with OS 7.0.2 has no Siri. Siri option/field does not appear in Settings>General. Software update shows current. Please advise, thanks.

    Siri is available on the following iOS devices.
    iPhone 4S or later
    iPad 3rd generation or later
    iPad mini
    iPod touch (5th generation)
    http://support.apple.com/kb/HT4992
    Sorry.

  • Please help! New PC with Windows 7, now won't give option for duplex Color Laserjet 2605dn

    Hi everyone,  I'm hoping someone can help.  I have an HP Color Laserjet 2605dn, and after 4 years with a Dell laptop (and Windows XP) I had to get a new computer, this one with Windows 7.  When I plugged in the printer for the first time, it loaded drivers and seemed to work great - EXCEPT there is NO option for duplex printing in the effects or finishing areas.  So I went to the HP website and downloaded the Universal Print Driver, which DOES have duplex, but it won't print to the 2605dn printer!!!
    I am ready to throw this out the window.  I don't recommend buying anything new while you have PMS...hahahaha.  Seriously, if someone could help, my stress level would drop dramatically.  I print a lot, and not doing it duplex would waste so much paper!
    Thanks in advance.

    Enable the duplexer as described in the Vista / Windows 7 Duplex Troubleshooting Guide as follows:  go to Start, Devices and Printers, right click on the printer, Printer properties, Device settings, Installable Options, set the "Duplex unit for 2-sided printing" to installed, OK.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Help syncing new iPad with Outlook 2007 on my PC and Blackberry Tour 9630

    I have searched for answers and am stumped and frustrated...
    I bought an iPad (am trying to become I-friendly) and thought it would be convenient to be able to sync my “stuff” (Contacts, Calendar and notes) to the iPad so we’ll have access to it while traveling.  I use a Blackberry Tour 9630 and a PC with Outlook 2007.  I have synced them effortlessly for years using Desktop manager.  I make changes to my ‘stuff’ on both phone and PC and when I sync - the most current ‘stuff’ gets placed on both.  Voila!  Not anymore.
    When I set up my iPad to work with iCloud things got screwy.  A LOT of my contacts just disappeared - mainly the ones I use frequently.  Now my Outlook 2007 calendar has three calendars on the screen:
    Calendar in iCloud - pink
    Calendar Merge Conflicts in iCloud - green in a tab behind the pink calendar
    Calendar - blue
    I use a cox email account and my blackberry gives me the choice when deleting an email whether to delete on the device or on the server.  I use that feature a lot when we are traveling for a few weeks.  It is nice to come home with no redundant emails on my PC.
    1-How do I combine all the calendars so I have the same thing on each device, Hoping to stay updated on each when I make changes
    2-Can the iPad email give me the option to delete from the server when viewing an email on a cox.net account?
    I am not an expert but fairly tech savvy and usually can get these things done. I need help!  I appreciate any thoughts or suggestions - Thanks in advance

    Make sure all content is transferred and device is backed up before you update.
    Transfer purchases
    http://support.apple.com/kb/HT1848
    How to backup
    http://support.apple.com/kb/HT1766

  • Please Help The New Guy

    Hey Guys,
    I got my MacBook 2012 13inch for my birthday a couple days ago,
    i went to redeem a voucher in the Mac App Store and it asked me to provide my password for my apple account so i put it in and it said "ConnectionManager::invoke::Failed to find service connection url."
    i wonder if anybody else has encounted this problem and has found a good troubleshoot,
    ive been on chat to the support staff for the past 45 mins and nothing they said has worked.
    please help guys...
    many thanks

    Hey Guys,
    I got my MacBook 2012 13inch for my birthday a couple days ago,
    i went to redeem a voucher in the Mac App Store and it asked me to provide my password for my apple account so i put it in and it said "ConnectionManager::invoke::Failed to find service connection url."
    i wonder if anybody else has encounted this problem and has found a good troubleshoot,
    ive been on chat to the support staff for the past 45 mins and nothing they said has worked.
    please help guys...
    many thanks

  • Need for help in select tag with jsp

    i have a select tag about shoeing countriesin a register form and according to the selection of country i want to shoe the names of its cities .............i guess it has something to so with js and i have a little experience in it
    ..........................................if somebody have the answer i'll b thankfull 4 this

    <%@page import="java.sql.*"%>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>register</title>
         <SCRIPT LANGUAGE="JavaScript">
         function checkForm(form){
                        var len = form.elements.length;
                   for (var i = 0; i < len; i++)
                                       if ((form.elements.value == null || form.elements[i].value == ""))
                                                 alert("Please enter your " + form.elements[i].name + ".");
                                                 form.elements[i].focus();
                                                 return false;
                                       return true;
         </SCRIPT>
         <script>
                   function subForm()
                        frm=document.forms.register;
                        frm.action="register.jsp";
                        frm.submit();
         </script>
    </head>
    <body>     
              <H3>WELCOM IN REGISTER PAGE </H3>
              <table align="center" border="0"width="100%">
                   <form name="register" method="post"action="reg.jsp">
                        <tr>
                             <th>
                             Country
                             </th>
                             <td>     
                             <select name="country" onChange="subForm()" >
                             <option value="-1">choose</option>
                                  <%!private Statement stmt;%>
                                  <%!private ResultSet rs;%>
                                  <%!private String h;%>
                                  <%!private int s;
                             private int s2;
                                  private String b;%>
                                  <%
                                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                  Connection conn = DriverManager.getConnection("jdbc:odbc:data", "", "");
                                  stmt=conn.createStatement();%>
                                  <%
                             b= request.getParameter("country");
                             rs = stmt.executeQuery(" select* FROM Country");
                             Integer int3=java.lang.Integer.valueOf(b).intValue();
                             s2=int3;
                             if(s2!=-1)
                                  while(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>">
                             <%=rs.getString("Country_name")%>
    </option>
                                  <% }     %>
                                       <%
         h=request.getParameter("country");
    Integer int1=java.lang.Integer.valueOf(h).intValue();
    s=int1;
    }else{
                             rs = stmt.executeQuery(" select* FROM Country where country_id='"+s2+"'");
                        if(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>">
                             <%=rs.getString("Country_name")%>
    </option>
                                  <% }     %>
                                  <% }     %>
                                       </select>     
                             </td>
                   </tr>
                   <tr>
                             <th>
                                  City
                                  <br>
                             </th>
                             <td>
                             <select name="city">
                                  <option value="-1">choose</option>
    <%
                                  rs = stmt.executeQuery(" select* FROM City where Country_id='"+s+"'");
                                  while(rs.next())
                                  %>
                             <option value="<%=rs.getInt(1)%>"><%=rs.getString("City_name")%></option>)
                             <%
                             out.println(request.getParameter("City"));
                             %>
                             </select>     
                             </td>
                             </tr>
                             <tr>
                                  <th>First Name</th>
                                  <td><input type="text"name="firstName" size="30"></td>
                        </tr>
                             <tr>
                                  <th>Last Name</th>
                                  <td> <input type="text"name="lastName" size="30"></td>
                             </tr>
                             <tr>
                                  <th> Email </th>
                                  <td><input type="text"name="email" size="30"></td>
                             </tr>
                             <tr>
                                  <th> UserName </th>
                                  <td><input type="text"name="userName" size="30"></td>
                             </tr>
                             <tr>
                                  <th> Password </th>
                                  <td> <input type="Password"name="password" size="30"></td>
                             </tr>
                             <tr>
                                  <th><input type="submit" VALUE="Submit Data" onClick="return checkForm(this.form);"></th>
                                  <th></th>
                             </tr>
                             <tr>
                                  <th><input type="reset" VALUE="Reset Form"></th>
                                  <th></th>
                             </tr>           
                             </table>
                   </form>
    </body>
    </html>

  • Help a Poor Guy with a Broken Keyboard

    Hi Everyone!
    I was wondering if someone could help with a workaround for a problem I have: Certain keys on my netbook keyboard stop working, seemingly at random (if anyone knows why this could be, I'm all ears).
    I'm trying to use fluxbox keys to use a shortcut to send a keystroke, for example 'Control' and '3' to send 'e' or 'Control' and 'd' to send 'c'.
    Is there a command/package that can do this?
    I did google for a while but I don't really know what to search for.
    -Coire

    Hi,
    I don't use fluxbox and I don't know if it determines something.
    But you can use xmodmap to remap keys and combinations.
    With xev you can press the keys and know the keycode to use for xmodmap
    E.g.
    xmodmap -e 'keycode 56 = Control_L'
    xmodmap -e 'keycode 64 = AudioUp'

  • Help needed - New PC with all Songs and library on External Hard Drive

    I hope someone can help me - I have just bought a new PC and have downloaded iTunes. All my songs are on an external hard drive, which I know how to get them on to iTunes - but I want to keep the playcounts and playlists that are also stored on the HD - I have tried looking for the answer to this, but cannot seem to find it anywhere. Thanks to anyone who can help.

    Use these instructions to open the library from its location on the external hard drive...
    How to open an alternate iTunes Library file or create a new one
    http://docs.info.apple.com/article.html?artnum=304447
    This assumes that everything needed for an iTunes library is on the external hard drive which includes the data base files that contain the info you are concerned about (playlists, counts, ratings, etc.).
    Patrick

  • Hi guys n girls. How do you copy a whole table to create a new table with all cell sizes in tact? Thanks for your help. Jason.

    Hi guys n girls. How do you copy a whole table to create a new table with all cell sizes in tact? Thanks for your help. Jason.
    when you copy n paste into a new table, all the cell sizes are changed.
    is there a way to put in a new table from your templates into an existing file, different to the standard very basic ones in insert table.
    I look forward to your answers.  Your help is very much appreciated.
    Also how do you search for question answers already written in this support area please.

    Hi Jason,
    In Numbers 3, you can select a whole table by clicking once in the table to make it active, then click once on the "bull's eye" at the top left.
    Now copy and paste. All formatting (and any cell content) is pasted intact. In Numbers 2.3 (Numbers '09) it is a little different for selecting a whole table. But I won't go into that unless you are using Numbers '09. Please reply.
    I don't like the look of the tables in Insert Table. I keep custom tables in My Templates. I have set Numbers > Preferences > General > For New Documents > Use template: (name of my favourite custom template)
    That opens when I launch Numbers, or ask for a new document (command n). Note that if you follow this preference setting, then Menu > File > New From Template Chooser (for another template) requires you to hold down the option key in that menu.
    Regards,
    Ian.
    Message was edited by: Yellowbox. All formatting (and any cell content) is pasted intact.

  • Whenever i connect my ipod touch to my new pc with windows 8, all i can see in my computer is the internal storage or dcim( pictures). can anyone please help me figure out how i can locate or view my music folder?

    Hi guys ,
    I am very troubled with my ipod touch because I don't see my ipod folder showing up on my computer. i have tried all possible ways to make it viewable but somehow i end up seeing only my internal storage (dcim/pictures). Its really frustrating because bought a new laptop with windows 8 and installed a new itunes but only to find out that i cant transfer my songs right away.... I can connect my ipod touch to the itunes swiftly but to transfer my songs from my ipod to my computer is such a hassle. so please if anyone could help me figure this out... I cant buy an iphone unless i fix my problem with my ipod.....
    pls pls pls pls help me

    You need a third-party program. The following includes listing such programs. It also included instructions form making this computer your syncing computer
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Generaating new doc file with jsp servlet.

    Hi friends,
    I developed an application with JSP
    In that i need a data to be fetched nd write in .doc file.
    I mean I want to create new word file nd get my data in that
    like reports generation.
    How can i make this.
    help me pls

    .doc file: I don't think there is any reporting tool that creates .doc. You can create .rtf files with Oracle Reports and many other tools.

  • Best way to create, modify, XML with JSP ?  HELP

    Hi friends,
    As i am new to XML,
    I know there are two APIs used for XML processing, i want to know as a begineer level, which API
    is easy and good to implement XML with JSP.
    1) SAX
    2) DOM
    i want to make a log file in XML, so on web page it will be displayed on HTML form through XSL.
    Since there is good tutorial on http://www.w3schools.com/dom
    but i think its HTML dom
    I want XML procession through JAVA CODE , what should i use ? and give some good tutorials on XML DOM
    that is used with JAVA / JSP.
    HELP.
    Edited by: Ghanshyam on Sep 19, 2007 3:24 PM

    Well what i think is you gonna checkout with your requirements before implementing any of the popular XML parsing mechnisms.
    If you are intrested in faster processing @sacrifising a gud amount of your Memory,DOM is the one which you are looking for.
    If you are instrested in Managing your memory and but if you are ok with sacrifising speed SAX is the best solution.it works on what is called a push technology.
    and if you think either way you might have to look towards a pull parser which is StAX (Streaming API for XML Parsing)
    it'd be a gr8 idea if you can go through the below article which explians about each of the parsing mechanisms
    http://www.stylusstudio.com/xml/parser.html#*
    coming back to helpful resources as far java is concern checkout the below link which might be of some help.
    and the main thing is that all of these parser there is a defined specification you might find implementations of different vendors on this.
    eg:Sun Provides one with JDK itself,same as IBM provides one,oracle does the same & so on...
    your first task would be to focus on one such implementation which can cater your requirements.
    DOM:*
    Basic Parsing Objects / Interfaces Involved while DOM parsing:
    http://www.w3.org/TR/DOM-Level-2-Core/java-binding.html
    Breif Overview & few important API details:
    http://www.developerlife.com/domintro/default.htm
    Simple Example:
    http://www.brics.dk/~amoeller/XML/programming/domexample.html
    Others:
    http://www.roseindia.net/xml/dom/
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM.html#wp79994
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/1_read.html
    SAX:*
    http://www.javacommerce.com/displaypage.jsp?name=saxparser1.sql&id=18232
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/index.htm
    http://java.sun.com/developer/Books/xmljava/ch03.pdf
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPSAX.html#wp69937
    http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=6
    StAX:*
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP2.html
    http://javaboutique.internet.com/tutorials/stax/
    http://today.java.net/pub/a/today/2006/07/20/introduction-to-stax.html
    Hope this might be of some help :)
    REGARDS,
    RaHuL
    http://weblogs.java.net/blog/spericas/archive/2006/04/sun_stax_parser.html

  • Need serious help with JSP + JDBC/Database connection

    Hey all,
    I have to build an assignment using JSP pages. I am still pretty new and only learning through trial and error. I understand a bit now, and I have managed to get a bit done for it.
    I am having the most trouble with a Login Screen. The requirements are that the a form in a webpage has Username/Number and Password, the user clicks Login, and thats about it. The values for the username/number and password NEED to come from the database and I cannot manage to do this. The thing I have done is basically hardcode the values into the SQL statement in the .jsp file. This works, but only for that one user.
    I need it so it checks the username/number and password entered by the user, checks the database to see if they are in it, and if so, give access. I seriously am stuck and have no idea on what to do.
    I dont even know if I have made these JSP pages correct for starters, I can send them out if someone is willing to look/help.
    I have setup 3 other forms required for the assignment and they are reading data from the db and displaying within tables, I need to do this with non-hardcoded values aswell. Im pretty sure I need to use for example 'SELECT .... FROM .... WHERE username= +usrnm' (a variable instead of username="john" , this is hardcoded), I just CANNOT figure out how to go about it.
    Its hard to explain through here so I hope I gave enough info. A friend of mine gave some psuedocode i should use to make it, it seems ok to follow, its just I do not know enough to do it. He suggested:
    get the username and pass from the env vars
    open the db
    make an sql (eg SELECT user, pass FROM users WHERE user = envuser)
    index.jsp points to login.jsp
    login.jsp get the vars you put into index.jsp
    opened the db
    is the query returns nothing - then the user is wrong
    OR if the passwords dont match
    - redirect back to index.jsp
    if it does match
    - set up a session
    - redirect to mainmenu.jsp
    Anyway, thanks for any help you can give.
    -Aaron

    Hi,
    Try this... it may help you...
    mainMenu.jsp
    <html>
    <body>
    <form method="POST" action="login.jsp">
    Username: <input type="text" name="cust_no">
    <p>
    Password: <input type="password" name="password">
    <p>
    <input type="submit" value="LOGIN">
    </form>
    </body>
    </html>
    login.jsp
    <%@ page import="java.io.*, java.sql.*"%>
    <html>
    <body>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection("jdbc:odbc:rocky");
    Statement statement = connection.createStatement();
    String query = "SELECT cust_no, password FROM customers WHERE cust_no='";
    query += request.getParameter("cust_no") + "' AND password='";
    query += request.getParameter("password") + "';";
    ResultSet resSum = statement.executeQuery(query);
    if (request.getParameter("cust_no").equalsIgnoreCase(resSum.getString("cust_no") && request.getParameter("password").equalsIgnoreCase(resSum.getString("password"))
    %>
    <h2>You are logged in!</h2>
    <%
    else
    %>
    <h2>You better check your username and password!</h2>
    <%
    }catch (ClassNotFoundException cnfe){
    System.err.println(cnfe);
    }catch (SQLException ex ){
    System.err.println( ex);
    }catch (Exception er){
    er.printStackTrace();
    %>
    </body>
    </html>
    I didn't check the code that I wrote. So you may have to fix some part of it. Also this may not be the best solution, but it will help you to understand the process easily.
    The more efficient method is to check whether the result set returned from the database is null or not.... I hope you got the idea... Good luck!
    Rajesh

  • Help with jsp beans

    Hi ,
    I'm new to beans .Please help me on this. I have 2 jsp pages -trial.jsp and trial2.jsp and a bean class-UserInfo.java
    I'm setting the bean values from trial.jsp and trying to retrieve from trial2.jsp. But the values are coming as null. Can you please help me on this.
    Code of Trial.jsp
    <html>
    <body>
    <form name="beanTest" method="get" action="trial2.jsp">
    <table width="60%">
      <tr>
        <td width="44%">Name</td>
        <td width="56%"><label>
          <input type="text" name="name" id="name">
        </label></td>
      </tr>
      <tr>
        <td>Age</td>
        <td><input type="text" name="age" id="age"></td>
      </tr>
      <tr>
        <td>Occupation</td>
        <td><input type="text" name="occupation" id="occupation"></td>
      </tr>
      <tr>
        <td><label>                
        <jsp:useBean id="person" class="javaUtil.UserInfo" scope="request"/>
    <jsp:setProperty property="*" name="person"/>
    <input type="submit" value="Test the Bean">
    </form>
    </body>
    </html>
    Trial2.jsp
    <form>
    <jsp:useBean id="person" class="javaUtil.UserInfo" scope="request"/>
    Name<jsp:getProperty property="name" name="person"/><br>
    age:<jsp:getProperty property="age" name="person"/><br>
    job:<jsp:getProperty property="occupation" name="person"/><br>
    </form>
    UserInfo.java
    package javaUtil;
    import java.io.Serializable;
    public class UserInfo implements Serializable{
         private static final long serialVersionUID = 1L;
         private String name;
         private int age;
         private String occupation;
         public String getName()
              return this.name;
         public void setName(String name)
              this.name=name;
         public int getAge()
              return this.age;
         public void setAge(int age)
              this.age=age;
         public String getOccupation()
              return this.occupation;
         public void setOccupation(String occupation)
              this.occupation=occupation;
    Please help me.....

    Actually you're probably off on a false trail with jsp:useBean. The more up to date methods use tag libraries (typically JSTL) and access bean attributes using EL, bean expression language. E.g. you put your initial form data into a request attribute called "data" and you put:
    <input type="text" name="property1" value="${data.property1}" ....useBean is no use for binding returned fields from a form. Always remember that your JSP generates HTML and once that HTML is sent to the browser that's it, the JSP has done it's job and finished. Only with JSF, at present, does what you write in your JSP affect the processing of received form data. When you get the form data back you need to "bind" the values from the request back to the bean. A framework like Spring will do this stuff for you, but in a raw Servlet/JSP environment it's up to you.

Maybe you are looking for