This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing resources in /WEB-INF/

 
Timothy Sam
Ranch Hand
Posts: 751
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I was wondering if this would be perfectly legal...



thanks!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two problems with this.
1.) The WEB-INF directory is off limits to browsers.
2.) Redirecting will cause a new request to be generated (which means you won't have your "error" attribute by the time you get to the JSP).

If you did the same thing with a forward, both problems would be solved.

Response.redirect sends a header down to the browser instructing it to make a new request with the given URL. RequestDispatcher.forward, on the other hand, is handled from within the same request and completely on the server.
The browser never knows that it has happened.
[ August 15, 2006: Message edited by: Ben Souther ]
 
Timothy Sam
Ranch Hand
Posts: 751
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, my doubts are now cleared!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic