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

passing hidden values to Servlets

 
sharaf navas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI ALL i'm developing a MVC based web app

i wanted to pass my JSP " java object" to ControllerServlet where it should occur when i press a button which is generated on loop


if press the bttnSubmit how do i transfer my empVO.getEmpId() which returns a unique Id to another JSp to edit it via my ControllerServlet help me guys
thank you
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. its onClick, not onKlick
2. you should be using form submit instead of onClick
 
sharaf navas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lynette OnClick cannot be included while posting a code, and if i use submit for each and every buttons then how do i pass my hidden variable there??
 
Stefan Evans
Bartender
Posts: 1784
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a few ways
1 - make a url on each line
2 - use javascript to populate a hidden field and submit the form.

This is probably the quickest fix for IE. Dunno if Firefox supports window.navigate method, but window.location.href=... would be equivalent.





Here is an example of the second, using JSTL (because I like JSTL)



Cheers,
evnafets
 
sharaf navas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


thanks stefan. even i wold like to use JSTL since i'm using IntelliJ IDEA 5.02 i dont know how to configure it. even though i place all the essential jar's in the lib file even making a change in my web-xml
after this do i've to add any mapping in my web-xml for jstl?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No additions to web.xml are necessary.
 
sharaf navas
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Bear Bibeault

okay can you list me the steps hown do i configure the IDEA to use JSTL. since i've placed my neccessary JAR's in my lib dirctory under tomcat.
help needed

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once the jars are in the lib folder, all you need is the directive on each page to map the taglibs to their prefix.

Or you can do as I do and specify them as a prelude.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic