Rahul Birdie

Greenhorn
+ Follow
since Oct 31, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rahul Birdie

i have looked at the interface but setheader,addheader,setstatus,senderror are the methods i can use and i have tried all of them.I have used filters too but still nothin.In DD i even have specified <error> tags.I still cant figure out what to do.....
16 years ago
I am trying to create a test env. for which i need to set an error status say 403...but i am not able to do it...i have tried setstatus(403) and the setHeader(SC_ , message) but i am not getting the status in the jsp.I am using only one jsp page.


Thanks
16 years ago
I have tried requestdispatcher too,doesnt seem to set the header....i dont see it in live http header..

GET /StatusReturn/StatusFilterCode/WebContent/WEB-INF/jsp/final.jsp HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-securid
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=E92B4D52912EB982974DD7D1F7AE4FCB

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=45DF1E1A2F08BBD1C421CAD57788EC9B; Path=/
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 383
Date: Thu, 01 Nov 2007 01:10:10 GMT
16 years ago
here is my servlet :
public void doGet(HttpServletRequest request, HttpServletResponse response){
response.addHeader("name", "rahul");
response.setHeader("name", "rahul");
response.sendRedirect("/some.jsp");}


in my JSP :
<%
Enumeration e =request.getHeaderNames();
while(e.hasMoreElements()){
String header= String.valueOf(e.nextElement());
out.println("Header :" + e.nextElement()+ "<BR>");
out.println("Value : " + request.getHeader(header));
}%>


I am using livehttp header too to check the header.Output from live http


GET /StatusReturn/StatusFilterCode/WebContent/WEB-INF/jsp/final.jsp HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-securid
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=54411B48ED5F49AD57DE911CD31A839A

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=4BCAE7B35828BE3426D0EAA075AE4B0C; Path=/
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 273
Date: Wed, 31 Oct 2007 23:35:24 GMT
[ October 31, 2007: Message edited by: Rahul Birdie ]
16 years ago
Hi,
I am having problem setting custom header in my response.I have tried using setHeader(),addHeader()...but i dont see the header in the response.Read some where that we can override setheader() in our response wrapper class.Can some one please tell me how to do that.

thanks in advance
16 years ago