Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
bidmi robson wrote:can anyone please help out.i`m trying to make use of a relay servlet to manage request and responses.i also want to use a dao(data access object) to
connect to the database..the relay and login codes are hereby attached..can you please show me where to place my redirection to another page in the login code.i want to
forward the 2 group of users namely:admin and users to different pages...also how do i write a simple and effective dao
for this web application? thank you ....
Never Remember the failure
Never Forget the mistake
Chetan Natu wrote:
bidmi robson wrote:can anyone please help out.i`m trying to make use of a relay servlet to manage request and responses.i also want to use a dao(data access object) to
connect to the database..the relay and login codes are hereby attached..can you please show me where to place my redirection to another page in the login code.i want to
forward the 2 group of users namely:admin and users to different pages...also how do i write a simple and effective dao
for this web application? thank you ....
I'll take up the part which I have clearly understood.
What you can do is retrieve the information from the web page, while you are authenticating the user, retrieve the type/role of the user from the User Database (You can do this two ways, simple: pick from the database, difficult: map it with your userdirectory). Based on the role simply write an if..else code and redirect to corresponding servlet/JSP/component.
And of course it would help if you could attach the code as well
Hope that helps..
Never Remember the failure
Never Forget the mistake
Regards
KumarRaja
Kumar Raja wrote:Hi Bidmi,
From your code, it seems your post is going to Relay which is supposed to relay the task of authentication to another servlet (I don't know why). First of all, why do you need two servlets for this task. You could have called a DAO directly from relay and redirect the response to the respective page using RequestDispatcher or something like that. That seems to be pretty simple.
But just in case, you need to call another servlet, how are you managing the connection? Have you tried looking into Interservlet Communication another URL you should be looking is How communication. There are several things which you need to consider, whether both of your servlets running under same context or different.
Regards
KumarRaja
bidmi robson wrote:is there nobody who can take a look at this code and tell me what is wrong with it...all responses so far have not been helpful..
Regards
KumarRaja
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|