JSP problem ? plz help......
Just a simple question..But urgent , thanks....i have written the code in the following.....
<%
while (rs.next())
%>
<tr>
<td><%=rs.getString("name")%</td>
<%
rs.next();
%>
<td><%=rs.getString("name")%></td>
</tr>
<%
if (i++ ==4)
%>
my goal is to show the name with the related data..however, i don't know why the following error will be shown when i tried to execute it.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: After end of result set
You are calling rs.next() twice in each loop.
once in the loop condition.
and then again halfway through.
If you have an odd number of elements returned, then that last call to next() will take you off the end of the result set, and calling getString() raises the exception.
possible solutions:
- put an if statement for the second rs.next()
ie
if (rs.next()){
%>
<td><a href="select_date.jsp"><%=rs.getString("name")%></a></td>
</tr>
<%
else {%>
<td> </td></tr>
<%Alternatively figure out a better way of doing <tr> </tr> tags based on an index of the row returned.
ie
I'll also use this example to show how much neater it is to use JSTL and EL than that ugly scriptlet code you have ;-)
<c:forEach var="row" items="${queryResult.rows}" varStatus="status">
<c:if test="${status.index % 2==0}"><tr></c:if>
<td><a href="select_date.jsp" >${queryResult.name}</a></td>
<c:if test="${status.index % 2==1)"></tr></c:if>
</c:forEach>
Similar Messages
-
Having JSP problem plz help me
i make small proj with small DB
i have java bean to setter and getter of the fields in the table
so i have this Exception
Generated servlet error:
TabelBean cannot be resolved or is not a type
i search for error but i didn't find it >>>>plz help meDid you import the class into the JSP?
<%@ page import="myPackage.MyClass" %> -
Audio Clip problem plz help..
There is some problem with my code. It is actually for simply playing a wav file.
It gives errors on two lines....
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
public class MediaPlayerDemo extends JFrame
AudioClip clip; //Error Here
public MediaPlayerDemo(String title)
super(title);
clip = getAudioClip(getCodeBase(),"access.wav"); //Error Here
clip.loop();
public static void main(String args[])
MediaPlayerDemo m = new MediaPlayerDemo("Title");
m.setSize(400,400);
m.setVisible(true);
}"Audio Clip problem plz help"
You have to learn to help yourself.
Have you done anything to try to fix the errors yourself?
AudioClip clip; //Error Here
the error generated here is self-explanatory.
if you can't fix this, you should get a good book on java basics and start again.
the other error is also easy to fix. -
hi!
i am unable to run my RMI server program .Name of My server class is SumServer.java,it implements SumInterface.java all the files(.class,.java and stub) are at location c:\javaprog\rmi\sum.
I have not put them in any package.
value of classpath is
classpath=c:\jdk1.4\lib;.;c:\javaprog\rmi\sum
i go in sum folder and run the program
c:\javaprog\rmi\sum > SumServer
it gives me following exception.plz help me out.
Thx in advance.
Exception occur.Unable to register serverjava.rmi.ServerException: RemoteExcepti
on occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: SumServer_StubDeepa lakshmi wrote:
Hi,
Am new to weblogic.
Am using the tools are,
Weblogic8.1 version
MySql5.0,mysql-connector-java-3.1.12-bin.jar file
While test configuration of connection pooling am getting the error is "JDBC Driver is not on the classpath".
How can i solve this problem
plz help me
regards
DeepaEdit the start-weblogic script. Near the bottom, you will see
lines that create a CLASSPATH for the weblogic server. Add a
script line that adds the mysql driver to the classpath there.
Joe -
How do i pass parameters from j2me to jsp?plz help
hi everyone...
i m doing my final year project
can anyone plz tell me how to pass parameters like user name,password,etc.. from a j2me midlet to a jsp page running in tomcat server?
i tried passing parameters in http connection through url as:
String url="http://localhost:8080/example/test.jsp?name=abc";
i need this info urgently as i am not able to proceed with my project... plz help
any suggestions or references would be appreciated...
thank u...
regards,
RinziJHD
hi.
you have written in URL i sperfectly right but if this is also not complete one.
i.e url = "http://localhost:8080/dir/xxx.jsp?userName=jasmit&password=vala"
now when u establishing connection i.e
HttpConnection con = (HttpConnection) Connector.open(url,3);
this will work as an declaration but if u want to send that parameter for that you have to get response from the server and that time only original connection is going to establish i.e
when u r writting
int responseCode = con.getResponseCode();
if(reponseCode == 200)
then ur parameter were passed to jsp page.
in jsp page u have to get parameter using request class
String userName = request.getParameter("userName").toString();
String password = request.getParameter("password").toString();
i hope this might solve ur problem.
Regards,
Jasmit vala
[email protected] -
Hi Guys,
I have a problem to make a developer application Client/Server.
When i install forms Runtime on the Client`s computer and i open the application, i get the error that he can`t find the menu and the libraries.
The menu path is for example on my computer F:\s3\Salesmenu
But on the client it can be a different path an then he can`t find the menu.
Now the properties for the main form are:
Menu module f:\s3\Salesmenu
Initial menu Salemenu
Does anyone know how to fix this problem for example:
1) by let the program search for the menu.
2) .....
Plz Help
Vincentset your FORMS60_PATH on the client to Formspath;libpath;menupath so it looks in every dir named in the path.
-
So, when i click on the itunes shortcut, which has the same icon as the Apple Software Updater, I get a box that says that iTunes has encountered a problem and needs to close. We are sorry for the inconvenience. I hit send once and sent the error report, and then restarted my computer to see if that would help. It didnt, so, now i cant access itunes this is a major problem cause i have all my songs on this computer. I also tried to plug in my ipod and see if that would make it load.
I installed iTunes 7.0 on my laptop, the exact same way, and i works on my laptop, but not on my computer.
PLZ HELP MEok this is what i did when that happened to me. i uninstalled quicktime then went here: http://www.apple.com/quicktime/win.html and reinstalled the latest version :0)
-
Nokia n79 problem Plz Help!
Hello!My nokia just stuck,or hang in(i dont now english good) but i cant do enything.Evry button just dont work only at start when i write my pi(and somethimes then too).Works only power button.Its weard.Plz help.Somethimes a whole day are no problems somhetimes a whol day.
hey ivee n everyone else .. i'm facing the same problem.. n i need to fix this problem myself..
my n79 gets hang constantly nowadays.. i've used this phone for 1 year plus now so warranty's no more..... none of the buttons on the keypad works when it gets hang.. onli the power button is functioning.. now it's gettin worse .. it even hangs before i insert my pincode... i cant sms, call , or anything.. it hangs after i pressed a few buttons..
so ivee u've fixed ur n79 youself right..? umm.. can u explain to me wat a smallboard is? is that the board at the lower part of the keypad where u can see buttons underneath the white layer? and is that board expensive?
pls reply asap anyone.. urgent -
N79 hanging problem plz help....
while unlocking the keypad of my n79 sometimes the phone gets hanged then i have to take the battery out and then again switch on the phone........plz help me how to get rid of this problem???
I have also same problem with my Nokia N79, I just cancelled sensor for automatic themes from cover. Just open back cover & stick some paper or plastic cello tape on four hole marks of covers wich r sensor for automatic themes to change colour of back cover same as theme colour. From 2 days I feel my mobile working fine without hanging ! so try it, all the best.
-
Bluetooth connection problem plz help...
hi everyone, just bought a new pearl 9105. everything works fine and even bluetooth... through which i can transfer data from blackberry to other mobiles(samsung,sony ericsson)... but the problem is i could not recieve data from other mobiles.i should get contacts list from the other mobiles... but due to this problem i couldnt. plz help me out..
The best way to receive a file from another device via bluetooth is to go to Media, then press Menu, choose Receive Using Bluetooth, waiting for connection will be display, then send from the other device. It should work without hassle.
-
Hi all,
I have a problem when I am trying to run a jar file from an applet. The jar is for remote desktop application. Jrdp.jar.
And the Exception is���.
Exception in thread "Thread-6" java.security.AccessControlException: access denied (java.util.PropertyPermission gnu.posixly_correct read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at gnu.getopt.Getopt.<init>(Getopt.java:617)
at gnu.getopt.Getopt.<init>(Getopt.java:581)
at net.propero.rdp.Rdesktop.main(Rdesktop.java:290)
at net.propero.rdp.applet.RdpThread.run(RdpApplet.java:190)
can any one suggest me what I have to do???? Plz give your valuable suggestion in that matter. Should I have to do any thing in java.policy file. In that case what would be the syntax and what have allow. If possible plz help me out.
Thanking you,
With regards
Shibaji SabyalTry googling on how to sign your applet. The error you're getting can usually be solved by signing it.
-
Package Problem : Plz help
I've make two classes named First.java and Second.java in e:\javafiles\test\vg folder
package vg;
public class First
public int m = 100;
public int n = 200;
package vg;
public class Second
public static void me0()
System.out.println("Stupid cant u see the value of m is zero");
public static void mgrn()
System.out.println("Yaar m is greater than n");
public static void neven()
System.out.println("The value of n is Even");
and a Third class
import vg.*;
public class Last
public static void main(String robert[])
Second d = new Second();
First f = new First();
if(f.m==0)
d.me0();
if(f.m>f.n)
d.mgrn();
if((f.n%2)==0)
d.neven();
else
System.out.println("The value of n is Odd");
Now the problem is that if I put the Last.java at e:\javafiles\test and compile it , it works fine but if I put the Last.java anywhere else e.g at e:\javafiles and try to compile it it does not works and gives error
E:\JavaFiles>javac Last.java
Last.java:1: package vg does not exist
import vg.*;
even if I change classapth variable as E:\javafiles\test or even E:\javafiles\test\vg
plz help me in this regardYou need to change where it is trying to find the 'vg' package. So, if your Last.java is in e:\javafiles, then you need to
import test.vg.*
e.g.
import test.vg.*; // Change this line
public class Last
public static void main(String robert[])
Second d = new Second();
First f = new First();
if(f.m==0)
d.me0();
if(f.m>f.n)
d.mgrn();
if((f.n%2)==0)
d.neven();
else
System.out.println("The value of n is Odd");
Alan -
please any body can solve my problem?
i have n95
when i open gps application
then on the screen globe is not showning and no maps are showing on screen
only city names are showed
and after the closing of map application in apst there are type on screen
saving maps and data
but now nothing typed
plz help mei am using latest firm ware
and using old maps application bcoz new beta 2.0 not showing my accurate position in pakistan
if i am in my city
the maps application shows u r 10 km from your city
but old version give me accurate position... -
ps4 can ON got sound can control but no image and also the color on the top is white...
Sry for my bad english.... I have try other HDMI but still the same problem. The problem is when I turn on the ps4 the LED on top of the ps4 turn from blue to white. Then when it's started there no image the screen is black, but have sound and I can control it with my controller. I also try to plug in my HDMI from my laptop to the TV and there no problem what so ever.. Plz help :<
-
hi to all
Using form6i and run in client server. i cant solve this problem please help to all master :
I have a text item in forms and button. When i type the Customer_Name in text item then all names appears in reports, i want that when i type the name, only that name will appear .
Please check what is wrong with my code and steps.
In report wizard, query statement i put "Select * from S_customer"
then i call the report in forms..
Report Property pallette:
Other Parameters=Customer_Name
Query names=Select * from s_Customer where Customer_Name=:rep(the text item)
then in forms the button trigger is when button pressed.below is the code:
declare
v_Rep varchar2(100);
repid report_object;
Begin
repid := find_report_object('report');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,’s_customer=’||:Dept.rep);
v_rep := run_report_object(repid);
end;
advance tnx to allHi,
You need to bulid a parameter list.
This is a code sample to run a report from Forms:
(Place it on a button when-button-pressed trigger, to run the report).
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
-- this is the parameter list
pl_id ParamList;
pl_name VARCHAR2(10) := 'tempdata';
BEGIN
-- try to find the parameter list
pl_id := Get_Parameter_List(pl_name);
IF Id_Null(pl_id) THEN
-- if parameter lsit does not exist
-- create it
pl_id := Create_Parameter_List(pl_name);
IF Id_Null(pl_id) THEN
Message('Error creating parameter list '||pl_name);
RAISE Form_Trigger_Failure;
END IF;
ELSE
Message('Parameter list '||pl_name||' already exists!');
-- destroy it to clear old parameters
-- and create it again;
destroy_parameter_list(pl_id);
pl_id := Create_Parameter_List(pl_name);
END IF;
Add_Parameter(pl_id,'p_customer_name',TEXT_PARAMETER,:customer.cust_name);
-- add as many parameters as needed
-- finally run the report passing your parameter list
repid := FIND_REPORT_OBJECT('report4');
v_rep := RUN_REPORT_OBJECT(repid, pl_id);
Exception
when others then
Message('Error running report. '||sqlerrm, acknowledge);
END;
Also, you need to create the parameter in your report:
1.- Open your report on reports builder.
2.- Find the "Data Model" node, and the "User parameters" node.
3.- Create a parameter: p_customer_name
4.- Modify your sql from:
Select * from S_customer
TO:
Select * from S_customer
where Customer_Name=:p_customer_name;
If you want this parameter to be optional, check the reports online help on "Lexical References".
Have fun,
Hugo -
I'm unable connect my I pad mini to my laptop(window 7,64 bit) after formatting,my iTunes didn't find my device,before format everything working properly but this time lot of problem plz help
You formatted your computer's hard drive? If so, it's like starting with a new computer unless you restored all of your content from a backup but it does;t sound like that's the case.
See wjosten's excellent how-to here: Syncing to a "New" Computer or replacing a "crashed" Hard Drive
Maybe you are looking for
-
How to turn off private browsing mode to read kindle cloud
I have purchased kindle ebook to read from iPad. Told private browsing mode needs to be turned off. How is that done?
-
Oracle 8i Personal Install corrupts Sun Java 2 development environment
I encountered no errors during installation of Oracle 8i Personal for Windows/NT; and the sample database appears fully functional. However, the Sun Java 2 development kit (JDK 1.2) that I use for other projects is no longer functional. The registry
-
Examples in ABAP for initial and end rotine
Ola expert´s, I´m trying to write a program in Initial Routine and End Routine (Transformation), but some declarations are diferent and so is the logic. In fact, I need some examples for declarations (variable, internal table, etc.) and some examples
-
I am listening to a radio station on my windows media and it keeps shutting off because of firefox
The station will play for a few minutes then shuts off stating that my firewall is blocking it
-
ITunes fragt immer wieder nach Username und Passwort
Guten Morgen ihr Lieben, habe ein kleines Problem. Seit Tagen kann ich ich nicht mehr bei Itunes anmelden.Komme zwar in meinen Account, soll dan aber meine Rechnungsdaten hinterlegen. Ich will mich mit meinen Daten einloggen, drücke auf senden und ko