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

Similar Messages

  • Help needed to create a master-detail JSP page using OAF.

    I like to create a master-detail JSP page using OAF. If any help or guide will be appreciate.
    - Kausik

    A Master Detail Page is a basically a game between two VOs(Master and Detail mostly connected through a View Link). You can also have a look at the View Link section in the Dev guide. Page Layouts is one thing which you can take a call yourself.
    Regards
    Sumit

  • Determine the outcome of an action in the jsp page?

    can i determine the outcome of an action in the jsp page?
    for example:
    i create a jsp file that contains two links, that play the role of tabs....
    the action is different for the two links say "action1" and "action2" but the result page is the same original page...
    can i determine what whas the action the user clicked?( so that i can display different things, according to action )

    you can use the <f:param> component with your commandLink and set a different value for each of your link. Then, in your jsp, you should be able to retrieve the value of the parameter in the request.

  • 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

  • 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 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;

  • Need ur help to create sl statement in jsp

    hello experts
    plz tell me how i can create a table in MS-ACESS with the help create table command (i want to create dynamic table within my jsp page)
    i tried this command
    String query3 = "CREATE TABLE Friends(message memo,author,text,postdate text,)";
    but it was not working plz help me

    is it giving you any error ?
    If yes , then please give the error message details

  • 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

  • Help posting correct Array[value] to JSP page

    Hello,
    Can someone please tell me what is wrong with this? I am posting the following page (only a portion of the page is listed below) to another jsp page. It consists of a listing of books for sale. Next to each book is a separate "add to cart" button. I want to send the corresponding "isbn" (indexed in an Array) to the next page. When I add print stmts for each record, I can see that the correct isbn is attached to each book.
    The problem is that when I post this to the next page, the formparm for isbn is always the 1st isbn in the array, instead of the selecgtedIsbn. Why???
    Thanks in advance!
    <CODE>
    <% for(int i=0; i < isbnValues.length; i++) {  %> 
    <TABLE>
    <% if ( isbnValues[i] != null) { %>   
    <tr>
    <td> <B><%= titleValues[i] %> </B> </td>     
    <INPUT TYPE="HIDDEN" NAME="selectedIsbn" VALUE="<%= isbnValues[i] %> "></INPUT>
    <INPUT TYPE="HIDDEN" NAME="selectedPrice" VALUE="<%= priceValues[i] %> "></INPUT>
    <td align="right"> <i>Price: </i>
         <%      DecimalFormat df = new DecimalFormat("$#,##0.00");
              String strPrice = df.format(Double.parseDouble(priceValues));
         %>
              <%= strPrice %>     <br>
    </td>
    <td align="right"><i>Quantity:</i>      
         <INPUT TYPE="TEXT" NAME="qty" VALUE="1"></INPUT> <br> </td>
    <td align="right">
         <INPUT TYPE="SUBMIT" VALUE="Add to Shopping Cart"></INPUT> <br>
    </td>
    </tr>
    <% } %>     <%-- end if isbn --%>     
    </TABLE>
    <% } %> <%-- end for loop --%>     
    </CODE>

    Hi,
    I have the indexes, but they were somehow removed when I posted the code. I used the wrong tags.
    I used the right tag and added spaces around the [" i "].
    Let's try again... Here's the code:
    <% for(int i=0; i < isbnValues.length; i++) {  %> 
    <TABLE>    
    <% if ( isbnValues[ i ] != null) { %>   
    <tr>
    <td>  <B><%= titleValues[ i ]  %> </B> </td>     
    <INPUT TYPE="HIDDEN" NAME="selectedIsbn" VALUE="<%= isbnValues[ i ] %> "></INPUT>
    <INPUT TYPE="HIDDEN" NAME="selectedPrice" VALUE="<%= priceValues[ i ] %> "></INPUT>
    <td align="right">  <i>Price: </i>
         <%      DecimalFormat df = new DecimalFormat("$#,##0.00");
              String strPrice = df.format(Double.parseDouble(priceValues[ i ]));
         %>  
              <%= strPrice %>     <br>
    </td>
    <td align="right"><i>Quantity:</i>                 
         <INPUT TYPE="TEXT" NAME="qty" VALUE="1"></INPUT>   <br> </td> 
    <td align="right">
         <INPUT TYPE="SUBMIT" VALUE="Add to Shopping Cart"></INPUT> <br>
    </td>
    </tr>
    <% } %>     <%-- end if isbn  --%>     
    </TABLE>
    <% } %>      <%-- end for loop  --%>     

  • 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.

  • 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

Maybe you are looking for

  • Update from osx 10.5.8 to 10.6

    how can i update from osx 10.5.8 to 10.6 i ned to instal a hp photosmart printer  haven't been able to . please help, thanks

  • JFrame which does not allow resizing (maximizing, minimizng)

    I want to develop a login frame which does not allow resizing (maximizing, minimizing as this does not make sense) and with 2 fields, JTextField and JPasswordField. The frame is developed but has the usual resizing handles. How to do? Many tks for an

  • IPhone back up (English/French)

    Hello, a friend of mine had an appointment at the Apple Store in Paris for an exchange of broken iPhone and saved his iPhone on my Mac (via iTunes). He proceeded to the data recovery from his backup. Since then, for Apps updates, it is my password wh

  • My desktop is running very slow...

    I have a Mac OSX 10.5.8 with 2.4 GHZ Intel Core 2 Duo...system is running REALLY slow in terms of navigating the net.  Cannot open Firefox and sites like Yahoo, are now taking forever to open up.  Memory use is good, not running out.  I am not really

  • Summary column  OS confliction problem

    hi Ihave a big  problem  in  each time   using a summary column  on it I creat my summary column icon on the datamodel then I connect to database normally ,but   after writing the query and press next  an Os  window appears that says reports builder