vinal sen

Ranch Hand
+ Follow
since Dec 13, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vinal sen

Thank you Janez and Durran!

Last time,when there was a runtime error in the Jsp:useBean I had given "name" attribute instead of "id".
This time I have so many code problems,I will solve everything.

Janez,in case of redirect(),why is the bean person not found in the request scope?Any ideas?

Bear Bibeault,

I tried my code.It fails at runtime.

Are we not setting the attribute "person" in the request scope? then why is it trying to create a new instance?

Could you please explain.

Bear Bibeault,

1."set Property" will only work if the new instance is created,right?

new instance will never be created


1.there is already an existing attribute "person
2.even if there were not any,with only "type" attribute,no new instance will be created,right.

I found this code at headfirst servlets and jsp(page 420 Be the container)

here is the code

followed by comments in the book: fails at request time.the container knows that if you have only a type specified there must be a existing bean attribute of that name and scope.


my point is:

1.there is already a bean attribute "person" set at scope "request" in the servlet,right?which means the name property "fred" is not set and the original name "evan" is the answer.

2.if only "type" attribute is specified,there should be an existing bean by that name.what do you mean by existing bean? does the above example not mean there is an existing attribute in the request scope.

thank you very much in advance


Hai all, Could someone please help me with the code(from HFSJ) below:

JSP that does the include (contact.jsp)

The included header that uses the new param ("header.jsp")

<em> <strong> ${param.subtitle} </strong> </em>

The above example as given in the book,tries to set the subtitle based on the settings in the header.jsp.But it gets the value from "contact.jsp"

Are we using jsp:param just to set how they appear in the "contact.jsp".Is my understanding correct?

Please explain.

Thank you,Vinal

I have a voucher which expires on May 13th 2009 with free retake for $200. Valid in USA

If anyone is interested,please email at

15 years ago
I could not properly display the file structure.sorry.

under myapplication,I have


under WEB-INF, I have



thank you,Vinal
15 years ago
this is my application file structure


1.from myclasses,if I have to use RequestDispatcher what should be the path?

RequestDispatcher rd=request.getRequestDispatcher("result.jsp");
gives me error.

2.Do I have to map jsp file in web.xml?

Please help.Thanks in advance.

15 years ago
hai Sudhir!

Tried that also,did not work.Is there anything wrong with my jsp file.

15 years ago
In that example there is

1. "form.html" in which we enter the user name and click submit
2. "" - servlet which adds a cookie and transfer the control to a jsp which again takes to another servlet named "".in "checkcookie" we retrieve the cookie.

The problem is in the cookietest,trying to use the request dispatcher.I had saved the "result.jsp" directly under tomcat/webapps

when I use this code

it gives me Null Pointer Exception


results in result.jsp not found.

I checked the parameter name,cookie name and the location of the file.I am unable to locate the problem.Please help.

Thank you very much.Vinal

Note: replaced Cookie with Kookie to post this topic
15 years ago
Sorry Guys! I found out that I had failed to make a context param-name breed(instead it was ddd) thank you.

Moderators: could you please close the topic.thank you.
15 years ago
I have been trying to set attributes,using the context parameter and ServletContextListener interfaces.

When I try to test the program (after setting the attributes),the attribute value is null(It does not throw null pointer exception).I had given the context param name

what could be the reason?could someone please help me?

[ October 16, 2008: Message edited by: Bear Bibeault ]
15 years ago
to understand...though they have tried their very best with multiple teaching styles.I accept this subject will be boring without conversation style,pictures,etc.But I think some depth is required to make us understand.(eg. I could hardly understand if a big file structure is needed for the first beer application and if I cut down on some of the folders and store all the files in a single folder,nothing would work)

From the time,I started to setup tomcat I have been reading some other resource or internet besides this book.

Has anyone tried Hanumant deshmukh 2nd edition and found it helpful?
Hello kuldeep!

I am also in the same stage as yours! Getting introduced to servlets for the first time.I also got errors like yours.

1.I did not change directory structure.I did it exactly as given in the book.
2.we receive the errors because:
a.we fail to copy the files in the deployment structure
b.we fail to correctly set the classpath,environment variables like catalina and java_home variable the classpath we forget to include servlet-api.jar

It worked perfectly after I corrected these mistakes.

15 years ago