on 08-23-2005 3:44 AM
Hi ,
I am using Headervariable login module(which takes user id form http header variable) for single sign on.
I configured the login module stack. But to test i need a jsp from which i can pass the user id in http header.
to test if i am able to set the user id in http header , i have written 2 jsps
1. Header.jsp
In this , i am setting the user id
response.addHeader("UserId" ,"user1");
and i am posting it to HeaderResult.jsp
2.HeaderResult.jsp
In this, i am tryng to rretrieve it By using
request.getHeader("UserId");
But i am not geeting any value.
Can i set user defined header variables?if not, can i set the standard http header variabes,
Please help me with the code.
Thanks,
Lakshmi
Hi Lakshmi,
I have the same problem what u have. Did u solve that Set and Get Header Problem?If so, can u send me the idea of how to solve to my mail id:
sanvani111@rediffmail.com
Thanks,
Sangeetha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lashmi,
or simply put the userid as a hidden variable in the java or servlet like this ,
<input type=hidden value="usrid">
and in the jsp file just get this value back using request.getparameter();
<% request.getParameter(<ur textboxname here >);
Why r u sending userid as a header from one jsp to other?I dont understand this.
hope it helps.
rdgs,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshmi,
Did you have getter & setter methods in your DAO java class.If not write a simple java class which exposes these methods.Once you set the methods you can get the value from these methods.
Also did you try request.getParameter where you hv set in the jsp.
Regards,
Guru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Lakshmi,
Is there any special reason so that you want to send the userId as a header? When you invoke the response.addHeader() you modify the headers of the response, which are different from the headers of the request. If you want to modify the request you can use filters. Why don't you try to send the user ID as a cookie instead of a header?
Kind Regards
Vyara
Hi Vyara,
You are right,when i add response.addHeader() , it is getting added in the response header. I wanted that in te Request Header. becacuse the header variable login whih i am requesing , will take the Userid fro the Request header. yes i tried setting in the cookie. i see the variable Userid in request, can it be accessed by normal variable? or while retreiving , do we have to retreive it from the cookie.
can ypou send me some code how to change request header using fileters?
Thanks,
Lakshmi.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.