• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to send an attribute to servlet via form action?

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Should be:

Notice no single quotes and an ampersand instead of a comma.
Paul
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
machines help you to do more, but experience less. Experience this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic