Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 48195 invoked from network); 4 Apr 2000 07:05:15 -0000 Received: from unknown (HELO vendaval.oviedo.syseca.es) (@195.55.39.3) by locus.apache.org with SMTP; 4 Apr 2000 07:05:15 -0000 X-Internal-ID: 387C3A620000545E Received: from oviedo.syseca.es (172.20.33.36) by vendaval.oviedo.syseca.es (NPlex 2.0.119) for tomcat-user@jakarta.apache.org; Tue, 4 Apr 2000 09:11:17 +0200 Message-ID: <38E99553.AD90B5C4@oviedo.syseca.es> Date: Tue, 04 Apr 2000 09:10:11 +0200 From: Juan Alvarez Ferrando X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-user@jakarta.apache.org Subject: Re: Passing parameters to a bean from a JSP References: <20000403195641.96222.qmail@hotmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This HTML: Example

Your Name:

With this hello.jsp: Example

Hello <% =request.getParameter("YOURNAME") %>

Should work. You can also check some of the examples at /path/to/tomcat/webapps/examples/jsp. Can you post come of your HTTML/Javascript and your JSP?. > > The request.getParameterNames() and request.ParameterValues() are returning > null. I am pulling values from the FORM using JavaScript so I know that the > fields are there and that they have values. How do I initialize the request > object so that I can pull FORM values from it? > > > > >Your FORM parameters and INPUT fileds are sent to your JSP in the same > >way that they are to a Servlet (after all your JSP are compiled into > >Servlets by the server). There's a HttpServletRequest object named > >'request' accesible in your JSP code through which you can extract the > >values of every parameter and INPUT field of the FORM submitted by the > >user. Check the Java API for the HttpServletRequest class. > > > >Jerry Thomas wrote: > > > > > > How do I extract data from a FORM and assign the data to a Java variable > > > that I have declared on my JSP? > > > > > > > > > > > > > I have data contained in a JavaScript variable that would like to > >pass > > > >to a > > > > > method on my Java bean. I have been successful retrieving data from > >my > > > >bean > > > > > into my JSP but I cannot figure out how to format the script so that > >I > > > >can > > > > > send data back to my bean through its methods. > > > > > > >You can pass parameters as FORM hidden fields that can be extracted > >from > > > >a > > > >servlet and finally passed through to the Bean. This is independent > >from > > > >the cookie policy set at the browser. > > > > > > > >Juan Alvarez Ferrando > > > > > > > > > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com > > -------------------------------------------------------------------------- > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > For additional commmands, email: tomcat-user-help@jakarta.apache.org