Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Basic Authentication in request Object ?

  Asked By: Dale    Date: Jun 21    Category: Java    Views: 963
  

I want to upload files in a directory, for that I m using jsp:smart,
the problem is I want to send the Authorization header along with the
request to upload the file send from the browser.
There is no method provided in the HttpServletRequest.
And I dont want to use
http://username:password@mysite.com/upload.jsp

How can I modify the request object before sedning it to the
upload.jsp.

Actually when using this approach
http://username:password@mysite.com/upload.jsp doesnt work,
1) MY first JSP sends the request to the second JSP that adds the
username and password
(http://username:password@mysite.com/upload.jsp ) and redirects the
page to the upload Jsp that requires Authorization header in her
request to upload the file in the protected directory.

2) if i use jsp:forward and change the url to relative i.e
<jsp:forward page ="username:password@... "/> it does'nt
works. (Tomcat could not find the directory)

3) if I use response.sendRedirect
("http://username:password@mysite.com/upload.jsp"); it successfully
redirect the JSP but when I see the Headers list in the upload JSP i
can not find the Authorization Header.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Basic Authentication in request Object ? Or get search suggestion and latest updates.




Tagged: