• Post Reply Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect

 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have written something like this in my servlet.

response.sendRedirect(/contextRoot/WEB-INF/a.html)

but,when i run this ,it says, resource a.html not found at mentioned location, while it is there.

If i write : response.sendRedirect(/contextRoot/htmls/a.html),

it is perfectly redirecting control to mentioned html.

Does it mean, through response.sendRedirect, i can't go inside WEB-INF directory.
Please help.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing that's inside of WEB-INF will ever be served directly to a client. You can perform a server-side forward to it, but not a client-side redirect.
 
Pradeeep Sharma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

you have to put all .html files outside the WEB-INF folder because the part inside the WEB-INF is not accessible to client. That's why all files like .js,.jsp,.html,.css etc. are all placed in parallel with WEB-INF, not in it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!