Passing form data from html page to JSP page

Hi,
I have a simple HTML page with a form on it that sends the information to a JSP page that stores the form data in a JSP session. I created a simple form that asks for the user's name, sends it to the JSP page, stores that in a session, then sends it to another JSP page which displays the name. This worked fine.
However, I added another input box to my form that asks for the user's age to do the same steps as outlined above. This does not work, and I'm not sure why. Here's the code from my HTML page:
<form method=post action="savename.jsp">
What's your name?
<input type=text name=username size=20 />
<p />
What's your age?
<input type=text name=age size=20 />
<p />
<input type=submit />Here's the code from my JSP page, savename.jsp (later on in the JSP page it links to another page, but that is not relevant):
<%
String name = request.getParameter("username");
String age = request.getParamater("age");
session.setAttribute("theName", name);
session.setAttribute("theAge", age);
%>Finally, here is the error message from Tomcat 6.0.9:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 3 in the jsp file: /savename.jsp
The method getParamater(String) is undefined for the type HttpServletRequest
1: <%
2: String name = request.getParameter("username");
3: String age = request.getParamater("age");
4: session.setAttribute("theName", name);
5: session.setAttribute("theAge", age);
6: %>
Stacktrace:
     org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
     org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
     org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)I do not understand the error, as it works fine when I simply try to retrieve "theName", but breaks when I try to retrieve both.
What is it I am missing here?
Thanks,
Dan

Ummm.... you misspelled "parameter" the second time
you tried to use it.......
That is incredibly embarrassing. Sorry if I made anyone think it was something more serious. Holy mackerel, I think it's time for me to read over my code much more carefully before posting about a problem.
Thanks for the help DrClap.

Similar Messages

  • Passing form data from Insert/Update pages...

    I need to take the data the user types into the fields and
    display it on the following page after the record is
    inserted/updated. (Please don't send me to the documention on the
    web site...it is outdated and does not work with later versions of
    Dreamweaver)
    Here is a sample of the code:
    $insertSQL = sprintf("INSERT INTO foil (firstname, lastname,
    businessname, street, city, `state`, zip, phone, email,
    Delivered_List, Inspect_by, record_description) VALUES (%s, %s, %s,
    %s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['FirstName'], "text"),
    GetSQLValueString($_POST['LastName'], "text"),
    GetSQLValueString($_POST['BusinessName'], "text"),
    GetSQLValueString($_POST['Street'], "text"),
    GetSQLValueString($_POST['City'], "text"),
    Where do I insert the session code? Is there an extention for
    this?
    Thanks for any help.

    Do you want to display the value of a form field on the
    result page:
    <?php echo $_POST['FirstName']; ?>
    OR do you want to make a session variable from the value of
    the form input;
    goto Bindings Panel > click + > click Session Variable,
    enter name for variable in dialog box, then move cursor to after
    the insert sql and before the redirect code and from the bindings
    panel select your session variable and click Bind. Then copy the
    value you want to become the session var. like this
    $_SESSION['USER_FNAME'] = $_POST['FirstName'];

  • Pass data from a variable to another page

    Hi,
    I have a "select one choice" field from a page. I want to pass the data from that field to another page.
    Any ideas on how to do it?
    Thanks!

    drag and drop a list form data control onto your page as SOC.
    In the value change event get value like, valueChangeEvent.getNewValue()
                                            <af:selectOneChoice value="#{bindings.Return.inputValue}"
                                                                label="Plan:"
                                                                autoSubmit="true"
                                                                unselectedLabel="Please select a value
                                                                id="soc1"
                                                                valueChangeListener="#{MyBean.planValueChangeEvent}">
                                                 <af:forEach items="#{bindings.Return.items}"
                                                             var="pln">
                                                      <af:selectItem label="#{pln.label}"
                                                                     value="#{pln.value}" id="si3"/>
                                                 </af:forEach>
                                            </af:selectOneChoice>

  • Pass the data from a form in workflow to z table

    Hi all,
    How can I pass the data from a form in workflow to z table?

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • Passing data from PCUI application to BSP page

    Hi,
    From CRM PCUI application, a BSP page is called for displaying a report. The behaviour of the report has to be different based on a data (field value) in the PCUI application.
    How can I pass the data from PCUI application to the BSP page?
    Thanks & Regards
    G.Raja

    Hi Gregor,
    The weblog was very useful. Thank you.
    In the current scenario, in the PCUI application there is a button, on clicking which a bsp page is displayed. This is implemented via the Navigation (URL generation) in CRMC_BLUEPRINT table. In the BSP page, on entering the details and clicking on a button, different APIs have to be called based on a flag. The flag is set in PCUI application but I couldn't pass the information from there to the BSP page. Can you please let me know how I can achieve this.
    Thanks & Regards
    G.Raja

  • How to pass a data from child window to parent window

    Hi,
    I have a jsp page with two hidden fields and a button, On clicking the button a popup will come out. There are two combobox in the popup and a search button. After putting a value in the comboboxes,if I click the search button, I need the datas of the combobox to pass to the parent's hidden fields then I need to do a data base search with that values of hidden fields and display the result in the parent page.
    I could I solve this problem, Please help, Its urgent.
    Thanks and Regards
    Rajib Sharma

    I think that you can use the JavaScipt as follow to pass a data from child window to parent window
    <HEAD>
    <script>
    function passData(){
    opener.form1.test1.value=form2.test2.value; //pass the value of test2 to the parent's test1
    window.close();
    </script>
    </HEAD>
    <BODY>
    <form name=form2>
    <input name=test2 type=text>
    <input type=button onclick="passData()" value=CLOSE>
    </form>
    </BODY>

  • HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?

    HI,
    HOW TO PASS THE DATA FROM SELECTION SCREEN TO STANDARD TRANSACTION?
    thanks,
    samba.

    By selection screen, what do you mean?   There is no selection screen in WDA as there was in classic dynpro. Do you mean you are using the Select-Options reusable component?  Are you wanting to call a standard transaction via ITS - SAPGUI for HTML?  Please provide more details to your question.

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • Pass transaction data from an InfoProvider to the BPC within BW

    Hi Gurus,
    I need to pass transaction data from an InfoProvider to the BPC Real-Time InfoCube, but I need to do from BW, and not from the BPC Excel interface.
    The reason is that I want to make the whole process in one step, and at the beginning of the process the end-user has to introduce some parameters in the BW, as we are launching the process chain from a transaction.
    Therefor I copied the process chain /CPMB/LOAD_INFOPROVIDER and tried to introduce the different parameters that are normally delivered by the prompt in the excel interface.
    Can anybody help? Does anybody know what parameters for each process type have to be introduced, in what form and if all the process types are needed?
    Making it with a normal BW transformation is also not an option, as we don't want to change from plan mode and stop people from planning.
    It is very important for my end user to do everything in one step, without having to enter the BPC Excel interface.
    Thanks in advance.
    Cheers,
    Àlex

    Hi Frank,
    I have checked and we have many processes in SM50 available for the job to use. Sometimes there are no other jobs running in the BW System except for the 2 jobs but still the 2nd job waits for the first to finish.
    I did another check on transaction code SM58 in BW System. Here it shows all the transactional RFC queues that is being generated by the 2 jobs. I saw that only TRFC queues are able to execute at one time. I am not sure if this is the problem but is it possible to set the number of queues that can be executed at one time to more than 2? If yes, where can I find such a setting?
    This is quite urgent as this problem causes all my jobs to end very late.
    Thanks.
    Shunhui.

  • Send form data from Coldfusion to ASP

    I need to send form data from CF to ASP.
    I submit a CF page and validate it on my end with another CF
    page, which then needs to post the results to an asp page on
    another site. The post has to be sent via SSL and I don't need to
    and cannot receive any status message back from the remote ASP
    site. Any suggestions would be greatly appreciated. I was thinking
    some type of cfhttp, but I am not very familiar with its usage.
    Thanks!

    It doesn't matter what type of page you are sending to as
    long as it can handle the data that is sent. Either a form or
    cfhttp will work.

  • How to pass the data from a input table to RFC data service?

    Hi,
    I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
    I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
    Thanks for your answer.

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • Not able pass the data from component to other component.

    Hello All
    I am not able pass the data from component to other component.
    I have done like this.
    1 Main Component (Parent component ) having below  two child components.Embeded as used components.
    2)     Search Component  and Details Component
    3)     In the Search Component having buttons,  Say : Button u201CXu201D on click of button I am navigating to Details component view through FPM.
    4)     When I am clicking above button u201CXu201D raising the event to call the parent   business logic method, there I am getting  Structure with values and binded this structure to the node and Mapped this node to the Details component  interface node. FYI : I kept the debugging point Structure is having data , I had set static attributes table to node instance.
    5)     In the Details component node data is not coming mean empty.
    Thanks in Advance.
    Br-
    CW
    Edited by: CarlinWilliams on Jul 4, 2011 9:21 AM

    Hi,
    When you use input Ext. check that the parent component should not be used as used component in child component.
    Only in the parent component the child components should be used as used components and the usage has to be created for the
    Child Components and the binding of the Node should be done from comp. controller of parent component to child node
    by which you will be able to see double arrow against the node.This should work
    Thanks,
    Shailaja Ainala.

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

  • Regarding how to pass the data from web dynpro to workflow

    hi gurus,
    how to pass the data from web dynpro to workflow.
    Regards
    vijay

    Check this [thread|SAP_WAPI_START_WORKFLOW;

  • How to pass realtime data from a sub vi to a calling vi?

    I'm trying to pass some data from a called (sub) vi to the calling vi,
    while the sub vi is running. I've tried passing to a global, but the
    calling vi doesn't show the results until the sub vi has completed
    execution. I understand why this is happening, I'd like a method, if
    one exists, to work around it.
    Thanks!
    Bill

    You've done several things incorrectly. First, the subVI has a while loop that terminates with a front panel Boolean. Since you don't make the front panel of the subVI visible, the subVI just runs with no way to stop it. When you call a subVI, execution passes to the subVI and the calling VI is paused. Since the subVI has no way to stop and return to the main, the while loop in the main is not running and reading the global variable. If you were to drag the subVI outside the while loop, then you would see the global update. You still would need to make the subVI visible in order to be able to press it's stop button. Of course, with the subVI visible, it's front panel is showing the value getting updated and there's no reason to have a global in the main anyway.
    If you want to have a subVI remain hidden, you can't use a while loop with a front panel control that's needed to stop it. Well, you can but that gets kind of complicated. If you do have a subVI and want to update an indictor with a global, the reading of the globabl should be done in a separate while loop. To keep the update in the same loop, don't use a global. You can create a reference to a front panel indicator and pass that to the subVI. The subVI writes to the value property. Here's a real simple example of that in 7.0.
    Attachments:
    Reference.llb ‏23 KB

Maybe you are looking for

  • Internal Table attached as Excel file to an eMail - BCS_EXAMPLE_7 for UC

    Hi forums, SAP provided an example report to send out internal tables attached as an Excel file to a recipients eMail address. I attached the coding of the BCS_EXAMPLE_7 programm to this thread. report bcs_example_7. This report provides an example f

  • Page won't open automatically upon startup.

    I used to be able to start up the computer and Safari would come up with my designated home page open. Now Safari comes up but I have to go to file - new window to see my homepage otherwise I have a blank screen with no page open. How can I have it a

  • Too many shared computers

    I work for a University that has approximately 2,500 computers on its network. The "Shared" section in the Finder sees every one of those computers (a very large majority PC). The only systems I'm interested in are the Macs (15 total) used by the oth

  • Regarding Material and Plant

    Hi , In what table we can find which material belongs to which plant . Regards Raj

  • Background on google has turned black?

    The background on google/safari on my iphone 4 has turned black (the URL bar at the top of the screen and the navigation bar along the bottom). It's only on Google, the rest of the phone is fine. I've updated to iOS5.1, tried doing a factory restore,