aspose file tools*
The moose likes JSP and the fly likes passing hidden values to Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "passing hidden values to Servlets" Watch "passing hidden values to Servlets" New topic
Author

passing hidden values to Servlets

sharaf navas
Greenhorn

Joined: Aug 01, 2006
Posts: 25
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

Joined: Aug 25, 2005
Posts: 536
1. its onClick, not onKlick
2. you should be using form submit instead of onClick


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
sharaf navas
Greenhorn

Joined: Aug 01, 2006
Posts: 25
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

Joined: Jul 06, 2005
Posts: 1018
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

Joined: Aug 01, 2006
Posts: 25


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

Joined: Jan 10, 2002
Posts: 61218
    
  66

No additions to web.xml are necessary.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sharaf navas
Greenhorn

Joined: Aug 01, 2006
Posts: 25
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

Joined: Jan 10, 2002
Posts: 61218
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing hidden values to Servlets