Jsp form help

Hello everyone out there'
I am a computer science teacher in a private high school in Nigeria and have some experience in java programming language and also new to the JSP tech .I want to introduce the school into using web applications in managing their infomation like registration,staff info,accounts e.t.c .They have asked me to make a presentation in two days time on web appllications ,i have decided to use JSP tech to demonstrate a web application .I have also downloaded the TOMCAT server install and configured it ,set the enviroment varible and is working well when itried invoking a html form.I have even install the j2sdk 1.5.
The problem now is on my JSP form i want to link to an Access database the code is provided below:
<%@page contentType="text/html" import="java.sql.*" %>
<%@page pageEncoding="UTF-8"%>
<html>
<head><title>JSP Page</title></head>
<body bgcolor='palegoldenrod'>
<img src ='Apps/Japp/logo.jpg ' height="100" width="100"/><hr/>
<center ><form method="POST" action="/Apps/Japp/TEST.jsp" >
<table bgcolor='navyblue'>
<tr><td><font Color="yellow" size="5"><b>Student Number :</b> </font></td>
<td><input Type ="text" name= "number" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>First Name :</b> </font></td>
<td><input Type ="text" name= "fname" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>Middle Name :</b> </font></td>
<td><input Type ="text" name= "mname" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>Last Name :</b> </font></td>
<td><input Type ="text" name= "lname" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>Subject :</b> </font></td>
<td><input Type ="text" name= "sub" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>Grade :</b> </font></td>
<td><input Type ="text" name= "grade" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>Exam Type :</b> </font></td>
<td><input Type ="text" name= "etype" size="30"/></td></tr>
<tr><td><font Color="yellow" size="5"><b>Number In Group:</b> </font></td>
<td><input Type ="text" name= "ngroup" size="30"/></td></tr>
</table>
<font Color="yellow" size="5"><b>Teachers Comments </b> </font>
<textarea name= "comment" rows="8" cols=50/></textarea>>
<input type="submit" value="Submit your Entries" />
<input type="reset" value="Clear Entries" /></form>
</center >
<hr/>
<%
Connection conn;
Statement stat;
String studentNumber = request.getParameter( "num");
String firstName= request.getParameter(" fname");
String middleName= request.getParameter("mname" );
String lastName = request.getParameter( "lname") ;
String subject= request.getParameter( "sub") ;
String grade= request.getParameter("grade") ;
String numInGroup= request.getParameter("ngroup") ;
String coment = request.getParameter("comment" ) ;
String examType= request.getParameter("etype" ) ;
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc:odbc:Tester","bart","college");
stat = conn.createStatement();
stat.executeUpdate( "INSERT INTO REPORT " +
"VALUES (studentNumber,firstName , middleName,lastName ," +
"subject,grade,numInGroup,coment,examType" );
stat.close();
conn.close();
catch (Exception e)
e.printStackTrace();
%>
</body>
</html>
i am recieving the error message below when I sumit my entry from the form.Can anyone tell me what to do tosolve this problem and do ineed to configure an xml file i n the web module for this iam using NETBEANS IDE
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: /Japp/TEST.jsp(6,1) Illegal value of scope attribute: PAGE (must be one of "page", "request", "session", or "application")
     org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
     org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
     org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:186)
     org.apache.jasper.compiler.JspUtil.checkScope(JspUtil.java:252)
     org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:536)
     org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1133)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
     org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2230)
     org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2236)
     org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
     org.apache.jasper.compiler.Validator.validate(Validator.java:1518)
     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:247)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)
note The full stack trace of the root cause is available in the Tomcat logs.
Apache Tomcat/5.0.19

org.apache.jasper.JasperException: /Japp/TEST.jsp(6,1)
    "Illegal value of scope attribute": "PAGE" (must be one of "page", "request", "session", or "application")The error says it all. In your TEST.jsp you have a JSP tag that uses the scope attribute. You have it written as: scope="PAGE".
Keep in mind that JSP is Java, and Java is case sensitive. Re-read the error message and see if you can't locate and fix the problem.
PS: This occurs because you are writing code without following any sort of coding standards. It makes for errors in JSPs, but also real hard to read HTML. Create a set of rules for yourself and follow them. It will make it a lot easier to manage later on. Some example rules:
1) Name all pages with capital letters to start the name, and to deliminate words. Use lower case letters the rest of the time. Example:
"Test.jsp" "StudentMailAddressForm.html" ...
2) Use only lower case letters for tags except when required not to:
<td ...> <body ...> <jsp:useBean...>
3) All tag attribute names should be lower case except when required not to:
< ... color="..." > <... name="... >
4) Put all tag attributes in double quotes.
<... name="address" ...> < ... size="15" ... > <... src="images/ThePic.jpg" ...>
5) Allattribute values should be lower case except:
a. To distinquish words <... name="hamSandwich" ...>
b. The value will be displayed to the user <... value="Submit Form" ...>
c. The value is a proper noun <... user="Steve Luke" ... >
d. When required to be case sensitive like looking up info in a DB...
These are just examples, but if you think about the rules when you make them you will be writing good XHTML code in no-time, and the transition to JSP, with its case-sensitivity will be easy.

Similar Messages

  • How to add MenuBar and MenuItems in JSP Form

    Help Me,
    Dear Forum,
    I am user of jDeveloper 10g working on JSP (Web Module).So How to add MenuBar and Menu Item, in Our jsp Form.What this type control exist?
    regards
    javed khan

    You should do this instead:
    iframe.setJMenuBar(i_menuBar);

  • How to find out last_query from jsp form in oracle applications

    Hi
    At present i am working on Quality Module.
    in India Localization.
    In Quality module -> Results -> Inquiries -> Skip Lot Inquiry
    If i enter our organization name
    Then its openning one form.
    I am unable to find out the table names from the jsp form.
    User also unable to comment on it.
    So, please help me on this issue.
    Regards,
    Pradeep.

    Hi
    Once you open the jsp form, at below leftside corner you can see link : About This Page. If you click on the link : About this Page this again open another window, there you can see multiple tabs at header level, if you click on page tab, there you can all the VO objects used to build this page. If you click on VO object hyperlink you can see the query.

  • Migrating PCR frontend-JSP forms to Adobe interactive forms-WD Abap Comp

    Hi All,
    We are currently on Netweaver 7.0 & ECC 6.0 and ESS - MSS Business Package 50.4. We are using JSP Forms on portal front for Personnel Change Requests (PCR's ) where in all the scenarios in the backend are heavily customized with good amount of usage of Javascripts. For certain scenarios, where in a huge amount of information is fetched from ECC 6.0 backend system, JSP are performing really bad and the total time taken to display the form is actually causing a lot of irritation to the end user.
    We are planning to propose an upgrade to SAP adobe interactive forms. The prerequisite is that the business wants to reuse all the customized scenarios without any changes and just want to move towards better front end forms.
    My questions are:
    1. Please list benefits of SAP Adobe interactive forms - ABAP component over JSP forms (performance wise)
    2. Issues with SAP Adobe Interactive forms?
    3. Since Javascripts do not work in Webdynpro ABAP. How can we implement those front end checks and validations.
    3. Any other options available for UI that can be suggested?
    All suggestions are welcome. Quick response is appreciated.
    Thanks a lot for your time and help.
    Best Regards,
    Anupama

    Is your performance issue with the Javascript with JSP pages?  or the Java script you are using within the Adobe form in your WDJ custom application using Adobe form? I have worked on PCR's using ISR framework old school it used to call as PCR and now HCM Processes and form, Developed PCR's using WDJ also integrated workflow with the WDJ PCR for approval(we never had any performance issue) infact ISR frame work was kind of slow compare to custom WDJ solution and less flexible for a developer to develop.
    I have also worked created WDA custom application for PCR's , WDA is definitely better when you compare it with WDJ but I have not seen much performance issue with WDJ atleast on custom PCR solutions.
    I don't have any case study to share with you, can you please tell what kind of PCR's your client is using and what kind of performance issue you are experiencing and where and why you guys are using Javascript.

  • Calculations in Jsp form - Urgent Please

    Hi,
    I have 3 fields in my table, Quantity,Price and Total. Quantity * Price gives Total. Price is the Column of another table and I display the values of Price using <jbo:InputSelectLOV>. So,my requirement is when I input the value for Quantity and select the values from list in the Edit.jsp form I need the value of Quantity * Price to be displayed in the Total field on Browse form. Could someone please help me. I am new to JSP and any help is appreciated.
    Thank You

    It's not related to JDeveloper this is a generic thing for HTML pages - if you want to do client side (menaing no traffic to the server) actions you use Javascript.
    You just need to stick the Javascript into the JSP page you have inside JDeveloper.

  • How to upload files through a servlet/jsp form?

    anyone know basically how to do this?
    i need to write a simple jsp form the can browse for a file on my machine, then upload it to a server in the usual html form manner.
    is this done with an i/o stream?
    thanks for any help!
    robSmyth
    [email protected]

    jspSmart has a free upload component you can use for HTTP file uploading. (http://www.jspsmart.com )
    Also, O'Reilly has an open source package you can use. (http://www.oreilly.com or http://www.servlets.com )
    Another option is dotJ, which has an upload tag in its tag library. Benefit of this library is that it has a much more compehensive set of JSP tags. (http://www.dotjonline.com )

  • Registering JSP forms in oracle apps

    Hi,
    Can anyone suggest me how to register JSP forms in oracle apps 11i (11.5.9 version), on Windows NT
    Regards

    Hi,
    My question is, how do I run the form in the Oracle Apps? After registering it.You already have the steps in your post, just add the form to the menu and attach it to the responsibility.
    My question is, how do I know if a form has a function that needs to be registered?Sorry, I cannot be of much help here, but you may check the Developer Guide and see if it helps.
    Oracle Applications Developer's Guide
    http://download.oracle.com/docs/cd/B25284_01/current/acrobat/115devg.pdf
    Regards,
    Hussein

  • Including jsp form in multiple jsps

    Hi
    I have a requirement to include a common jsp form in several other jsps that live in different web applications. For e.g. there is test_form.jsp taht I can access via http://www.test.com/common/test_form.jsp. There are several other jsps /app1/call_test1.jsp , /app2/call_test1.jsp taht need to include the /common/test_form.jsp. These jsps just provide different look with specific images etc.. We also need the pages to be accessed via those specific urls.
    The form is showing fine. But when I submit the included form, I am submitting to the wrapper jsp(say /app1/call_test1.jsp which I am passing as aparam to teh include), if any validation errors its supposed to show on /app1/call_test1.jsp. But its not showing them. If I call the include jsp separately in the browser, its working fine. How can I get the form errors dispalyed on the wrppaer.jsp??
    Any help is appreciated
    Thanks

    <select size="8" name="fruit" multiple>
    <option value="apple">apple</option>
    <option value="orange">orange</option>
    <option value="mango">mango</option>
    <option value="cherry">cherry</option>
    <option value="pineapple">pineapple</option>
    <option value="grapes">grapes</option>
    </select>
    if i select apple, orange,mango and cherry and submit it to the database field 'fruit', only 'apple' gets inserted. none others.
    this is the the line where it is processing the value.
    String fruit=request.getParameter("fruit");
    by the way I have only one database table
    I hope this example helps

  • Best way to create, modify, XML with JSP ?  HELP

    Hi friends,
    As i am new to XML,
    I know there are two APIs used for XML processing, i want to know as a begineer level, which API
    is easy and good to implement XML with JSP.
    1) SAX
    2) DOM
    i want to make a log file in XML, so on web page it will be displayed on HTML form through XSL.
    Since there is good tutorial on http://www.w3schools.com/dom
    but i think its HTML dom
    I want XML procession through JAVA CODE , what should i use ? and give some good tutorials on XML DOM
    that is used with JAVA / JSP.
    HELP.
    Edited by: Ghanshyam on Sep 19, 2007 3:24 PM

    Well what i think is you gonna checkout with your requirements before implementing any of the popular XML parsing mechnisms.
    If you are intrested in faster processing @sacrifising a gud amount of your Memory,DOM is the one which you are looking for.
    If you are instrested in Managing your memory and but if you are ok with sacrifising speed SAX is the best solution.it works on what is called a push technology.
    and if you think either way you might have to look towards a pull parser which is StAX (Streaming API for XML Parsing)
    it'd be a gr8 idea if you can go through the below article which explians about each of the parsing mechanisms
    http://www.stylusstudio.com/xml/parser.html#*
    coming back to helpful resources as far java is concern checkout the below link which might be of some help.
    and the main thing is that all of these parser there is a defined specification you might find implementations of different vendors on this.
    eg:Sun Provides one with JDK itself,same as IBM provides one,oracle does the same & so on...
    your first task would be to focus on one such implementation which can cater your requirements.
    DOM:*
    Basic Parsing Objects / Interfaces Involved while DOM parsing:
    http://www.w3.org/TR/DOM-Level-2-Core/java-binding.html
    Breif Overview & few important API details:
    http://www.developerlife.com/domintro/default.htm
    Simple Example:
    http://www.brics.dk/~amoeller/XML/programming/domexample.html
    Others:
    http://www.roseindia.net/xml/dom/
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM.html#wp79994
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/dom/1_read.html
    SAX:*
    http://www.javacommerce.com/displaypage.jsp?name=saxparser1.sql&id=18232
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/index.htm
    http://java.sun.com/developer/Books/xmljava/ch03.pdf
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPSAX.html#wp69937
    http://www.onjava.com/pub/a/onjava/excerpt/java_xslt_ch5/index.html?page=6
    StAX:*
    http://java.sun.com/webservices/docs/1.6/tutorial/doc/SJSXP2.html
    http://javaboutique.internet.com/tutorials/stax/
    http://today.java.net/pub/a/today/2006/07/20/introduction-to-stax.html
    Hope this might be of some help :)
    REGARDS,
    RaHuL
    http://weblogs.java.net/blog/spericas/archive/2006/04/sun_stax_parser.html

  • How to find table name and field name in JSP FORM

    Hi
    In JSP form's like XML publisher responsibility>templet
    In that form how can we see the system-last query . and how to see the table name

    hi yamini,
    plz go to help->record history (for fining table name)
    and
    help->diagnostic->examine (for finding field name)& enter last_query
    in JSP form also same above only i think.
    or check in back end & apply who columns
    Edited by: raghava bandi on Nov 7, 2008 2:05 AM

  • How to make countdowntimer in java bean to use in jsp form

    i make an aplication in jsp with XHTML MP format..i have problem to maka a countdowntimer in java bean to use in the jsp form.could anyone help me with this problem

    Use JHelp, downloadable from Sun. This is a quit big package, you have to read a lot before applying.
    http://java.sun.com/products/jfc/tsc/articles/javahelp/index.html
    enjoy
    sergio

  • Migration of JSP forms into adobe forms for PCRs

    Hi All,
    I am working on Upgrade project for ESS/MSS. Our client had JSP based PCRs which we need to migrate into adobe based PCRs.
    i have few questions regarding this migration.
    Has someone the experience to migrate a  JSP based PCR into Adobe based PCR?
    How much effort the migration will take, and can we fully reuse ISR configuration and workflow?
    Thanks,
    Ankur

    If you are using the SAP delivered JSP forms - there maybe equivalent SAP delivered Adobe based PCRs in the next ESS/MSS releases that you can use instead of migrating the forms
    I am not aware of any tools or documentation that help to migrate custom JSPs to custom Adobe forms
    As I see it you would have to create new Adobe based versions  of your JSP PCRs  - I am vaguely aware of a guide entitled
    "Developing Your Own Personnel Change Requests" for ERP2004 - however I am not sure how you would obtain a copy
    or whether this approach is recommended, supported or complete - this documentation would detail how to create an ISR based Adobe form
    At the same time there may be restrictions as to what standard JSP forms are available as standard Adobe forms and what can be configured in the ISR scenarios (for example use of Value Help in WD JAVA Adobe scenarios)
    - SAP have been recommending instead of creating say a ISR based Adobe form for WD JAVA to
    use HCM processes and forms (also available in the MSS role) going forward
    - HCM processes and forms is WD ABAP based framework using Adobe which allows users to create custom Adobe forms which update back-end infotypes directly from the Portal - also such scenarios as Value Help etc may be possible (or more easily achieved)
    Best wishes
    Stuart

  • JSP form value use

    I have a simple JSP form that gets three values. I need to use one of these values in a query before I hit the Form SUBMIT button. Is there a way to do this?

    Do you mean to say you need the values in the form fields entered by user before submitting the page..?
    In that case you can call a javascript function on click of the button and retrieve the values and after that submit the button.
    Hope this helps.
    Regards,
    Anupama

  • How to Disable a entire JSP form based on single value

    Hi,
    My requirement is I have to disbale a JSP form based on getting single value from the drop down box. Please suggust me some ideas.
    Highly aprreciated
    Thanks In advance
    Anbr19

    Well as said by my fellow it could be easily acheived by javscript
    say i'm assuming the dropdown has set of value under a form named SampleForm..
    here is how you do using javascript
    <script language="javascript">
    function disable(txt){
       if(txt == '<Condition Value>'){
           for(var i =0 ; i < document.SampleForm.length ;i++)         
               document.SampleForm.elements.disabled = true;
    </script>
    <form name="SampleForm">
    <select name="dropdown" onchage="disable(this.value)">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </form>
    hope this might help :)
    REGARDS,
    RaHuL

  • What is wrong with this javascript with jsp - asap help needed

    <script language="javascript">
    function checkSubmit(form){
                    // Loop from zero to the one minus the number of radio button selections
                    for (counter=0; counter < document.submitform.authortitle.length; counter++){
                        if (form.authortitle[counter].checked){
                            var splitStr = document.submitform.authortitle[counter].value;
                            alert(splitStr);
                            var splitStrArray = new Array();
                            splitStrArray = splitStr.split(","); alert(splitStrArray[2]);
                            splitStrArray[2].trim();
                            if(splitStrArray[2].equals("null")){
                                alert("true");
                                //replace the form action with somefile.jsp
                                document.forms[0].action="searchAmazon.jsp";
                                form.submit();
                            }else{
                                document.forms[0].action="isbnSearch.jsp";
                                form.submit();     
            </script>the above javascript method is acting stupid.. it shows the first two alerts but does not go in the if statement "if(splitStrArray[2].equals("null")){ " and does not show the third alert. i do not c any problems pls help... when i click the option and submit it gives me a jasper exception pointing to some line which does not involve this code...

    it has started working now basically the problem was the trim() method which i have removed and have changed .equals("null") to == ..
    BUT NOW it always does the else command and goes to the isbnsearch page even if the value is null (if null then it should go to another page)...

Maybe you are looking for

  • How to avoid creation of _(file.*), coping from tiger to pc?

    how to avoid the creation of this file for ever on a pc environment?? I explain: as i copy any image file, it goes to a spooler directory and that begins instantly to process the file to an OPI server, separating CMYK channels, converting it to high

  • Aperture 3 roundtriping with Capture NX 2

    I am still practicing on files and trying to work some issues out. I am working with raw files and trying to export to NX for adjustment. I am also using referenced files. I plan on importing an adjusted tiff back to aperture to replace the raw file.

  • Making a US account to download ps4 games...?

    Just wondering if this is allowed? or will it be patched ?  as curretly there is a offer of £8 for the last of us remastered digital code but it will only work on a US account...

  • No country information has been maintained for IQ

    Hi Guys We have recently enabled the Embargo service , now when the Purchase Order is being created its getting blocked in embargo for the entirely wrong reason. When checking the Customs document log in GTS i see that its blocked in embargo because

  • How to make Select List Read only (Keep key Data)

    I'd like to make a select list read only when the screen is in maintenance mode because the select list value is part of the key. However, when I make the select list read only, the update fails because it appears making it disable lose's it's value.