wood burning stoves 2.0*
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
Author

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.
Tom
[ January 09, 2003: Message edited by: Don Kiddick ]
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ 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,
T.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Alternative to post and getParameter
 
Similar Threads
import excel data into mysql database?
Display a pdf in another jsp
Communication between JFrames
JSF Back Button Page Expiry || Please help
a jsp beginner question