Tarun Yadav

Ranch Hand
+ Follow
since Sep 20, 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 Tarun Yadav

Why do you think it might not be correct? Take a look at the syntax reference here if you want more clarification on what's to be used how.
Take a look at the attribute explanations for the attributes here. Basic differences:
- beanName can be a run time expression
- beanName works for serialized beans

And yes, you cannot use all the attributes together. Valid useBean tags can have:

* class
* class and type
* type and beanName
* type

Originally posted by Bert Bates:
I agree with everything said above, except I can't remember ever saying that HFSJ covers only 80% of what you'll need for the exam. Did we really say that? Where? I do know that we forgot to discuss dynamic attributes, but Bryan wrote up a nice tutorial for that and it's available for free here at the ranch. Other than that I'd be very grateful to anyone who can let us know topics that we missed.

Thanks and good luck,


Yikes! Sorry Bert, I just opened the book again. What it says it

We used an 80/20 approach. We assume you're that if you're going for a PhD in JSP, this won't be your only book. So we don't talk about everything. Just the stuff that you'll actually need.

For some reason, that stayed with me as "we cover 80% of what you need for the exam. That's enough to get you through. Go read the 20% elsewhere!"

Again, sorry about that. Will edit it out of my reply earlier.

P.S. When I was preparing for the exam, I thought that a 'Quick Exam Review' section would be welcome addition to HFSJ.
AFAIK, the specification doesn't mandate when the container should load a servlet ( unless using <load-on-startup> ).

So the container can load and instantiate the class whenever it needs to. By using <load-on-startup>, you can be sure that your servlets will be loaded when the app is starting up and be available. Otherwise, the order is pretty much random and on a need-to basis. A servlet may be ready and waiting for requests, or it may be loaded and initialized only when a request comes for it.

And I'm not very sure about this but yes, I don't think it's necessary for the init() to be called immediately when the servlet is instantiated. But it must be called before the servlet can service any requests.
That's correct but keep in mind that with an include(), you're sending the original request object (via server side call)but with a redirect you're sending a new request (by sending the location to the browser and asking it to ask for that resource).
[ October 26, 2007: Message edited by: Tarun Yadav ]
16 years ago
If you are able to view the expected source code but only have a problem with the display, that suggests that there is a problem rendering your page. Especially since you've only moved the <jsp:include> a little higher into some template text; it doesn't affect the execution in anyway.

I can't think of anything else. If you posted the actual code for page, ( without all your data of course, maybe only one or two rows ), that might help. Also, try viewing it with another browser, that might help see if this is actually the cause.
Also, I don't think this:

will work. You'll need to add the protocol information:

The first one will simply append "www.xx.com" to the current request path!
[ October 25, 2007: Message edited by: Tarun Yadav ]
16 years ago
Charles is absolutely right; it all depends on you, how you like to study, what style of learning suits you best.

Some people can simply mug up the API and clear the exam, some need lots of practice to actually get it. Some people like studying from reference books, some like non-linear styles as in HFSJ. Take a look at the books ( I'm pretty sure there are sample chapters to be found, check out Google Books ) and see which suits you best.

And Charles, sorry about not mentioning your book earlier. I wasn't really aware of it till after the exam so I haven't read it, but I've heard it mentioned at quite a few places and people had good things to say
I think the problem is with your HTML. If your code for the table was in fact just as you've shown, you might not get to see the data. That's probably why you could see it in the source but it wasn't rendered by the browser.

Remember, <table> should have <tr> and that should have <td> which should hold the actual data. Anywhere else, and you might see nothing!
You won't see anything in the browser since the response has already been committed. However, if you were to wrap it in a try/catch block, I'm sure you'd see it there.
I meant how are you trying to invoke the page from your servlet? I would expect you're using RequestDispatcher.include()?
16 years ago
How are you 'calling' the XHTML page?
16 years ago
You usually won't be using this, it'll be handled by the container.

For example, when you use a sendRedirect(), it causes a status code of 302 : temporary redirect ( though temporary redirect could also be 303 or 307, so I'm not sure ) as the response.