Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing parameters between servlets

 
John Ip
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I got a situation here.

I have a chain of servlets each doing a part in a registration process.
servlet1 - request user to input a username and password
servlet2 - request user to input details and resume
servlet3 - create user in the datastore and acknowledge the user

At first I pass the parameter in the URL between servlets. Here is how I did.

function next() {
window.url = "servlet3?details=details&resume=resume";
}

It all works fine, a new servlet3 got initialized and the parameters got across to servlet3. And for some reason I don't want to post any constraint to the size of the resume. Problem comes when the resume is too long which hit the max length limit of the URL allowed by IE. So I try to use HTTP post request instead. Here is my code

function next() {
document.details.submit();
}

<form name="details" method="post" action="servlet3">
<input type="text" />
......
</form>

I dunno why this time a new servlet3 didn't get initializied and the parameters post to the servlet2 instead. Does anyone know what will be the problem and other idea to solve my problem? Say cookies..... cookies has a max limit for 4k as fas as I know...... so I am a bit frustrated........

Thanks for your time!
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you just check action property of details before submit? It seems to have wrong value.
 
John Ip
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the problem. Thanks a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic