Shiwani Aggarwal

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

Recent posts by Shiwani Aggarwal

Could you let me know how to pass selected value from a combo box to servlet and then when jsp is agian displayed how to retain valuues user would have entered.
I have a jsp, where user need to enter some fields, like txt fields, combo, radio...when he clicke submit I need to get selected values in servlet..I am unable to get the value of combo field and date. Secondly after submit is clicked all these values should be reatined on the page but all goes off obviously. How do we do that?
21 years ago
Can any of you pls help me out?
21 years ago
The code in the servlet is:
if (request.getParameter("flag") != null)
lsFlag = request.getParameter("flag");
if (lsFlag.equals("Family"))
{
request.setAttribute("flag",lsFlag);
lPageDispatcher.showPage("/HomePage.jsp");
}
//Photo gallery and go from there
if (lsFlag.equals("Gallery"))
{
request.setAttribute("flag",lsFlag);
lPageDispatcher.showPage("/Gallery.jsp");
}

In the HomePage jsp: the flag is either set to Family or Gallery depending on which link is clicked. Now once I vidited Gallery jsp, everytime I run teh servlet, it goes to Gallery and does not bring up Home page from where I need to navigate.........I hope this clears. let me know if I confused you.
21 years ago
using dispatcher solved the problem, but now I have another one::
A flag if set to one value dispatches JSP - 1
setting to naother values dispatches -JSP 2
but now since it is already set, it always dispatched jsp2, how to reset that?
Thanks
21 years ago
How do I do that? I am novice in this area.......this is my fisrt servlet/JSP....
Thanks in advance
21 years ago
This is how I invoke the jsp, is this the wrong way?
response.sendRedirect("/AddTrx1.jsp");
21 years ago
I have created a servlet and a jsp. I have a method getname() that returns a vector of names in the servlet and this is sued as follows:
lvNames = getnames();
I used the following line to set this value so I can get this diplayed in JSP:
request.setAttribute("Names",lvNames);
In the JSP: I declare lvNames and then use the following:It gives NullPointerException. What should I do? Even if I try checking for null and then use the following, nothing is retuned in the vector, although servlets loga all valuses correctly.
lvNames = (Vector)request.getAttribute("Names");

Pls advise
Thanks
21 years ago
If I score 75% on marcus exams, and 90% on Rule round up, how easy it would be for SCJP?
I feel little weak in Threads, planning fro SCJP1.2
I have scheduled the exam but I am loosing confidence, but I have no choice of postpoing....
Pls advise for 11th hour tips?
class A implements Runnable {
public void run() {System.out.print(Thread.currentThread().getName());}
}
class B implements Runnable {
public void run() {
new A().run();
new Thread(new A(),"T2").run();
new Thread(new A(),"T3").start();
}
}
class C {
public static void main (String[] args) {
new Thread(new B(),"T1").start();
}
}
Can any one help me understand what is happening in this code> and waht will be output?
hi where are mock exams which most os SCJP aspiramt talk about. I looked at a site where it shows SCJP 1.4, can anyone direct me to SCJP 1.2 Dan;s exams?>
I don't know the answer to this but would like to add here==>
I do not think we ever acll start from a run method?
Thanks all
One of your pointed out on my name, Preeti is perfectly valid and my true name. (I understood that Pretty was not good!!) but just to let you know 3 out of every ten in India have this name. Whats wrong? Do you still suggest I need to change>
When I say
boolean b = true;
if(b = true) {//}
else {b) {}
Shouldn't it say a compile error as in the if it should be (b == true)instad of the above, Why this works juts fine.
Pls advise!
Thanks
I think this is true -
The elements in a Java array can only be of primitive types, not objects. Why this is wrong?
Thanks, it helps. Now I think, I had been stupid to ask this?