JSP Professionals only  (urgent)

hai friend,
I am developing a site in that I am handling run time errors using
page directive errorPage option..
My problem is I am using javabeans for insert and update information..
Here If I get any error in bean how can I redirect to jsp errorpage...
help me...

HI ,
After inserting or updating retrieve the error messages using Objects.
For ex.
In ur Jsp,
Object oo=beaninstancename.methodname();
In bean;
on successful, return new String("true")
if any exception,
}catch(Exception e)
return e;
now u can check if it is true okay.Other wise print objcet oo..it is the exception..
Hope it will help u..

Similar Messages

  • Passing parameter from Servlet to javascript in JSP. Very Urgent - 5 jukes!

    Well my servlet will retrieve questions from database.
    Then the player will answer the question in the JSP and submit the answer to the servlet to process.
    Each time an answer is submitted, or a "Next Question" button is clicked, the countdown time will restart.
    And will reload the page with a new question.
    So how can i do that?
    This is my servlet, JSP, javascript
    =====================================================================
    * Interacts with the player depending on his types of selection and output them
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class GameQuestionServlet extends HttpServlet
         String sSQL = null;
         String sCategory = null;
         String paramName = null;
         User userObject = null;
         Questions gameQsObj = new Questions();
         HttpSession session;
         int cnt = -1;
         int score = 0;
         boolean connected = false;
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              session = request.getSession(false);
              //System.out.println("Testing Score:" + score);
              if(connected == true)
                   Questions object = (Questions)gameQsObj.getQsList().elementAt(cnt);
                   System.out.println("\n" + object.sAns1);
                   System.out.println(object.sAns2);
                   System.out.println(object.sAns3 + "\n");
                   Enumeration enum = request.getParameterNames();
                   while(enum.hasMoreElements())
                        paramName = (String)enum.nextElement();
                        if(paramName.equals("mcq"))
                             System.out.println(request.getParameter("mcq"));
                             score = Integer.parseInt(userObject.score.trim());
                             System.out.println("Player old score: " + score);
                             //Check to see if the selected answer matches the correct answer
                             if((object.sCorrect).equals(request.getParameter("mcq")))
                                  score = score + 10;
                             else
                                  if((object.sCorrect).equals(request.getParameter("mcq")))
                                       score = score + 10;     
                                  else
                                       if((object.sCorrect).equals(request.getParameter("mcq")))
                                            score = score + 10;     
                                       else
                                            score = score - 10;     
              System.out.println("Player current score: " + score);
              else     //will only go into this once
                   userObject = (User)session.getAttribute("user");
                   System.out.println("\n"+userObject.nric);
                   System.out.println(userObject.name);
                   System.out.println(userObject.password);
                   System.out.println(userObject.email);
                   System.out.println(userObject.score+"\n");
                   //depending on user selection
                   sCategory = request.getParameter("qsCategory");
                   sSQL = "SELECT * FROM " + sCategory;
                   gameQsObj.getQuestions(sSQL, sCategory);
                   score = Integer.parseInt(userObject.score);
                   connected = true;
              System.out.println("Connected:" + connected);
              System.out.println("Before:" + userObject.score);
              cnt = cnt + 1; //increment to retrieve next question
              userObject.score = Integer.toString(score);     
              System.out.println("After:" + userObject.score);
              if(cnt < 3) //setting for the number of questions per game.
                   //request.setAttribute("qsCnt", cnt); //count of the question number
                   request.setAttribute("aQs", gameQsObj.getQsList().elementAt(cnt));
                   System.out.println(request.getAttribute("aQs"));
                   System.out.println("This is question number: "+ cnt);
                   getServletConfig().getServletContext().getRequestDispatcher("/JSP/PlayGame.jsp").forward(request, response);
              else
                   //forward to the result page     
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
    <%@ page import="Questions" %>
    <HTML>
         <HEAD>
              <TITLE>Play Game</TITLE>
              <SCRIPT LANGUAGE="JavaScript">
                   var refreshinterval=10
                   var displaycountdown="yes"
                   var starttime
                   var nowtime
                   var reloadseconds=0
                   var secondssinceloaded=0
                   function starttime() {
                        starttime=new Date()
                        starttime=starttime.getTime()
                        countdown()
                   function countdown() {
                        nowtime= new Date()
                        nowtime=nowtime.getTime()
                        secondssinceloaded=(nowtime-starttime)/1000
                        reloadseconds=Math.round(refreshinterval-secondssinceloaded)
                        if (refreshinterval>=secondssinceloaded) {
                   var timer=setTimeout("countdown()",1000)
                             if (displaycountdown=="yes") {
                                  window.status="You have "+reloadseconds+ " second before timeout"
                   else {
                        hide();
                   clearTimeout(timer)
                             //window.location.reload(true)
                   function hide() {
                        //hidelayer
                        if(gameLayers.style.visibility == "visible"){
                             gameLayers.style.visibility = "hidden"
                             oops.style.visibility = "show"
                   window.onload=starttime
              </SCRIPT>
         </HEAD>
         <BODY>
              <FORM METHOD="post" ACTION="http://localhost:8080/Java_Assignment2/servlet/GameQuestionServlet">
                   <DIV ID="oops" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:2; visibility:hidden">
                        Oops! 30 seconds time up!!! <BR><BR>
                        <INPUT TYPE="submit" VALUE="Next Question">
                        <INPUT TYPE="hidden" NAME="nextQs" VALUE="Next Question">
                   </DIV>
                   <DIV ID="gameLayers" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:3; visibility:show">
                   <TABLE BORDER="0">
                        <TR>
                             <TH><BIG>Questions:</BIG></TH>
                        </TR>
    <%
                        Questions aQsObj = (Questions)request.getAttribute("aQs");
                        String aQsBody = aQsObj.sQs;
                        String aQsAns1 = aQsObj.sAns1;
                        String aQsAns2 = aQsObj.sAns2;
                        String aQsAns3 = aQsObj.sAns3;
    %>
                        <TR>
                             <TD><B><%= aQsBody%></B></TD>
                        </TR>
                        <TR>
                             <TD>
                                  <SELECT SIZE="3" NAME="mcq">
                                       <OPTION SELECTED><%= aQsAns1 %></OPTION>
                                       <OPTION><%= aQsAns2 %></OPTION>
                                       <OPTION><%= aQsAns3 %></OPTION>
                                  </SELECT><BR><BR>
                             </TD>
                        </TR>
                        <TR>
                             <TD>
                                  <INPUT TYPE="submit" VALUE="Submit Your Answer">
                                  <INPUT TYPE="hidden" NAME="submitAns" VALUE="Submit Your Answer">
                             </TD>
                        </TR>
                   </TABLE>
                   </DIV>
              </FORM>
         </BODY>
    </HTML>
    This must be answered before 28th of september.
    Please help. It is indeed very urgent.

    this is just a skeleton code.. alot of stuff is not here..
    <FORM name = "form1" action="../servlet/wateverSevlet>
    <input type="text" name="searchStr" size="40">
    <INPUT type="hidden" id=answer name=answer size=7>
    <input type="button" name="button" value="Submit Answer" onClick="javascript:submitCheck(document.form1.searchStr.value);">
    <input type="button" name="button" value="Skip Question" onClick="javascript:submitCheck('skip');">
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    function submitCheck(str)
      form1.answer.value = str
      form1.submit()
    </script>i assuming you are submitting it to the same servlet regardless of whether the user clicks the skip question or the submit question button.

  • Tabs in JSP- Plz help-Urgent

    I want to have 3 tabs say Tab1, tab2, tab3 in my page and based on which tab is clicked , I have to display the contents of a table.
    Ex: if Tab1 is clicked, i have to display contents of Table1 and tab2,table2 and so ...
    Plz help with how to link the click on the tab to calling of the JSP file which retrives and displays the data???....
    Its urgent ;plz help

    dnamiot ,
    I'm also looking for similar funcitonality.
    the URL mentioned in your reply is not free ware. you know, it is tough to convince management to buy a software for the project even it is $1.
    So if you know any taglibrary which is free ware , which generates maximum of 4 tabs and dynamic in nature, please let me know.
    Thanks in advance
    tekbond

  • Submenu in jsp ...urgent!!!pls help

    hi all
    i want to create a submenu called "AddPosition" under the Position tab .i.e tab3 . can any pls give me exact code . below is my code.Its urgent . Thanks.
    <%
    String tab = (String)request.getAttribute("t");
    String subTab = (String)request.getAttribute("st");
    %>
    <div id="headfont">talentpool</div>
    <div id="header">
    <ul>
    <li>
    <% if (tab.equals("1")){%>
    <a class="xmenu3" >
    <% }else{ %>
    <a class="xmenu2" href="#">
    <% }%>
    <b class="xsnazzy"><b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b><span class="xboxcontent">
    Home</span>
    </b></a>
    </li>
    <li>
    <% if (tab.equals("2")){%>
    <a class="xmenu3" >
    <% }else{ %>
    <a class="xmenu2" href="#">
    <% }%>
    <b class="xsnazzy"><b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b><span class="xboxcontent">
    Applicants</span>
    </b></a>
    </li>
    <li>
    <% if (tab.equals("3")){%>
    <a class="xmenu3" >
    <% }else{ %>
    <a class="xmenu2" href="summary.do?mode=perform1&t=3&st=41">
    <% }%>
    <b class="xsnazzy"><b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b><span class="xboxcontent">
    Position</span>
    </b></a>
    </li>
    <li>
    <% if (tab.equals("4")){%>
    <a class="xmenu3" >
    <% }else{ %>
    <a class="xmenu2" href="#">
    <% }%>
    <b class="xsnazzy"><b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b><span class="xboxcontent">
    Calender</span>
    </b></a>
    </li>
    <li>
    <% if (tab.equals("5")){%>
    <a class="xmenu3" >
    <% }else{ %>
    <a class="xmenu2" href="adminHome.do?mode=manageUsers&t=5&st=41">
    <% }%>
    <b class="xsnazzy"><b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b><span class="xboxcontent">
    Admin</span>
    </b></a>
    </li>
    </ul>
    <div id="hleft">
    Account Settings | Log Off
    </div>
    </div> <!-- end of header -->
    <div id="sub_header">
    <% if (tab.equals("1")){%>
    <% } %>
    <% if (tab.equals("2")){%>
    <b>Add Applicant</b> | Import Resume | Search Resume
    <% } %>
    <% if (tab.equals("3")){%>
    <% } %>
    <% if (tab.equals("4")){%>
    <% } %>
    <% if (tab.equals("5")){%>
    <b>Manage Users</b>
    <% } %>
    </div><!-- end of subheader -->

    Hi Experts,
    to be precise, i have a column in my oracle DB has XHTML tags as a data in it, when i use this column in BIP report i am getting tha XHTML tags as my data in my output.how can i parse those and get only the required data to be displayed in RTF ?
    Any update on this? i am out of ideas on this.. can any one help me on this

  • JSP NOT EXECUTING - URGENT HELP

    Hi,
    I am having a problem of JSP pages not getting executed. The setup is I have a Webserver and Appserver (Websphere 5.0) on different (unix) machines.
    I have a JSP page and I have put a log message at the very start of the page (not in a global function though). So ideally every time I execute I should have a log message on my log right ?? This is not the case.
    When I monitor the log (by viewing it dynamically -tail command ), only some visits cause the log to be written and not all the visit to the page.
    Local WSAD machine the code works fine and everything is ok. I do not have access to the Webserver and Appserver configurations and the group responsible is not able to solve this so far.
    Please let me know why this is happening ?
    Thanks in advance,
    Bharani

    1. Will the URL that i am trying to access be:
    http://localhost:8080/examples/jsp/gcdBB/LoginServlet
    2. Regarding WEB-INF/classes/gcd/gcd folder (note - 2 times gcd). When LoginServlet.java (located in: WEB-INF/classes/gcd) is compiled in JCreator, a second gcd folder is automatically created (WEB-INF/classes/gcd/gcd).
    Should I make any corrections, or alterations?
    Thanks,
    Niall

  • Opening an Excel File using Excel 97 from a JSP populated page(Urgent)

    Hello,
    I am using a JSP Page to populate data from the DB.
    When I am opening the same as an Excel File the JSP code is coming as the Excel page whenever Excel 97 is being used,but when Excel2000 or 2003 is being used then the data are coming as Excel formatted.I used the following code(JSP) :
    <head>
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline; filename=ExtractData.xls");
    %>
    </head>

    I can't even tell what the difference is between "coming as the Excel page" and "coming as Excel formatted". But then when people make urgent posts they very rarely spend the time to describe the problem accurately. Why bother when it's so damn urgent?

  • Jsp:params help urgent

    hi all,
    i need to pass a lot of values to a applet from a JSP program and i came accross a method for it like Param in Applet Tag : example :
    <PARAM NAME="data" VALUE="
    3624 41.3
    6315 66.7
    4530 58.1
    3378 39.9
    5114 62.6
    4884 63.9
    5348 56.0
    4809 54.6
    4815 52.6
    4091 40.6
    4963 61.9
    4119 59.5
    5107 52.6
    4458 52.9
    4628 59.0
    4669 59.9
    3712 38.5
    3545 42.2
    3694 54.7
    5299 52.3
    4755 58.5
    4751 52.8
    4675 57.6
    3098 41.0
    4254 48.8
    4347 59.2
    4508 59.3
    5149 65.2
    4281 57.6
    5237 52.5
    3601 55.2
    4903 52.7
    3875 38.5
    5087 50.3
    4561 53.2
    3983 51.6
    4660 60.0
    4449 50.2
    4558 46.4
    3635 37.8
    4167 53.3
    3821 41.8
    4188 47.4
    4022 67.3
    3907 57.1
    4701 47.8
    4864 63.5
    3617 41.6
    4468 54.5
    4566 62.9
    ">But i do not have any idea of how do i retrive them in the applet . The number of values will differ each time the applet id loaded .Please help me with this ..Very Urgent. Thanks in advance .
    Chandooo

    hi , i am able to pass the data to the applet through the StringBuffer Object .Here is the JSP code which does the same :
    [ code ]
    <%
    int len =0;
    StringBuffer data = new StringBuffer();
    String ginfo = new String();
    if (r1>r2)
    loop:
    while(sub2.next()){
    while( sub1.next()){
    if(sub1.getString(1).equals(sub2.getString(1))){
    ginfo = sub1.getString(1)+"@"+ sub1.getString(2)+"@"+sub1.getString(3)+"@"+ sub2.getString(3)+"@"+sub1.getString(4);
    data.append(ginfo);
    data.append("\n");
    len++;
    sub1.beforeFirst();
    continue loop;
    sub1.beforeFirst();
    else
    loop1:
    while(sub1.next()){
    while( sub2.next()){
    if(sub2.getString(1).equals(sub1.getString(1))){
    ginfo = sub1.getString(1)+"@"+ sub1.getString(2)+"@"+sub1.getString(3)+"@"+ sub2.getString(3)+"@"+sub1.getString(4);
    data.append(ginfo);
    data.append("\n");
    len++;
    sub2.beforeFirst();
    continue loop1;
    sub2.beforeFirst();
    sub1.close();
    sub2.close();
    %>
    <jsp:plugin type="applet" code="Dot.class" width="500" height="500" align="center">
    <jsp:params>
    <jsp:param name="sub1" value="<%=s1%>" />
    <jsp:param name="sub2" value="<%=s2%>" />
    <jsp:param name="max" value="<%=max%>"/>
    <jsp:param name="len" value="<%=len%>"/>
    <jsp:param name="data" value="<%=data%>"/>
    </jsp:params>
    <jsp:fallback>
    Plugin tag OBJECT or EMBED not supported by browser, So please Download and Install the Plugin
    </jsp:fallback>
    </jsp:plugin>
    But the problem is ..the applet doesn't paint. the applet code is :
    double interval,xinterval1,yinterval1;
    double max;
    int len ;
    private String message = "Initializing";
    int x =0,i=0;
    String sub1,sub2,data;
    public void init() {
    sub1=getParameter("sub1");
    sub2=getParameter("sub2");
    max = Double.valueOf(getParameter("max")).doubleValue();
    data = getParameter("data");
    len = Integer.parseInt(getParameter("len"));
    interval = max/5;
    public void paint (Graphics g){
    String [][]xyf = new String [len][5];
    StringTokenizer tokenizer = new StringTokenizer(data);
    while(tokenizer.hasMoreTokens()){
    String valueOne = tokenizer.nextToken();
    StringTokenizer singleginfo = new StringTokenizer(valueOne,"@");
    x=0;
    while (singleginfo.hasMoreTokens()) {
    xyf[x++]=singleginfo.nextToken();
    i++;
    [/ code ]
    Can please tell me whats wrong with this ...

  • Congiguring jsps with oracle8i,urgent reply needed

    Beginner for oracle8i ---need ur help
    I have installed oracle8i database server8.1.5 on winNT workstation which has Jserver to run java components.
    Please tell me how to run jsps with oracle8i.
    Ihave written certain jsp files but don't know where to put them and how to start the server to test them.This is an urgent requirement for my client,if anybody can help.
    A great thanks in advance.
    null

    Do you refer to the 9i AS Metadata Repository / iasdb?
    then,
    1) yes, if mid-tier components (like Reports) metadata is stored there
    2) do you consider your apps important?
    Also note that Infra. and Mid-tier installs should be backed up sync'd (both at same time). There is a paper on OTN about this.

  • Problem with JavaBeans in JSP.IT'S URGENT!!!

    Hi, i have problems with JavaBeans in JSP.
    In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
    <jsp:useBean id="paramBean" class="licentza.ParamBean" />
    <jsp:setProperty name="paramBean"
    property="nume"
              value='<%= request.getParameter("numeUser") %>' />
    where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
    And i get this error:
    Generated servlet error:
    D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
    ParamBean paramBean = null;
    What is the problem?Thank you.

    Hi,
    Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
    Rajesh

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to update Row Object in JSP Page? urgent!!!

    HI,
    I have a JSP Page and I have used jbo:DataSource and jbo:ApplicationModuleTags.
    Step 1: I have created a oracle.jbo.ViewObject view using
    view = ds.getRowSet().getViewObject(); and executed query using view.executeQuery()
    Step 2: I access the Row Object for this view like this
    Row rs = ds.getRowSet().getCurrentRow().
    Step 3: I try to set the attributes for this Row using setAttribute methods like this
    rs.setAttribute("empName","James");
    Step 4: Now I want to update this row. How to update this???
    If i need to get a Transaction object, which object's getTransaction I should use?
    Note: Please note that I haven't used <jbo:Row > tags to access my row. I simply get the Row object from view and want to update certain attributes and commit to database.
    Thanks
    Hari

    Hi Harihara!
    I think the record pointer is still before the first row, because you just executed the query.
    Try one the following statements instead of 'Row rs = ds.getRowSet().getCurrentRow()':
    Row rs = view.first();
    or
    Row rs = ds.getRowSet().first();
    And don't forget to commit your changes if the master process doesn't take care of it already!
    Good Luck!
    Rolf van Deursen.

  • How to use EJB in JSP...urgent!!!

    hello,
    i am novice programmer in EJB.
    i am using weblogic 6.1 ...
    my problem is how to use EJB in jsp page.
    my code is as follow..but its not displaying any result.
    <%@ page import="javax.naming.InitialContext,
    javax.naming.Context,
    java.util.Properties,
    firstEJB.First,
    firstEJB.FirstHome"%>
    <%
         long t1 = System.currentTimeMillis();
         System.out.println(t1);
         Properties props = new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
         props.put(Context.PROVIDER_URL, "localhost:7001");
         Context ctx = new InitialContext(props);
         FirstHome home = (FirstHome)ctx.lookup("FirstEJB");
         First bean = home.create();
         String time = bean.getTime();
         bean.remove();
         ctx.close();
         long t2 = System.currentTimeMillis();
    %>
    <html>
         <head>
              <style>p { font-family:Verdana;font-size:12px; }</style>
         </head>
         <body>
              <p>Message received from bean = "<%= time %>".<br>Time taken :
              <%= (t2 - t1) %> ms.</p>
         </body>
    </html>
    please tell me the solution.

    Hi, I don't know if it may be the cuase of your problems, but you should narrow the Object obtained doing the lookup, like this:
    FirstHome home = (FirstHome) PortableRemoteObject.narrow(ctx.lookup("FirstEJB"), FirstHome.class);

  • JSP Database access - Urgent

    Hi,
    A simple data access program to set values in a db. I have the following problems.
    1. When I dont use if(request.getParameter("name")!=null) or any other parameter for testing null values, a row of null values is inserted each time I enter the jsp file.
    2. One more problem is that the update is not regular. It sometimes works fine, someother times it fails miserably. It seems that the connection is not closed properly as I receive such a message when I try to shut dwon oracle.
    3. A much more peculiar problem, when i paste a url directly into my browser, it runs fine, but not with location.href or a flash link!! eg the register.jsp file is reported as a nonexisting file (HTTP 404) when I provide a link to it from flash in the form http://localhost:8080/reg/register.jsp but when i type this url directly it works fine.
    My code for register.jsp is:
    <%@ page import="java.io.*,java.lang.*,java.sql.*,java.util.*"%>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbc:odbc:yogaesh","scott","tiger");
    Statement stmt=con.createStatement();
    if(request.getParameter("name")!=null)
    String str="insert into rt values('" + request.getParameter("name") + "','" + request.getParameter("uname") + "','" + request.getParameter("pass") + "','" + request.getParameter("cpass") + "'," + request.getParameter("age") + ",'" + request.getParameter("sex") + "','" + request.getParameter("add") + "'," + request.getParameter("code") + ",'" + request.getParameter("ugqual") + "'," + request.getParameter("per") + ",'" + request.getParameter("iadd") +"')";
    stmt.executeUpdate(str);
    stmt.close();
    con.commit();
    con.close();
    con=null;
    str=null;
    }catch(Exception e){out.println("Database error!!");}
    %>
    Please help me out and thanks in advance...
    R. Yogaesh.

    Hi,
    A simple data access program to set values in a db. I
    have the following problems.
    1. When I dont use
    if(request.getParameter("name")!=null) or any other
    parameter for testing null values, a row of null
    values is inserted each time I enter the jsp file. *********
    * Yup. Use .equals("") or .equals("null") as tests, depends on your servlet container
    2. One more problem is that the update is not regular.
    It sometimes works fine, someother times it fails
    miserably. It seems that the connection is not closed
    properly as I receive such a message when I try to
    shut dwon oracle. *************************
    Use this:
    Connection conn = null;
    try{
       //Do database stuff
    } catch {
       // Report your errors
    } finally{
       try{
         if(conn!= null){
            conn.close();
         }catch{}
    3. A much more peculiar problem, when i paste a url
    directly into my browser, it runs fine, but not with
    location.href or a flash link!! eg the register.jsp
    file is reported as a nonexisting file (HTTP 404) when
    I provide a link to it from flash in the form
    http://localhost:8080/reg/register.jsp but when i type
    this url directly it works fine.***********************
    Maybe your flash is on another computer/server? Try using the link http://<ip address>:8080/reg/register.jsp or http://<dns name>:8080/reg/register.jsp
    My code for register.jsp is:
    <%@ page
    import="java.io.*,java.lang.*,java.sql.*,java.util.*"%>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection
    con=DriverManager.getConnection("jdbc:odbc:yogaesh","sc
    tt","tiger");
    Statement stmt=con.createStatement();
    if(request.getParameter("name")!=null)
    String str="insert into rt values('" +
    request.getParameter("name") + "','" +
    request.getParameter("uname") + "','" +
    request.getParameter("pass") + "','" +
    request.getParameter("cpass") + "'," +
    request.getParameter("age") + ",'" +
    request.getParameter("sex") + "','" +
    request.getParameter("add") + "'," +
    request.getParameter("code") + ",'" +
    request.getParameter("ugqual") + "'," +
    request.getParameter("per") + ",'" +
    request.getParameter("iadd") +"')";
    stmt.executeUpdate(str);
    stmt.close();
    con.commit();
    con.close();
    con=null;
    str=null;
    }catch(Exception e){out.println("Database error!!");}
    %>
    Please help me out and thanks in advance...
    R. Yogaesh.

  • OracleJSP:oracle.jsp.parse.JspParseException Urgent please

    Hai,
    I deployed my application on OC4J and while i am accesing my application, I got this below mentioned error on browser.Can any body have any clues about this error. I am really struggling hard to get out it.If you have any suggessions,please let me know.
    Request URI:/en_US/clubroster.jsp
    Exception:
    OracleJSP:oracle.jsp.parse.JspParseException: /en_US/roster.jsp: Line # 350, <mp:crresults summaryList="<%=summarylist%>" lang=en_US />
    Error: Expecting quoted value, got character: e
    Thanks!
    Tracy.

    Hai qlin,
    Thanks for you reply.I resolved the issue by putting en_us within quotes.
    <mp:crre summaryList="<%=summarylist%>" lang="en_US" />.Thanks again.
    Tracy.

  • Same image appears in all rows in jsp read only table :(

    ok this is the the problem: let say i have a table IMAGES (ID NUMBER, PIC ORDSYS.ORDIMAGE) and i want to show the table in web with all images... and let say that every row have a different image loaded in db...
    if i want to create an UIX page to show the content all i need to do is just to drag and drop the view as readonly table from data control pallet and when i run the app all images are listed...
    but in JSP instead of different images listed i got one image in all of the rows... and when i change the row currency (click on next or preview) all images in all rows change to the image of current row.... and i dont want that...
    i want to be able to show apropriate image in every row...
    image is shown using adf renderer just like here: http://www.oracle.com/technology/sample_code/products/jdev/10g/StreamingMedia.zip
    but that sample code have the same problem, atleast on my system... instead of differnet images in differnet rows i see the same image in all rows (image from the current row)
    any help?
    thank you in advance :)

    ok guys i found the solution thanks to steve muench and his "upload text file and image example" on his weblog..
    thanks steve :)
    insted of:
    <adf:render model="bindings.Pic"/>
    it should be
    <adf:render model="Row.Pic"/>

Maybe you are looking for

  • Multiprovider

    Dear Experts, I have a requirement as follows: I have most of the document Data in an DSO and some of the required data/fields are in Cube 1 and the ramining fields are in cube2. The join condition i want to use is Document Number. DSO Doc no   10000

  • Is it a bug of the cisco OS?

    hi, i have a cisco 1230 access point and i m using snmp with it, so there are some fields in cisco mib "ciscoDot11AssociationMIB", that doesn t return any value : the wired interface of the AP gives me all informations (mac adress, ip adress,...) but

  • Nokia 7370 Urgent help needed

    Hi, My nokia is having some serious issues and i dont know how to fix it. it freezes to a white screen with just the battery sign on top i have to turn it off then on to unfreeze it, when it does unfreeze on its own it comes up with a message saying

  • I see this problem with Aperture Library

    Well, as you know, we have an Aperture Library. In my case about 60GBs and it will be growing about 35GBs per year. This Library is made of files imported from folders in another external HD (they are the originals imported from the camera). I have a

  • I lost my menu bar and F10 and Alt key do not work! How do I get my menu bar back for Mac?

    I cannot get my menu bar back. have tried the above fixes and nothing. And I dont have an expansion button to click on. My screen is out of full view mode.