Using Oracle Update in a JSP page

Hi,
I am working on a web application that allows the user to select data that is pulled from an Oracle table into a JSP page. I want to allow the user to make changes to the table inside the browser and have those change write back to the Oracle table.
Any sample code, resources, direction, etc. would be very helpful.

http://www.sitepoint.com/article/java-6-steps-mvc-web-apps

Similar Messages

  • Using Update in a JSP page

    Hi,
    I am working on a web application that allows the user to select data that is pulled from an Oracle table into a JSP page. I want to allow the user to make changes to the table inside the browser and have those change write back to the Oracle table.
    Any sample code, resources, direction, etc. would be very helpful.

    did you get an answer to this..

  • How to use ShowValue within a UIX/JSP page to display an active link?

    I am storing URL's in the DB and want to display them as active links on a UIX/JSP page. I thought that I had this working some time ago, but now it no longer works.
    Using <bc4juix:RenderValue datasource="ds1" dataitem="myTextField" /> will display "http://www.otn.oracle.com" as an inactive link using UIX/XML which is expected.
    Using <jbo:ShowValue datasource="ds1" dataitem="myTextField" /> will display an active link using if using BC4J/JSP, which is expected.
    However, I have not been able to do this using a UIX/JSP page.
    Is it possible to use ShowValue within a UIX/JSP page to display an active link?
    Thanks,
    Bill G

    Hi Juan,
    I've done the following and it does not work for me;
    --- snip ---
    <uix:form name="form1" method="GET">
    <bc4juix:Table datasource="ds1" >
    <uix:columnHeaderStamp>
    <uix:styledText textBinding="LABEL"/>
    </uix:columnHeaderStamp>
    <%--
    <jbo:AttributeIterate id="dsAttributes" datasource="ds1" hideattributes="UixShowHide">
    <bc4juix:RenderValue datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
    </jbo:AttributeIterate>
    --%>
    <bc4juix:RenderValue datasource="ds1" dataitem="FacilityDesc" />
    <bc4juix:RenderValue datasource="ds1" dataitem="LocationId" />
    <bc4juix:RenderValue datasource="ds1" dataitem="LocationDesc" />
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <uix:rawText>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    </uix:rawText>
    <%-- ** THE FOLLOWING DOES NOT DISPLAY ON THE BROWSE_EDIT_PAGE ** --%>
    <uix:contents>
    <uix:rawText>
    <jbo:ShowValue datasource="ds1" dataitem="Notes" ></jbo:ShowValue>
    </uix:rawText>
    </uix:contents>
    --- snip ---
    Bill G...

  • Can I Use Swing Components in a JSP Page

    Hi,
    Can I use Swing Componnents in a JSP Page.If so,Can anybody provide with a sample code.
    Thanks.

    hi,
    I wanted to use the JTabbedPane for tab buttons in my
    Jsp Page.Is that possible?I am afraid that you can't.
    As for GUI (graphics) in the HTML page you can use only the html form elements (but you should simulate other behaviours by dynamically reloading the page).-
    Ionel.

  • Using Java Objects in my JSP page... objects are in a different directory

    Hi,
    I would like to call and use an object from a JSP page. The java object is in one directory, the jsp is in another. When I call my object, I get a JSP error that says it can't find the object and lists the directory name as part of the file.
    For example, here are my two files:
    /java/MyObject.class
    /web/page.jsp
    When I make the call to new MyObject(), I get an error message saying _web.MyObject cannot be found.  Any ideas on this?
    Thanks!

    Okay, I figured it out. In case anyone else needs it, here is what I needed to do.
    1) I created my object in a package. The JSP page was looking for the object in _dir directory because a package wasn't specified.  I created a subdirectory in one of the directories in my classpath and named it the same thing that the package was named.
    2) Import the package
    3) Make sure all methods in the classes are public, since only public methods can be accessed from outside the package.
    Thanks for the help, it got me going in the right direction.

  • Problem for getting the real path using one servlet and one jsp page

    I have one tomcat machine and several virtual domains. Eahc virtual domain has one realpath in the disc.
    I am using one servlet and one jsp page for using this servlet.
    my purpose is to load, using the servlet , the real path for the domains (eahc domain has its path).
    for this i make this:
    the servlet code is this:
    package utils.ticker;
    import java.io.*;
    import java.io.File;
    import java.io.IOException;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    public class Edicion extends HttpServlet{
    public Edicion() {
    public String cc(){
    ServletContext myContext= getServletContext();
    String abspath = myContext.getRealPath("/");
    //here i want to return the real path
    return abspath;
    public static void main(String args[]){
    and the jsp page is:
    <%@ page import="utils.ticker.*" %>
    <jsp:useBean id="tick" class="utils.ticker.Edicion" scope="session"/>
    <html><head><body>
    <%
    tick.cc();
    %>
    </body></head></html>
    But this produces one error, NullPointerException and dont shows me the real path.
    Can anyone help me?
    thanks

    i have put this into one sevlet:
    package utils.ticker;
    import javax.servlet.ServletContext;
    public class Edicion{
    private ServletContext myContext;
    public Edicion(ServletContext myContext) {
    this.myContext = myContext;
    public String getCC(){
    return myContext.getRealPath("/");
    and in the jsp page this:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*"%>
    <%@ page import="utils.ticker.*" %>
    <jsp:useBean id="tick" class="utils.ticker.Edicion" scope="session"/>
    <html><head><body>
    <%=tick.getCC()%>
    </body></head></html>
    but appear this error in the tomcat.
    Can you, please, help me. i am trying to solve this during one week and i am desesperate.
    Thanks.
    ERROR:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: class utils.ticker.Edicion : java.lang.InstantiationException: utils.ticker.Edicion
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         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.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         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:170)
         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:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    javax.servlet.ServletException: class utils.ticker.Edicion : java.lang.InstantiationException: utils.ticker.Edicion
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
         at org.apache.jsp.pruebas_jsp._jspService(pruebas_jsp.java:72)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         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.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         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:170)
         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:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.18

  • Help! Using "Create" action in insert jsp page vs in submission page.

    This is regarding creating a new record using data TAGS:
    I'm in a dilemma as to whether I should use the data source tag <jbo:Row id="myrow" datasource="iss_vo1" action="Create">
    in my first jsp page ( which accepts input from a user) or in the 2nd jsp page (which does the actual commit).
    If I actually create the view record n the first page itself then I get into all kinds of problems if the user decides against saving the record and backs out.[because there is a null hanging record out there]
    But if I don't use it, then I am unable to use my LOVs in the html form.
    Can anyone help me resolve this issue?
    Currently I have used the data source tag
    <jbo:Row id="myrow" datasource="iss_vo1" action="Create">
    in my first JSP page.
    Below is my complete source code for both the JSP pages:
    Source Code for iss_add.jsp:
    ======================
    Please note that in this JSP , it creates a new record and then the user has to click on the "SAVE" button (which calls another jsp "iss_add_post.jsp") to save the changes. But what if the user does not click on the save BUTTON and instead click on the "back" tab. This is where all the problem occurs. How do I get rid of this problem?
    If I try to just use an HTML form without creating a record in this page then how will I use the LOVs?
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <HTML>
    <base target="contentsframe">
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    </TITLE>
    </HEAD>
    <BODY>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" />
    <jbo:DataSource id="pri_vo" appid="NewBC4J.NewBC4JModule" viewobject="PrioritiesView" />
    <jbo:DataSource id="app_vo" appid="NewBC4J.NewBC4JModule" viewobject="ApplicationsView" />
    <jbo:DataSource id="per_vo" appid="NewBC4J.NewBC4JModule" viewobject="PersonView" >
    <jbo:DataSource id="iss_vo1" appid="NewBC4J.NewBC4JModule" viewobject="IssuesView5" /></jbo:DataSource>
    <jbo:Row id="myrow" datasource="iss_vo1" action="Create">
    </jbo:Row>
    <table width="100%" bgcolor="skyblue" border="0" align="center">
    <tr>
    <td>
    <table width="100%" bgcolor="tan" border="0" align="center" cellpadding="3" cellspacing="0">
    <form NAME="iForm" action="iss_add_post.jsp">
    <tr>
    <th colspan="2">
    "Add New Issues"
    </th>
    </tr>
    <jsp:include page="Message.jsp" flush="true">
    <jsp:param name="colspan" value="2"/>
    </jsp:include>
    <tr>
    <td align="Right"><b><font color="red">Priority:</font></b></td>
    <td> <jbo:InputSelect datasource="iss_vo1" dataitem="PriCd"
    displaydatasource="pri_vo" displaydataitem="Descr" displayvaluedataitem="Cd" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Description:</font></b></td>
    <td> <jbo:InputTextArea datasource="iss_vo1" dataitem="IssDesc" rows="3" cols="50" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Application:</font></b></td>
    <td> <jbo:InputSelect datasource="iss_vo1" dataitem="AppCode"
    displaydatasource="app_vo" displaydataitem="Name" displayvaluedataitem="Code" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Assigned To: </font></b></td>
    <td> <jbo:InputSelect datasource="iss_vo1" dataitem="AssignedToPerId"
    displaydatasource="per_vo" displaydataitem="FirstName" displayvaluedataitem="PerId" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><font color="red"> Raised By: </font></b></td>
    <td> <jbo:InputSelect dataso urce="iss_vo1" dataitem="RaisedByPerId"
    displaydatasource="per_vo" displaydataitem="FirstName" displayvaluedataitem="PerId" />
    </td>
    </tr>
    <tr>
    <td align="Right"><b><font color="red"> Resolution: </font></b></td>
    <td> <jbo:InputTextArea datasource="iss_vo1" dataitem="Resolution" cols="50" rows="3" />
    </td>
    </tr>
    </table>
    <!-- Create a table for the save Button -->
    <table width="100%" bgcolor="skyblue" align="center" cellpadding="10" cellspacing="0" >
    <tr>
    <input name="RowKeyValue" type="hidden" value="<jbo:ShowValue datasource="iss_vo1" dataitem="RowKey"/>" />
    <td>
    <input type = "submit" name="submit" value="Save">
    </td>
    </form>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources releasemode="Stateful" />
    Source Code for iss_add_post.jsp:
    ============================
    This is where the actual commit occurs. But user may decide not to come here at all by not clicking the save button. What happens to the record created ? How Can I rollback that information?
    <%@ page language="java" contentType="text/html;charset=WINDOWS-1252" %>
    <html xmlns:jbo="foo">
    <body>
    <center>
    <br>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <br>
    <jbo:ApplicationModule id="NewBC4J.NewBC4JModule" configname="NewBC4J.NewBC4JModule.NewBC4JModuleLocal" username="issue" password="issue"/>
    <br>
    <jbo:DataSource id="iss_vo1" appid="NewBC4J.NewBC4JModule" viewobject="IssuesView5"/>
    <jbo:Row id="row3" datasource="iss_vo1" action="Current" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <%
    try
    %>
    <jbo:Commit appid="NewBC4J.NewBC4JModule"/>
    <p><font face="Arial, Helvetica, sans-serif"><b><font color="006699">Issue Record Inserted Successfully! Issue# Assigned: <jbo:ShowValue datasource="iss_vo1" dataitem="Id" /></b></font></font> </p>
    <%
    catch(Exception exc)
    out.println("<pre>");
    exc.printStackTrace(new java.io.PrintWriter(out));
    out.println("</pre>");
    %>
    <br>
    <br>
    <form action="iss_ListIssues.jsp" method="post"><input type="submit" value="Click to Continue"></form>
    </center>
    </body>
    <jbo:ReleasePageResources releasemode="Stateful"/>
    </html>
    null

    [email protected]
    I can't actually see any LOV's on your first page so I am not completely sure that I understand your situation. However if you are talking about using the InputSelectLOV datatag, there is no reason why you cannot use that within a html form, without having to create a record in the RowSet.
    The Insert page is by default created without any datasources - just a standard HTML form. The form is submitted and the InsertSubmit page reads the values from the request object, matches the parameter names with your VO attribute names and does your create.
    Your LOV data will be coming from another table so doing a Row tag Create on your Insert page won't make any difference to it. Have I misunderstood something here? I have used LOV's on my Insert pages and I definitely have not created a row in the Rowset anywhere but the Submit pages.
    There is a problem on both Edit and Insert pages whereby if there are no rows in the table for which you have a datasource defined you can get problems, but it doesn't sound as though that is your problem. Maybe I need some more information from you?
    Simon

  • Using an Array in a JSP page

    I am currently storing values from a database into an array
    im my servlet. I have a JSP page and I'm trying to set
    the datafields on this page to the values held in the array.
    I need to send the array from the servlet to the JSP page
    and then figure out how I retrieve it at the other end.
    Can anyone help????????

    Here's the code I'm using for my Sevlet:
    package SASSSpkg;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.sql.*;
    import javax.swing.*;
    public class UserLogin extends HttpServlet{
         private Connection connection;
    private ResultSet resultSet;
         private Statement statement;
         public String getusername, getpassword, getdatabase;
         private String customerId;     
         private String title;
         private String firstName;
         private String secondName;
         private String surname;
         private String residentialAddress;
         private String dateOfBirth;
         private String correspondenceName;
         private String maritalStatus;
         private String gender;
         private String securityId;
         private String postCode;
         private String dateOfFirstContact;
         private String homeTel;
         private String businessTel;
         private String currentAddressEntryDate;
         private String nationalInsuranceNumber;
         private String dateLastUpdated;
         public ArrayList values = new ArrayList();
         public void init(ServletConfig config) throws ServletException
              super.init(config);
         public UserLogin()
         public void ConnectToDatabase() throws Exception
    String url = "jdbc:odbc:SASSS";
    String username = getusername;
    String password = getpassword;
    // Load the driver to allow connection to the database
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection( url, username,
    password);
    catch (ClassNotFoundException cnfex)
    throw new Exception("cannot connect to database");
    catch (SQLException sqlex)
    throw new Exception("cannot connect to database");
    public void getResultSetData()
    try
    String query = "SELECT DISTINCT CUSTOMER_ID, TITLE, FORENAME1, FORENAME2, SURNAME, DATE_OF_BIRTH, CUSTOMER_SALUTATN, MARITAL_STATUS, GENDER, SECURITY_NAME, FIRST_CONTACT_DATE,POSTCODE, TELEX, DATE_AT_ADDRESS, NATIONAL_INS_NUM, ADDRESS.LAST_UPDATED, ADDRESS.TELEPHONE FROM CUSTOMER, ADDRESS, CUSTOMER_ADDRESS WHERE CUSTOMER.CUSTOMER_CODE = CUSTOMER_ADDRESS.CUSTOMER_CODE AND CUSTOMER_ADDRESS.ADDRESS_ID = ADDRESS.ADDRESS_ID";
    statement = connection.createStatement
    (ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);                
    resultSet = statement.executeQuery(query);
    resultSet.first();
         for (int i = 0; i <= 16; i ++)
              values.add(resultSet.getString(i + 1));
              statement.close();          
    catch(SQLException sqlex)
    sqlex.printStackTrace();
         public void doPost(HttpServletRequest req, HttpServletResponse
    res)
              throws ServletException, IOException
         try{
                   boolean dbConnection;
                   // Get username and password from fields on web
    page
                   getusername = req.getParameter("UserName");
                   getpassword = req.getParameter("Password");
                   getdatabase = req.getParameter("Database");
                   PrintWriter output = res.getWriter();
                   res.setContentType("text/html");
                   if(getusername.equals("") || getpassword.equals
                   res.sendRedirect
    ("http://localhost:9080/SASSS/ErrorPage.jsp");
                   return;
                   else
                        ConnectToDatabase();
                        getResultSetData();
                        res.sendRedirect
    ("http://localhost:9080/SASSS/EmployeeDetails.jsp");
              catch(Exception ex) {
                   res.sendRedirect
    ("http://localhost:9080/SASSS/ErrorPage.jsp");          
         public void doGet(HttpServletRequest req, HttpServletResponse
    resp)
              throws ServletException, IOException
              req.setAttribute("myArrayList", values);
         public String getCustomerId()
              return customerId;
         public void setCustomerId(String Id)
              customerId = Id;
         public String getTitle()
              return title;
         public void setTitle(String theTitle)
              title = theTitle;;
         public String getFirstName()
              return firstName;
         public void setFirstName(String theFirstName)
              firstName = theFirstName;
         public String getSecondName()
              return secondName;
         public void setSecondName(String theSecondName)
              secondName = theSecondName;
         public String getSurname()
              return surname;
         public void setSurname(String theSurname)
              surname = theSurname;
         public String getResidentialAddress()
              return residentialAddress;
         public void setResidentialAddress(String theResidentialAddress)
              residentialAddress = theResidentialAddress;
         public String getDob()
              return dateOfBirth;
         public void setDob(String theDOB)
              dateOfBirth = theDOB;
         public String getCorrespondenceName()
              return correspondenceName;
         public void setCorrespondenceName(String theCorrespondenceName)
              correspondenceName = theCorrespondenceName;
         public String getMaritalStatus()
              return maritalStatus;
         public void setMaritalStatus(String theMaritalStatus)
              maritalStatus = theMaritalStatus;
         public String getGender()
              return gender;
         public void setGender(String theGender)
              gender = theGender;
         public String getSecurityId()
              return securityId;
         public void setSecurityId(String theSecurityId)
              securityId = theSecurityId;
         public String getPostCode()
              return postCode;
         public void setPostCode(String thePostCode)
              postCode = thePostCode;
         public String getDateOfFirstContact()
              return dateOfFirstContact;
         public void setDateOfFirstContact(String theDateOfFirstContact)
              dateOfFirstContact = theDateOfFirstContact;
         public String getHomeTel()
              return homeTel;
         public void setHomeTel(String theHomeTel)
              homeTel = theHomeTel;
         public String getBusinessTel()
              return businessTel;
         public void setBusinessTel(String theBusinessTel)
              businessTel = theBusinessTel;
         public String getCurrentAddressEntryDate()
              return currentAddressEntryDate;
         public void setCurrentAddressEntryDate(String
    theCurrentAddressEntryDate)
              currentAddressEntryDate = theCurrentAddressEntryDate;
         public String getNationalInsuranceNumber()
              return nationalInsuranceNumber;
         public void setNationalInsuranceNumber(String
    theNationalInsuranceNumber)
              nationalInsuranceNumber = theNationalInsuranceNumber;
         public String getDateLastUpdated()
              return dateLastUpdated;
         public void setDateLastUpdated(String theDateLastUpdated)
              dateLastUpdated = theDateLastUpdated;
    Here's the code I'm using for my JSP:
    <HEAD><SCRIPT type="text/javascript">
    <!--
    var _sstmrID = null;
    var _sstmrON = false;
    var _sspos   = 80;
    function _ScrollStatus(msg, delay)
    if (_sstmrON)
    window.clearTimeout(_sstmrID);
    _sstmrON = false;
    var statmsg = "";
    if (_sspos >= 0)
    for (s = 0; s < _sspos; s++)
    statmsg += " ";
    statmsg += msg;
    else
    statmsg = msg.substring(-_sspos, msg.length);
    window.status = statmsg;
    sspos = (-sspos > msg.length) ? 80 : _sspos - 1;
    fname = "_ScrollStatus('" + msg + "', " + delay + ")";
    _sstmrID = window.setTimeout(fname, delay);
    _sstmrON = true;
    //-->
    </SCRIPT><SCRIPT type="text/javascript">
    <!--
    function _ShowObj(lId)
    var ob;ob=new Array;
    var appVer=parseInt(navigator.appVersion);
    var isNC=false,isN6=false,isIE=false;
    if (document.all && appVer >= 4) isIE=true; else
    if (document.getElementById && appVer > 4) isN6=true; else
    if (document.layers && appVer >= 4) isNC=true;
    if (isNC)
    w_str = "document." + lId;ob[lId] = eval(w_str);
    if (!ob[lId]) ob[lId] = _FindHiddenObj(document, lId);
    if (ob[lId]) ob[lId].visibility = "show";
    if (isN6)
    ob[lId] = document.getElementById(lId);
    ob[lId].style.visibility = "visible";
    if (isIE)
    w_str = "document.all.item(\"" + lId + "\").style";ob[lId] = eval(w_str);
    ob[lId].visibility = "visible";
    function _FindHiddenObj(doc, lId)
    for (var i=0; i < doc.layers.length; i++)
    var w_str = "doc.layers.document." + lId;
    var obj;obj=new Array;
    obj[lId] = eval(w_str);
    if (!obj[lId]) obj[lId] = _FindHiddenObj(doc.layers[i], lId);
    if (obj[lId]) return obj[lId];
    return null;
    //-->
    </SCRIPT></HEAD>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <html:html>
    <HEAD>
    <%@ page
    language="java"
    contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    errorPage="ErrorPage.jsp"
    %>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <META name="GENERATOR" content="IBM WebSphere Studio">
    <META http-equiv="Content-Style-Type" content="text/css">
    <LINK href="style.css" rel="stylesheet" type="text/css">
    <h2>
    <%@page import="SASSSpkg.UserLogin"%>
    <%@page import="java.util.*"%>
    <%@page import="javax.servlet.*"%>
    <%@page import="javax.servlet.http.*"%>
    <% UserLogin ul = new UserLogin(); %>
    <TITLE>SASSS Employee Details</TITLE>
    </HEAD>
    <BODY bgcolor="#c0c0c0"><FORM action="servlet/SASSSpkg.UserLogin" method="get">
    <%
    if (request.getAttribute("myArrayList") != null) {
    ArrayList Alist = (ArrayList)request.getAttribute("myArrayList");
    ul.setCustomerId(Alist.get(0).toString());
    else {
    response.sendRedirect("http://localhost:9080/SASSS/ErrorPage.jsp");
    %>
    <TABLE border="0" width="792" height="359">
         <TBODY>
              <TR>
                   <TD colspan="6" valign="middle" align="center" height="58"><B>Customer
                   Id</B> <INPUT type="text" name="customerId" size="20" maxlength="10"
                        disabled value='<%= ul.getCustomerId() %>'></TD>
              </TR>
              <TR>
                   <TD align="center" height="57" width="160"><SPAN
                        style="font-weight: bold"><B>Title</B><BR>
                   <SELECT name="title" size="1">
                             <OPTION><%= ul.getTitle()%></OPTION>
                             <OPTION>Mr</OPTION>
                             <OPTION>Mrs</OPTION>
                             <OPTION>Miss</OPTION>          
                   </SELECT></SPAN></TD>
                   <TD align="left" height="57" width="171"><SPAN
                        style="font-weight: bold"><B><STRONG>First Name</STRONG></B><BR>
                   <SCRIPT type="text/javascript">
    <!--
    _ScrollStatus("How cool is this", 2);
    //-->
    </SCRIPT><INPUT type="text" name="firstName" size="20" maxlength="25" value = '<%= ul.getFirstName() %>' ></SPAN></TD>
                   <TD align="left" height="57" colspan="2"><SPAN
                        style="font-weight: bold"><B>Second Name</B><BR>
                   <INPUT type="text" name="secondName" size="20" maxlength="25" value='<%= ul.getSecondName() %>'></SPAN></TD>
                   <TD align="left" height="57" colspan="2"><SPAN
                        style="font-weight: bold">Surname<BR>
                   <INPUT type="text" name="surname" size="20" maxlength="25" value='<%= ul.getSurname() %>'> </SPAN></TD>
              </TR>
              <TR>
                   <TD colspan="2" align="center" rowspan="3"><B>Residential Address</B><BR>
                   <TEXTAREA rows="7" cols="31" name="residentialAddress" ><%= ul.getResidentialAddress() %></TEXTAREA></TD>
                   <TD align="left" height="66" colspan="2"><B>Date of Birth</B><BR>
                   <INPUT type="text" name="dateOfBirth" size="20" maxlength="10" value='<%= ul.getDob() %>'></TD>
                   <TD align="left" colspan="2"><B>Correspondence Name<BR>
                   <INPUT type="text" name="correspondenceName" size="20" maxlength="25" value='<%= ul.getCorrespondenceName() %>'>
                   </B></TD>
              </TR>
              <TR>
                   <TD align="left" height="42" colspan="2"><B>Marital Status </B> <SELECT
                        name="maritalStatus" style="">
                        <OPTION selected><%= ul.getMaritalStatus()%></OPTION>
                        <OPTION>Divorced</OPTION>
                        <OPTION>Married</OPTION>
                        <OPTION>Seperated</OPTION>
                        <OPTION>Single</OPTION>
                        <OPTION>Widowed</OPTION>
                   </SELECT></TD>
                   <TD align="left" colspan="2"><B>Gender</B> <SELECT name="gender">
                        <OPTION><%= ul.getGender()%></OPTION>
                        <OPTION>Female</OPTION>
                        <OPTION>Male</OPTION>
                   </SELECT></TD>
              </TR>
              <TR>
                   <TD colspan="4" height="56"><B>Security
                   Id     </B><INPUT type="text" name="securityId"
                        size="20" maxlength="20" value='<%= ul.getSecurityId() %>'></TD>
              </TR>
              <TR>
                   <TD height="55" align="left" colspan="2" nowrap><B>
                      Post Code   </B> <INPUT type="text"
                        size="15" maxlength="8" value='<%= ul.getPostCode() %>' name="postCode"></TD>
                   <TD height="55" align="left" colspan="2"><B>Date of First Contact</B><BR>
                   <INPUT type="text" name="dateOfFirstContact" size="10" maxlength="10" value='<%= ul.getDateOfFirstContact() %>'>
                   </TD>
                   <TD height="55" rowspan="5" align="center" colspan="2"><SELECT
                        size="9" name="aditionalDetailForms">
                        <OPTION value="">Products Held</OPTION>
                        <OPTION>Employment</OPTION>
                        <OPTION>Dependants</OPTION>
                        <OPTION>Residential Details</OPTION>
                        <OPTION>Assets/Liabilities</OPTION>
                        <OPTION>Income/Commitments</OPTION>
                        <OPTION>Banks/Building Societies</OPTION>
                        <OPTION>Credit Cards</OPTION>
                        <OPTION>Leads and Follow ups</OPTION>
                        <OPTION value=""></OPTION>
                   </SELECT></TD>
              </TR>
              <TR>
                   <TD height="41" align="left" colspan="2" nowrap><B>   Home
                   Tel                         </B>
                   <INPUT type="text" name="homeTel" size="18" maxlength="14" value='<%= ul.getHomeTel() %>'></TD>
                   <TD height="41" align="left" colspan="2"><INPUT type="button"
                        name="lastAddress" value="Last Address"></TD>
              </TR>
              <TR>
                   <TD height="49" align="left" colspan="2" nowrap><B>   Business
                   Tel                  </B>
                   <INPUT type="text" name="businessTel" size="18" maxlength="14" value='<%= ul.getBusinessTel() %>'></TD>
                   <TD height="49" align="left" valign="bottom" colspan="2"><B>N.I.
                   Number</B></TD>
              </TR>
              <TR>
                   <TD height="42" colspan="2" nowrap><B>   Current
                   Address Entry Date  </B> <INPUT
                        type="text" name="currentAddressEntryDate" size="10" maxlength="10" value='<%= ul.getCurrentAddressEntryDate() %>'></TD>
                   <TD height="42" colspan="2"><INPUT type="text"
                        name="nationalInsuranceNumber" size="20" maxlength="9" value='<%= ul.getNationalInsuranceNumber() %>'></TD>
              </TR>
              <TR>
                   <TD height="44" colspan="2" nowrap><B>   Date Last
                   Updated                   </B>
                   <INPUT type="text" name="dateLastUpdated" size="10" maxlength="15" value='<%= ul.getDateLastUpdated() %>'></TD>
                   <TD height="44" align="left" colspan="2"><INPUT type="button"
                        name="directMailExclusions" value="Mail Exclu">    <INPUT
                        type="button" name="telephoneExclusions" value="Tel Exclu"></TD>
              </TR>
              <TR>
                   <TD height="44" align="left" colspan="6" nowrap>        <INPUT
                        type="submit" name="ok" value=" OK ">            <INPUT
                        type="button" name="forward" value=" >> ">            <INPUT
                        type="button" name="exit" value=" Exit ">            <INPUT
                        type="button" name="delete" value=" Delete ">            <INPUT
                        type="reset" name="refresh" value=" Refresh ">            <INPUT
                        type="button" name="help" value=" Help "></TD></TR>
    </TABLE></FORM>
    </BODY>
    </html:html>
    The problem is, I'm trying to store String values into an array,
    or a result set and then store them in the data fields on my jsp page.
    When I use my set method such as setCustomerId(values.get(0));
    it sets the variable customerId to the value I want but when I try to
    call the get method in the JSP page to assign it to the data field it
    will not retrieve it.
    Can anyone solve this, I've been at it for days now????

  • How to use javascript functions in struts jsp page

    hi
    iam using struts jsp pages. here iam calling one javascript function. but iam not able to access the form in javascript.
    wat i have to give as form name to get the elements of the form.
    please reply me soon
    it is urgent
    vamsi

    your form has no name liek this one:
    <html:form action="/userRegistration.do" >so you cannot access the elements inside your form?
    accessing the elements inside the form will be like this:
    document.forms[0].propertyName.value;

  • Using Runtime.Exec() on a JSP page

    I need to run a command on a JSP page. The source code is:
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <%!class StreamGobbler extends Thread
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.type = type;
    public void run()
    try
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null)
    System.out.println(type + ">" + line);
    } catch (IOException ioe)
    ioe.printStackTrace();
    %>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <TITLE>
    Demo
    </TITLE>
    </HEAD>
    <BODY>
    <% try
    String osName = System.getProperty("os.name" );
    String[] cmd = new String[3];
    if( osName.equals( "Windows NT" ) )
    cmd[0] = "cmd.exe" ;
    cmd[1] = "/C" ;
    cmd[2] = "d:/oracle/806/bin/plus80.exe iess/iess@iess1 @ d:/IessADM/webserver/uploads/test.sql";
    else if( osName.equals( "Windows 95" ) )
    cmd[0] = "command.com" ;
    cmd[1] = "/C" ;
    cmd[2] = "d:/oracle/806/bin/plus80.exe iess/iess@iess1 @ d:/IessADM/webserver/uploads/test.sql";
    Runtime rt = Runtime.getRuntime();
    System.out.println("Executing " + cmd[0] + " " + cmd[1]
    + " " + cmd[2]);
    Process proc = rt.exec(cmd);
    // any error message?
    StreamGobbler errorGobbler = new
    StreamGobbler(proc.getErrorStream(), "ERROR");
    // any output?
    StreamGobbler outputGobbler = new
    StreamGobbler(proc.getInputStream(), "OUTPUT");
    // kick them off
    errorGobbler.start();
    outputGobbler.start();
    // any error???
    int exitVal = proc.waitFor();
    out.println("ExitValue: " + exitVal);
    } catch (Throwable t)
    t.printStackTrace();
    %>
    </BODY>
    </HTML>
    This command run a database script, it seems to run but the page doesn't appear, it hangs. Could you tell me what am I doing wrong, please? Do you have any idea?

    Take the relevant code and put it into an application program, and run that application on the same system where the JSP is running, with the same environment (path, classpath, current directory, etc). See what happens.
    By the way, on my system System.getProperty("os.name") returns "Windows 2000", so perhaps your code is not general enough.

  • Using hyper-links in a jsp pages that are in a Session

    Hi i am trying to include a hyper-links in my jsp pages that are in a Session, however when i use the links to navigate throughout the pages i get a java.lang.NullPointerException. The Session begins after the user has been validated i.e
    String cid= request.getParameter("counsellorID")
    session.setAttribute("counsellorID",cid);
    All the pages included within the session have a session scope=session
    ; and they call the attributes that have been set when the session first begins i.e
    String counsID= (String) (session.getAttribute("counsellorID"));
    Any advice on this problem would be most appreciated!
    Many Thanks
    Stephen

    check if you borwser have cookies enabled

  • How can I use java swing class in JSP page design

    I am a new developer in Java server pages. I want to use layout managers available in java swing classes to design the page. Can any body suggest me a way to do this.Is it possible if I do it with servelets.

    So, you want to use layout managers within your JSPs?
    The immediate answer is that "it isn't a good idea". The more considered answer is "tell us what you're up to".
    Are you coding all presentation within a traditional JSP? That is, HTML, customer or library tags and/java scriptlets?
    Or are you building your HTML within your servlets and sending that back to the browser?
    If the first, then you are probably better off either using explicit HTML tables (or the equivalent custom tags) or finding a library that you can use.
    If the second, you can write classes similar to the Swing layout managers that end up being a fancy way of putting elements into an HTML table. We have exactly that in my current environment. I wouldn't recommend rolling your own and I'd tend to leave all that presentation stuff to the JSP.
    In any case, you can't really use the Swing layout managers as they are for an entirely different pradigm.

  • How to use oracle thin driver with jsp?...pls help

    Hello. I am trying to insert a word file into my Oracle 9i database using JSP. I have tomcat running as my standalone server. So far, i have been using the sun.jdbc.odbc driver to implement all my DB accesses. Recently however, i found out that in order to use Oracle specific objects such as BLOBS or BFILES, i have to use the oracle thin driver or OCI driver.
    So far, i have downloaded the thin driver and put it into the tomcat shared/common folder and also put the .jar file into my classpath. Now, i am having trouble as to how to call the oracle thin driver inside my JSP code.
    My previous code read as:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:Andy","user","pass");
    How do i switch over to the oracle thin driver in JSP? Any help would be much appreciated. Thank you
    Andrew

    my code is:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(sConnStr, sUser, sPassword);
    notice the driver --"oracle.jdbc.driver.OracleDriver"!
    and copy the class12.zip to lib path
    if still not work
    change the class12.zip to class12.jar
    good luck

  • Could I use jstl tag in the JSP page of Creator 2 final release?

    I have a JSP page used to work well in Creator 2EA2. The page
    has the following code snippets:
    <c:forEach items="${SessionBean1.webQuery1.details}" var="item">
                                                        <tr>
                                                            <td class="detailKey">
                                                                <c:out value="${item.key}"/>
                                                            </td>
                                                            <td class="detailValue">
                                                                <c:out value="${item.value}"/>
                                                            </td>
                                                        </tr>
                                                    </c:forEach>
    ...Basically, it generates a table columns.
    After migrating to Creator2 final release, a fatal exception is thrown
    when the page is launched :
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: org.apache.jasper.JasperException
      /Page1.jsp(148,132) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
    Possible Source of Error:
       Class Name: org.apache.jasper.compiler.DefaultErrorHandler
       File Name: DefaultErrorHandler.java
       Method Name: jspError
       Line Number: 43
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:43)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:414)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:155)
    org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes Any suggestion, or work around?
    Thanks

    There is something strange in the HTML for you posedt, so I cannot clearly see what you are trying to do in your JSP page. But either of the following kinds of usage would cause this kind of error:
        <h:dropDown ... items="<%= ...some Java expression ...>"/>or
        <h:dropDown ... items="${...some JSP EL expression...}"/>This is because JSF component tags allow neither Java runtime expressions nor JSP EL expressions (at least in JSF 1.1, which is what Creator 2 supports). The answer is to use a JSF EL expression instead, like this:
        <h:dropDown ... items="#{... some EL expression}"/>Craig

  • Use XCM parameter in a jsp page in ISA

    Hello,
    How can we use an XCM parameter (like system name) in a jsp page in ISA? Anyone has any suggestions for this?
    Thanks
    Archana

    Hello Archana,
    The API for getting application scope component is located in the class com.sap.isa.core.FrameworkConfigManager.XCM
    To get the component configuration:
    FrameworkConfigManager.XCM.getApplicationScpeConfig().getComponentConfig("project", "projectconfig");
    The component configuration is of type com.sap.isa.core.xcm.config.ComponentConfig It provides access methods for XCM parameters:
    getParamConfig("default").getProperty("param");
    Reference:  Development and Extension Guide.
    In any JSP, you can use the Java API and methods by simply using them in a Scriptlet and including the import (packages) in
    <%@ page import=com.sap.isa.core.FrameworkConfigManager.XCM" %>
    <%@ page import=com.sap.isa.core.xcm.config.ComponentConfig" %>
    Easwar Ram
    http://www.parxlns.com

Maybe you are looking for

  • Animated GIF won't animate or not even show at all

    I have been using animated GIF with no problem so far but now with iWeb 08 sometimes it works with certain GIFs documents or sometimes won't with other GIFs documents. Why ? And what can I do about this ? What is the solution ? Message was edited by:

  • MGT Reports producing no output

    Hi, MGT Reports producing no output eg: MGT : Invoice Review produces no data, even if provided with all correct parameters.

  • Publish Sharepoint 2013 with UAG 2010 SP3

    Hi All, I'm hoping some of you may be trying to accomplish the same task I am and are seeing similar problems. We have a single SharePoint 2013 Server running in our forest behind a UAG server that is setup to publish other applications (Exchange and

  • GOA + Local Contract distribution to R/3 in Extended Classic Scenario

    Dear SRM Gurus, System Information: SRM Server 5.5   EBP5.5 Technical Scenario: Extended Classic Scenario. Q1) We have created a Global Outline Agreement in EBP. We want this to be distributed to R/3. But when we click on distribute, it does not get

  • Problem visual admin java parameters

    Hi guys, I just wanna know in the visual admin, how to put a new java parameters ? I can't press enter and had a new line ... Can someone had a parameter ? Not a change but a new one ? Thanks.