File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Alternative to post and getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Alternative to post and getParameter" Watch "Alternative to post and getParameter" New topic

Alternative to post and getParameter

Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
Hi there,
I've just started working on a JSP, I have very little experience. I am starting by refactoring what I have.
Currently the jsp uses forms with textfields and a button. When the button gets pressed the values of the textfields can be retrieved via request.getParameter(<textfieldName> .
Now ths ok for communicating within my jsps but it is limited to passing Strings. If I could somehow say, when button "a" is pressed fire bit of code "storeStateInSession", I could store objects in the session and this would be much more powerfull. Is this possible ?
In a nutshell, I want do the JSP equivalent of adding a actionListener to a button.
[ January 09, 2003: Message edited by: Don Kiddick ]
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
HTML and HTTP don't work that way. You can start the POST by doing JavaScript on the client, but a post is always going to carry strings from your form fields.
Sorry, this ain't Swing.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
Thought that might be the answer. HTML is a quite limiting isn't it ?
Would be very nice if you could use Swing components... oh well, time to get my hacking axe out !
thanks for the answer,
I agree. Here's the link:
subject: Alternative to post and getParameter
It's not a secret anymore!