Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xhtml and java code "response.setHeader()..."

843842Apr 24 2006
I use following java codes to prevent cache and unauthenticated access in my jsp file:
...
<%
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control","no-store" );
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
if (session.getAttribute("User") == null)
response.sendRedirect("./index.jsp");
%>
...

But if I use the same code in xhtml file I got error that xhtml doesn't support such codes.

Any solution?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 22 2006
Added on Apr 24 2006
0 comments
152 views