• 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

passing a hidden values to servlets from HTML

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
i'm designing an index page consists of links to some of my JSP pages and some
send to my ControllerServlet by "POST" method.The problem is how do i pass different types of hidden values to my ControllerServlet. i was trying to create a multipe forms but it wasn't working at all. to help me
here is my code
-------------------------------------------------------------
<body><form action="/control" method="POST">
<p><a href="http://localhost:8070/JSP/AddNewEmployee.jsp">Add Employee</a></p>
<p><a href="http://localhost:8070/JSP/AddNewGroup.jsp">Add Group</a></p>
<p><input type=hidden name="action" value="findAllEmployee"/><input type="submit" value="List all Employee" name="btnListallEmp"/> List All Employee</p>
</form>
<form action="/control" method=post>
<p><input type=hidden name="action" value="findAllGroup"/><input type="submit" value="List all Group" name="btnListallEmp"/> List All Group</p>
</form>
</body>

help to get better solution


thanks
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not great at Javascript, but how about this:

 
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why don't use the controller for dispatching all requests?
THose two links to JSP do not seem a good design.
Try this:

[ September 12, 2006: Message edited by: Oricio Ocle ]
 
sharaf navas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks guys
i did but further i get this error

Its seems to be like that i shouldn't add any write on response stream. but i haven't added any of out.write on my Servlet
help need
 
Oricio Ocle
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the message is clear. Your controller was fordwarding after the response was commited.
This seems to be a specific problem of your framework, maybe caused by a wrong configuration...
You could find more useful information in other forums, such jsp forum or application frameworks...
Regards
 
sharaf navas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you..
 
reply
    Bookmark Topic Watch Topic
  • New Topic