Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.IllegalStateException in Servlet

 
Peyyety Avinash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My page2.jsp (view1)



My controller and request dispatcher servlet :


My page4.jsp (view2)


Heres the error:


Please help !
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are trying to do operation on response which is committed already. I can see code redundancy in your servlet .

Logic:
1. get username , password and other details

2. create *a* Session , and set the details

3. at last forward[ *once *] to jsp page

P.S. Very bad Servlet!
 
Peyyety Avinash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks so much for getting back !
If this is not asking too much...can you please paste back
my code kicking out the unwanted code please !

I am bad at coding yaa and definitely that was a
bad bad servlet
 
Aman Goel
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your are forwarding the request before getting all the parameters....
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are new, I am posting formatted code[Still you need to improve below code!]
but dont expect code! . javaranch is not a code mill

 
Peyyety Avinash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot !!
javaranch is not a code mill
I got the point dude.
and, I created unecessary session and dispatch objects...Now I
figured out you just need one.
Thanks ! I am done
 
Peyyety Avinash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting directed from page2.jsp to page4.jsp (very fine, alright) after changing the controller servlet,
but all the attributes are printing null. None of the Attributes set to request object (of HttpRequest) are being fetched. why ?! please check my page4.jsp
 
Sony Agrawal
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set the attributes in request or session...
 
Peyyety Avinash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you set the attributes in request or session...

Ya now i changed it to session and its working fine
Thanks !!!
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peyyety Avinash wrote:Thanks !!!


You're welcome
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peyyety Avinash wrote:hey ranchers help me out...im waiting to finish off my project assignment before 6

EaseUp. PatienceIsAVirtue.

Expecting immediate help from a forum is unreasonable.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Plan ahead in the future. I removed your rude bump as a favor.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But now my quote/reply doesn't make any sense.

(Even more than usual.)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's why I posted -- so people would know you weren't crazy.
 
Peyyety Avinash
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh god ! I dint know that I walked into an Institution on the Internet. reminds me of school
(I owe an explaination to the esteemed moderators..I meant fellow ranchers, help me out !...we are all growing the java livestock on the java ranch aren't we..i dint exactly put down wat i meant though..so, sorry )
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good manners and good communication skills never go out of style.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic