compile the servlet,then restart the server (tomcat/jboss,etc) and then try..
also, maybe clear the temp folder of your server,which may be holding an old copy of your project.. Can you please print the values after setAttribute and before getAttribute of the variable .. Thanks, jd On 8/25/10, Nelson Rodrigo - LHQ <nelson.rodr...@loadstarlk.com> wrote: > Hi > No JD I have corrected before your posting, same result :( > > > Thanks & Kind Regards, > Nelson Rodrigo > Executive – Software Development > LOADSTAR (PRIVATE) LIMITED > Sri Lanka | Tel: +94 11 483 7914 | Fax: +94 11 224 0892 | Mobile: +94 77 311 > 6556 > SAVE PAPER - Please consider our environment before printing > > > -----Original Message----- > From: jitesh dundas [mailto:jbdun...@gmail.com] > Sent: Wednesday, August 25, 2010 10:13 AM > To: nelson.rodr...@loadstarlk.com > Cc: java-ee-j2ee-programming-with-passion@googlegroups.com; > rameshcharyko...@gmail.com; mearajah...@gmail.com; harshani perera; Ramesh A > Subject: Re: [java ee programming] Servlet Error > > The problem is the extra 'l' in > > ("fulllname") > > your jsp call..plz check and verify if true.. > > thanks, > jd > > On 8/25/10, Nelson Rodrigo - LHQ <nelson.rodr...@loadstarlk.com> wrote: >> Dear JD >> Connection and everything is fine, see my sql is in my below mail. >> When sql success only come to jsp otherwise direct to message html page. >> >> >> >> Thanks & Kind Regards, >> Nelson Rodrigo >> Executive Software Development >> LOADSTAR (PRIVATE) LIMITED >> Sri Lanka | Tel: +94 11 483 7914 | Fax: +94 11 224 0892 | Mobile: +94 77 >> 311 >> 6556 >> ? SAVE PAPER - Please consider our environment before printing ? >> >> >> -----Original Message----- >> From: jitesh dundas [mailto:jbdun...@gmail.com] >> Sent: Wednesday, August 25, 2010 9:24 AM >> To: nelson.rodr...@loadstarlk.com >> Cc: java-ee-j2ee-programming-with-passion@googlegroups.com; >> rameshcharyko...@gmail.com; mearajah...@gmail.com; harshani perera; Ramesh >> A >> Subject: Re: [java ee programming] Servlet Error >> >> Do these.. >> >> check if table column names,types & details is correct and if db >> connection is also fine.. >> >> Next, insert a new record and query the table from db command prompt >> itself.see if u get the value..if yes,paste it into the query string >> in the loop.. >> >> String vari = ''; >> >> try >> { >> >> while (rs.next() ) >> { >> vari = rs.getString('column name'); >> out.println(vari); >> } >> } >> catch(Exception ex) >> //I assume that you will put all specific exceptions in place.. >> { >> ex.printStackTrace(); >> }//end catch .. >> //finally block if //needed.. >> >> Please check the Java examples in your books for details.Without stack >> trace (assuming no silly mistakes are tere in the existing code), it >> is difficult to solve.. >> >> regards, >> jd >> >> On 8/25/10, Nelson Rodrigo - LHQ <nelson.rodr...@loadstarlk.com> wrote: >>> Hi Friends, >>> >>> Thanks for your valuable responses. >>> >>> But friends sad to say still Im in same issue. My codes >>> are >>> here please look in to this, where I missed. >>> >>> >>> >>> In My Servlet . >>> >>> >>> >>> ResultSet rs = stmt.executeQuery("SELECT UsrName, PWord, FullName, SAPNo, >>> eMail FROM tbllogin WHERE UsrName='" +lgNam+"'and PWord='"+lgPas+"'"); >>> >>> >>> >>> if (rs.next()) { >>> >>> String stFullName = >>> rs.getString("FullName"); >>> >>> request.setAttribute("fullname",stFullName); >>> >>> >>> >>> >>> >>> In My JSP >>> >>> >>> >>> <% >>> >>> String sUserName = (String)request.getAttribute("fulllname"); >>> >>> out.println("Name : " + sUserName ); >>> >>> >>> >>> %> >>> >>> >>> >>> But result is Name : null >>> >>> >>> >>> >>> >>> Thanks & Kind Regards, >>> >>> Nelson Rodrigo >>> Executive Software Development >>> LOADSTAR (PRIVATE) LIMITED >>> Sri Lanka | Tel: +94 11 483 7914 | Fax: +94 11 224 0892 | Mobile: +94 77 >>> 311 >>> 6556 >>> >>> P SAVE PAPER - Please consider our environment before printing >>> >>> >>> >>> From: java-ee-j2ee-programming-with-passion@googlegroups.com >>> [mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf >>> Of >>> jitesh dundas >>> Sent: Tuesday, August 24, 2010 12:18 PM >>> To: nelson.rodr...@loadstarlk.com >>> Cc: rameshcharyko...@gmail.com; >>> java-ee-j2ee-programming-with-passion@googlegroups.com >>> Subject: Re: [java ee programming] Servlet Error >>> >>> >>> >>> There is one issue in this suggestion my friend... >>> >>> On Tue, Aug 24, 2010 at 9:27 AM, Ramesh K <rameshcharyko...@gmail.com> >>> wrote: >>> >>> Hi Nelson Rodrigo, >>> after retrieving the FullName from Database you have to store it in >>> any one of these scopes: >>> request,session or application >>> like >>> >>> if (rs.next()) { >>> >>> String stFullName = rs.getString("FullName"); >>> >>> >>> >>> //add this line to your code >>> >>> response.setAttribute("fullname",stFullName); >>> >>> >>> >>> response.sendRedirect("MainFrame.jsp"); >>> >>> >>> >>> } >>> >>> In JSP use Like this >>> >>> //typecast the Object into String >>> >>> String sUserName = (String)request.getAttribute("fulllname"); >>> >>> out.println("Name : " + sUserName ); >>> >>> >>> >>> if you print something just before a sendRedirect call, then your servlet >>> might throw you an error and ofcourse stop processing..so please avoid >>> using >>> print stmts with redirect callls.. >>> >>> good suggestion though. Nelson my friend, you need to learn from the >>> tutorials and practise..else you will not be able to gain your skills as >>> needed.. >>> >>> Java COmplete Reference by Herbert Schildt >>> Servelts by Dustin Callaway >>> Java Tutorial on oracle.com >>> >>> Hope this helps.Please try all the suggestions in this thread and let us >>> know if needed... >>> >>> >>> Thanks, >>> jd >>> >>> >>> >>> >>> On Mon, Aug 23, 2010 at 5:14 PM, Nelson Rodrigo - LHQ >>> <nelson.rodr...@loadstarlk.com> wrote: >>> >>> >>> >>> Dear Friends >>> >>> Hi Friends >>> >>> >>> >>> In my login servlet I have use as follows >>> >>> ResultSet rs = stmt.executeQuery("SELECT UsrName, PWord, FullName, SAPNo, >>> eMail FROM tbllogin WHERE UsrName='" +lgNam+"'and PWord='"+lgPas+"'"); >>> >>> >>> >>> And if success I want to use those db values to my jsp >>> >>> if (rs.next()) { >>> >>> String stFullName = rs.getString("FullName"); >>> >>> >>> >>> response.sendRedirect("MainFrame.jsp"); >>> >>> >>> >>> } else { >>> >>> >>> >>> In JSP I have use >>> >>> String sUserName = request.getParameter("stFullName"); >>> >>> out.println("Name : " + sUserName ); >>> >>> >>> >>> but result is null >>> >>> what happened? Where I missed? >>> >>> >>> >>> Thanks & Kind Regards, >>> >>> Nelson Rodrigo >>> Executive Software Development >>> LOADSTAR (PRIVATE) LIMITED >>> Sri Lanka | Tel: +94 11 483 7914 | Fax: +94 11 224 0892 | Mobile: +94 77 >>> 311 >>> 6556 >>> >>> P SAVE PAPER - Please consider our environment before printing >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Java EE (J2EE) Programming with Passion!" group. >>> To post to this group, send email to >>> java-ee-j2ee-programming-with-passion@googlegroups.com >>> To unsubscribe from this group, send email to >>> java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com >>> <mailto:java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com >>>> >>> For more options, visit this group at >>> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?h >>> l=en >>> >>> >>> >>> >>> >>> -- >>> Thanks & Regards, >>> Ramesh K >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Java EE (J2EE) Programming with Passion!" group. >>> To post to this group, send email to >>> java-ee-j2ee-programming-with-passion@googlegroups.com >>> To unsubscribe from this group, send email to >>> java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com >>> <mailto:java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com >>>> >>> For more options, visit this group at >>> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?h >>> l=en >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Java EE (J2EE) Programming with Passion!" group. >>> To post to this group, send email to >>> java-ee-j2ee-programming-with-passion@googlegroups.com >>> To unsubscribe from this group, send email to >>> java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?h >>> l=en >>> >>> >> >> >> >> > > > > -- You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en