Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServletRequest confusing methods

 
Alex Nemo
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) What are these methods for in HttpServletRequest interface?
these are very confusing in the API descriptions..

getPathInfo
getPathTranslated
getServerName
getServletPath
getRequestURI


2)When will the syntactic correctness of associated Tag files happen in a JSP ?
Will it happen During Page translation ?

3)Order of events during Web application start up?
Initialize Servlets with Load on Start Up
Initialize Filters
Initialize Listeners
ContextInitialized method is called on Listeners implementing ServletContextListener interface
[ June 05, 2007: Message edited by: Rav Kumar ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) PATH_INFO is kinda weird and rarely seen in J2EE. It is more common in CGI, and even still not all that common.

I took the URL of this thread and inserted a path info in bold:
http://www.javaranch.com/this/1/is/anexample?ubb=get_topic&f=18&t=011409

The other methods you are asking about should be fairly straight-forward by the API if you read the API's full description.

2) Well, mostly translation time. There's also the chance that the page simply won't recognize your tag and it will get passed along with your HTML and your browser probably will ignore it because it won't recognize the tag either. This can be frustrating when debugging because you have to view the HTML source from your browser to see that the tag was ignored at translation time.

3) Not sure if this ordering is guaranteed by the spec. If this ordering becomes a concern in your application, that should become a red flag that you are doing something wrong.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic