wood burning stoves 2.0*
The moose likes Servlets and the fly likes how to solve this? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to solve this?" Watch "how to solve this?" New topic
Author

how to solve this?

kavitha vasu
Ranch Hand

Joined: Feb 22, 2007
Posts: 70
Hi
Friends ,

Please Help me to solve this problem.

In my wep application , am having 2 request as JD10001,JD10002 as Pending request.

I Entered into the site with username as CCS and Password as CCS123. I selected the request JD10001 for Processing, but Process is not yet completed.

At the same time , I again i entered into site with same username and password in another one system.

now it shows the JD10001,JD10002 as pending request.

Actually the request JD10001 is selected by same user for processing , So it should not be shown as pending while login as second time.
How to achieve this?

Its very urgent , Help me to solve this.

Thanks
Kavitha
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
Hi kavitha ,
the web server does not care to check the username and password to see whio has made the request... for the server every request is a new one ( except when you are using sessions which you have not mentioned so i am assuming you are not using sessions ) so when you make the second request from another machine , although the username and password are the same for the server its a completely different request which has no connection to the previous request(s) , which is the reason why it is showing two pending requests rather than one....
although I dont see a reason why the same user will log on to the same site at the same time from two different machines...
anyhow my guess is to acheive this you will have to keep track of who logs into your site and which requests are pending for each of them ( you could mantain some sort of a lookup ) , so for example if user CSS logs in for the second time you will have to recognize that this user has already loged in and then load the pending requests for this user accordingly
[ April 21, 2008: Message edited by: abhishek pendkay ]

The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
kavitha vasu
Ranch Hand

Joined: Feb 22, 2007
Posts: 70
Hi abhishek,


Thanks for your clear Explanation. But How Can i Solve this by using sessions? The request should not be shown as pending while its in processing.

Please Let me know

Now This is my issue in my Project.

Thanks in advance
Laxmikant Ruikar
Greenhorn

Joined: Nov 29, 2005
Posts: 23
Abhishek, How can session used to track the two different request from different machine ?

Kavitha, you have to persit(or cache) the information of pending request in server side on the basis of user, then you can track which is pending or in process request.

LDR
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
Laxmikant I never said sessions can be used to solve this... all i said that I am posting a reply assuming that you are not using sessions ( although maybe that statement was unnecessary and it resulted in some confusion )...
In fact I agree that sessions may not be used in this situation..
the best that I can say is you can mantain some sort of a lookup ( a collection or DB table ) which mantains the list of pending requests for each user according to their usernames ( assuming usernames are unique ).
so when a user logs in you can add his username as an entry in the lookup and also in the same lookup mantain the list of pending requests for him..
as long as he does not logout his entry will be mantained in the lookup..
now if the user logs in for the second time you can check if his username already exists in the lookup , and if it does get the list of pending requests dynamically...
[ April 21, 2008: Message edited by: abhishek pendkay ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61064
    
  66

Please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

I have adjusted the subject of this post for you.

You can go back and change your post to add a more meaningful subject by clicking the .


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Also, there is not enough information in the original post to be able to give any meaningful answers.

If this is really urgent, Kavitha, you'd do well to take the time to tell us exactly how your pages work, with code samples if possible, so we can figure out where you've gone wrong.
[ April 21, 2008: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to solve this?