Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to send an attribute to servlet via form action?

 
Rafael Prado
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My form goes like this:

The servlet must know if the user is logging in or out, so, besides sending the url, it should send either the 'login' word or 'logoff'.
Anyways, the problem is that neither attributes are being received by the request, which goes in this loop:

What different treatment should I give to url and acao parameters?
 
Paul Lester
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Should be:

Notice no single quotes and an ampersand instead of a comma.
Paul
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make them hidden fields in the form
<input type=hidden name="url" value="'principal.jsp">
Placing attributes in the action tag is poorly supported in browsers and therefore will behave differently depending on what the client is using.
Dave
 
Rafael Prado
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick replies.
The url and action could be read.
Now the result is the browser completely blank.
The servlet does:

if everything goes fine and nothing more. Am I missing something?
EDIT: Checking to see if an exception is being thrown I saw it worked.
http://localhost:8080/caiu/AgComunicador
is the address shown. Shouldn't it be http://localhost:8080/caiu/principal.jsp since it was the url in redirect?
[ May 19, 2003: Message edited by: Rafael Prado ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using getParameter("string") rather than getParameterValues("string")[0]
Dave
 
Rafael Prado
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not yet. I'm getting the same results.
Tried with http://localhost:8080/caiu/principal.jsp and still no luck.
Note that this url can be accessed when typed in the browser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic