• Post Reply Bookmark Topic Watch Topic
  • New Topic

HF - pg 213 - #E

Henrik Krievs
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried to make the getAttribute("javax.servlet.forward.query_string") - to work - but it won't.

Anyone succeeded ?

The "regular" - getQueryString works fine for me......

Rgds, Henrik
Kathy Sierra
Cowgirl and Author
Posts: 1589
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is correct, but we left them out of the book!!!

You *must* be familiar with the "extra" request attributes that are set by the Container. These are accessible from the forwarded servlet via the getAttribute() method on the request object. You do not need to know ANY details other than what these are, and there are no *tricky* questions on the exam about them. You simply need to know that you can pass these to getAttribute().
Oh, and you must ALSO know that these are NOT set (and thus not available) if the servlet was obtained by using getNamedDispatcher().

This is all from page 66 in the spec:

ALL begin with javax.servlet.forward...

* request_uri
* context_path
* servlet_path
* path_info
* query_string

So, answer E comes from this list. Not sure why it isn't working for you, but it is a correct answer. You can expect to see either 0 or 1 question about this on the *real* exam... since it (the extra request attributes set by the Container) falls under only a *part* of one of the objectives for the exam.

Sorry about this--so again, the *answer* in our exam is correct, but we failed to put this list into the book anywhere, so you're stuck looking it up in the spec (or right here). I'm going to make an additional note about this for the web site.

Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!