Aashima Arora

Ranch Hand
+ Follow
since Jun 15, 2010
Aashima likes ...
Netbeans IDE Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aashima Arora

Ohhhhh!!! That was the missing link! Thank You So Much Frits! You cleared all my doubts ! :-)
iam preparing for scwcd from hfsj on which it says 2nd edition and updated to cover scwcd for j2ee 1.5? what is the exam code i should register for?
what are the other things i should do ?iam still on custom tags . its taking a lot of time to complete it . i have practiced most of the programs on the comp .only after that i attempt the questions given at the back. is it required or now should i focus on theory only .? what mock tests or other books should i study? i remember reading just Kand b for scjp and scoring low but passing the exam and low here means very low , i didt do any mocktest so i dont want to repeat it

Whats with the new JSP and servlets exam?? are web component devloper and jsp and servlets expert two different exams? which one is better and whose course has changed
A simple tag with attribute;

there is a movie class used in tag handler in tag handler class...

i dont know whether it should be used as a bean or in a scriptlet . its unclear whats happeng in k&b pg 521
mytag2.jsp


awesome_tag.tld


Movie.java


SimpleTag3.java




We are using tags to eliminate scriptlets. Now in this,without using a scriptlet how do i declare a List which i can then use as an attribute .??? may be i am forgetting something but at the moment i cant recall what to do.

Thanks A LOT !
jsessionID is not a parameter like other request parameters that are appended after the ?.
it is issued by the container and there is a container specific way of displaying it. the tomcat container uses (;) to append the jsessionID in the url , other containers might use other ways.
12 years ago
My friend,

There is no created unless you make a session object available in your servlet.

modify your code to contain

HttpSession session = request.getSession();
in your ADDCOOKIES servlet in the doGet() method and it will work! and your output will be

url will be


http://localhost:8084/forum/ReadCookies;jsessionid=43D452CD2DF674132EAB7B7B33DB851E?ReadURL=Submit+Query

and
output

Cookie data from request
Name:dbnameValue:oracle
Name:dbversionValue:10g
Name:JSESSIONIDValue:43D452CD2DF674132EAB7B7B33DB851E
Home
12 years ago
Got it ! RequestDispatcher kind of confused me a bit ..Thank you so much
12 years ago
iam so sorry for the wrong question, i meant to ask when does the cookie first appear in the browser? i realize that there is a set cookie header in response and in the request here is a cookie header . in this particular code only, when the request has been forwarded to the jsp, when is the response being send back to the client .? is it when the jsp page appears so @ that very moment the cookie is stored .

in the jsp


when i click on 'click me'
iam redirected to


can i retrieve cookies on the jsp page itself or when i send the request from this page, i can retrieve cookies only on the checkcookie servlet?

12 years ago
You want to create a session at login,

JSP by default has a session object set to NULL
if you want to create a session at login
use

session = request.getSession();

suppose there is member page you are redirecting to

in member page you can code



is that what you want?

12 years ago
i do not understand when is the cookie first created in the browser in the following code;




when we have forwarded the response to the resource , doesn't that mean the response has not yet been commited and hence the cookie should be created when the response is commited i.e when the jsp file is processed? or may be something else? i checked after i clicked submit in this, the cookie was created,iam little bit confused about working of request dispatcher,can anyone kindly explain ., thank you


12 years ago
You just burst my bubble...true , i dont know what was i thinking before asking such a question
thanks !
12 years ago
@ Matthew : Ohhh !! yes..so by that you mean when the chain.doFilter(..) method is called, the control is passed to the next filter or the servlet and when the servlet has generated a response, it comes back to doFilter(..) method and executes the statements beneath it ? is that what iam supposed to get??
12 years ago



This is the doFilter method to display header and footer to a servlet. iam not able to understand HOW is the chain.doFilter(request,response) method able to stop the footer from being printed right below the header. what is it actually doing ? because a filter can pass control to a servlet by using it but a servlet doesnt come back to filter?
also what is the exact difference between a chain.doFilter() and the do Filter method with a chain arguement?

Thanks very much :-)
12 years ago