rohit surve

Greenhorn
+ Follow
since Mar 19, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by rohit surve

I am getting these error what could be the problem..please help


15 years ago
hi,

i have one jsp page index.jsp in which i have 2 links login and register and a table of books which i had retrieved from bean Userform which stores books details.


INDEX.JSP



IN THIS ABOVE CODE : view is the arraylist whose getter and setter are declared in userform bean and /user is action which maps to userform and useraction for retrieving book details.

when a admin logs in in the login.jsp page i need to display a admin welcome page in which there is a homepage link which onclick i need to display index.jsp with
only table with one column extra and not the 2 links

when user logs in in the login.jsp page i need to display a user welcome page in which there is a homepage link which onclick i need to display only table and not 2 links .


when both logs out from their respective welcome pages i need to show table and 2 links ie login and registration .


i have this above index.jsp page on which i have to display necessary modifications..i have loginform and action and registerform and action classes which deals with login and registration. Whereas this index.jsp is related to only userform which stores book details .


please help...its urgent.
15 years ago
<b>i want to display table on first jsp page which i am retrieving from the database
i have form action defined on jsp pages and also struts config navigation is correct
how do i display table without using submit button on my jsp page ( it works when i use submit button its showing me the table )
please help.</b>
15 years ago
here is my jsp code :



My action class : UserAction.java




My fom class:
UseForm.java.



Book.java



please help...when i run i get error : javax.servlet.ServletException: javax.servlet.jsp.JspException: No getter method for property results of of bean UserForm


15 years ago
hey ritu thanks...whizlabs test are really good...it helped me a lot!!!
16 years ago
Here is the link abhishek...these mock test are for each chapter...these will make your concepts sharper...do chapter mock ups on your own and then see the answers...it will help you..Best of luck..cheers!!!

http://www.danchisholm.net/july21/mybook/index.html
16 years ago
I am so happy to have such a score...would not have been possible without all ranch mates...
thanks..for your support !!!
i had gone through as many post as i could 1 week before and these posts have really helped me in clearing my doubts...

i had gone through k&b book 4 times..had done dancholism mock exam..they are really good..
and had solved whizlabs , master exams and examlabs too....

i think real exam is very easy...but still examlabs by devaka and whizlabs tests can help you in building your confidence...as it did mine...thanks devaka for providing such a good tests...

Best of luck to all aspirants for the exam.
16 years ago
ya i know
but still s2 is a varibale in class A...and not in class B THEN x.s2 gives you A.s2 BUT reference of x is of type B..pleas explain as i am getting confused in this silly doubt...
ya i know
but still s2 is a varibale in class A...and not in class B THEN x.s2 gives you A.s2 BUT reference of x is of type B...HOW? thats the doubt
thanks Ryan i got it !!! but say if the argument is a wrapper

Integer i= 2;...argument to be passed

and if the method parameter are of object type and Number...How to go for this ?which one should i go for ?

danchisholm mocks ....


class A {String s1 = "A.s1"; String s2 = "A.s2";}
class B extends A {
String s1 = "B.s1";
public static void main(String args[]) {
B x = new B(); A y = (A)x;
System.out.println(x.s1+" "+x.s2+" "+y.s1+" "+y.s2);
}}

What is the result of attempting to compile and run the program?
a. Prints: B.s1 A.s2 B.s1 A.s2
b. Prints: B.s1 A.s2 A.s1 A.s2
c. Prints: A.s1 A.s2 B.s1 A.s2
d. Prints: A.s1 A.s2 A.s1 A.s2
e. Run-time error
f. Compile-time error
g. None of the above

answer : Prints: B.s1 A.s2 A.s1 A.s2

explanation ?
This is from danchisholm mock questions .....

1.
class GFC216 {
static String m(float i) {return "float";}
static String m(double i) {return "double";}
public static void main (String[] args) {
char a1 = 1; long b1 = 2; System.out.print(m(a1)+","+ m(b1));
}}

What is the result of attempting to compile and run the program?
a. Prints: float,float
b. Prints: float,double
c. Prints: double,float
d. Prints: double,double
e. Compile-time error
f. Run-time error
g. None of the above

answer is float,float...how ? please explain



In this case (question 2)answer is compile error ? how?

2.

class GFC217 {
static String m(int i) {return "int";}
static String m(float i) {return "float";}
public static void main (String[] args) {
long a1 = 1; double b1 = 2; System.out.print(m(a1)+","+ m(b1));
}}



What is the result of attempting to compile and run the program?
a. Prints: float,float
b. Prints: float,double
c. Prints: double,float
d. Prints: double,double
e. Compile-time error
f. Run-time error
g. None of the above
hey thanks adeel and sebastian(sorry that was printing mistake)...i got it...
hey adeel...

but as strings are immutable...therefore watever method you invoke on it its of no use unless you assign a reference to it...so here s3 is just a reference to new string instance with value ABCDEFG....but second time when you assign s4 to same value wont jvm assign s4 to the existing object with same value as per string pool...i know this a basic stuff and i am getting confuse in it...sorry for the trouble.
ya..i know == will return true only if two reference points to same object

say ,

String s1= new String("hi");
String s2=s1

in this case it will return true...

but my question is String s3= "EFG";
String s4= "EFG;

now as per string pool concept, value "EFG" is passed to the string pool and object will be created in heap so s3 will point to string instance with value "EFG"...and when JVM encounters same literal again it does not create a new object but will point the it reference to the existing object(to which s3 points).please rectify if i am wrong with explanation.thanks