whats wrong with this servlet code..?no error in log

hello guys..hope one of you can help....

i have 2 servlet classes. one receives form data sent from a jsp page, then create a form object containing all the inputs.. that object is then added to the session ..

also, it construct a User object containing info about the present user and add it to the session.. IUser and Form are inner to the main class.

the first servlet (check) seems to work fine.. but the problem occurs with the second servlet...i have inserted some printl statements to help me identify how far it goes and it seems that the whole code of the second servlet(update) is almost redundant....I dont get any error message ..simply a blank page which is of course of no help to me...

I hate inserting long code here but i would be pleased if anyone could tell me of a way to find out about the actual problem..program compiles fine but..it just freezes at runtime

..here is part of the code..whats wrong?

HttpSession session=request.getSession();

User user2=(User)session.getAttribute("person");

Form fr=(Form)session.getAttribute("form");

System.out.println("User and Form created");

int uid=user2.getId(); //class User contain the getId method

String uname=user2.getName();

System.out.println("Data for user retrieved");

String goTo=fr.getC();

String password = fr.getP();

String email=fr.getE();

String newName=fr.getN();

System.out.println("data from form retrieved");

thanks

[1514 byte] By [ketsona] at [2007-10-3 0:09:33]
# 1

So how far in the system.out.printlns get displayed in your console?

Does the Servlet do any output (reminder that System.out does not print to the browser but tot the system console - or some log file)? Does it forward to another page? Print directly to the response?

Are there routes through the servlet (with if/else statements) that may lead to no output?

Are there loops that may be going on indefinitely?

stevejlukea at 2007-7-14 16:58:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

what i was actually tryng to do was to get a servlet to receive datas from two jsp pages and decide what action to take depending on the value of the hidden field.....so the code does in fact have loads of if statements...

because of all the errors, i have decided to only have one servlet per jsp page and it all seems to work fine now....

thankss

ketsona at 2007-7-14 16:58:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

two pages, two requests? are you holding info in session between requests? do you assume a certain order, or do you simply proceed when both have been received? how do you keep track of that? does the session time out if one arrives but the other does not? what do you tell the user in that case?

%

duffymoa at 2007-7-14 16:58:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

any exceptions thrown?

what happens if either of those session attributes are null?

who's adding those attributes to session - the first servlet?

are you sure you have a live session at this point? where are you checking?

got a SessionListener to remove those attributes when the session times out?

%

duffymoa at 2007-7-14 16:58:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

the first servlet was indeed supposed to *** all those attributes...

but the thing is that the data being retrieved later were not of the type expected...

i have now decided to proceed differently but I am a bit curious to lean more about something that you mentionned in relation to servlet listeners..i never thought of the need to remove all those attribute when the session times out...

I thought that it was doned automatically with a call to session.invalidate().

is that not the case?

thanks

ketsona at 2007-7-14 16:58:43 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...