• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

response.sendRedirect

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic