Help in jsp registration page/form

hello! i am new with jsp. and i am having problems with my registration page. i does't seem to add data into my database and worse, it doesn't seem to connect to the database. appreciate the help. thanks.
registration.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="java.sql.*" %>
<%
    String connectionURL = "jdbc:mysql://localhost:3306/petdepot?user=root&password=12345";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    connection = DriverManager.getConnection(connectionURL, "root", "12345");
    statement = connection.createStatement();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Pet Depot</title>
</head>
<body>
<%
    String uname = "";
    String pwrd = "";
    String pwrd2 = "";
    String dbname = "";
    String dbaddress = "";
    String dbcontactNo = "";
    String dbemailAd= "";
    String dbnote="";
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    String password2 = request.getParameter("password2");
    String name = request.getParameter("name");
    String address = request.getParameter("address");
    String emailAd = request.getParameter("emailAd");
    String contactNo = request.getParameter("contactNo");
    String note="";
    if ((username!=null)&&(password!=null))
            if ((username== "")||(password== "") ||(name== "")|| (address== "") || (emailAd== "")||(contactNo== "") )
                note = "Please complete all the fields.";
            if ((username== "")&& (password== "") && (name== "")&& (address== "") && (emailAd== "")&& (contactNo== "") )
                note = "You did not enter any information. Fill-up the form to register.";
            else if ((username!= "")&& (password!= "") && (password2!= "") &&(name!= "") && (address!= "") && (emailAd!= "") && (contactNo!= "") )
                int pwdOneLength = password.length();
                int pwdTwoLength = password2.length();
                if (pwdOneLength == pwdTwoLength )
                    if ((pwdOneLength >= 6))
                        if (password.equals(password2))
                            String found = "NO" ;
                            rs = statement.executeQuery("Select * from useraccounts where username = '"+username+"' ");
                            try{
                            while(rs.next())
                                found = "YES";                             
                            }catch(SQLException e){out.println(e.getMessage());}
                            if ( found.equals("NO"))
                                    statement.executeUpdate("Insert into useraccounts (username, password) values('"+username+"','"+password+"'");
                                    statement.executeUpdate("Insert into userprofile (name,address,contactNo, EmailAd) values ('"+name+"','"+address+"', '"+contactNo+"', '"+emailAd+"'");
                                    username = "";
                                    password = "";
                                    password2 = "";
                                    name = "";
                                    address = "";
                                    emailAd = "";
                                    contactNo = "";    
                            else
                                note = " <span class=\"style1\">The username you entered is already in use. Change your username </span> ";
                        else
                            note = " <span class=\"style1\">Please enter the password and the password confirmation correctly.</span> ";
                if ((username== null)|| (password== null) || (address== null) || (name== null) || (emailAd== null) || (contactNo== null) )
            password = "";       
            password2 = "";
            if (username== null)
           {    username = ""; }
            if (address== null)
            {  address = ""; }
            if (name== null)
            {  name = ""; }
            if (contactNo== null)
            {  contactNo = ""; }
            if (emailAd == null)
            {  emailAd = ""; }
%>
       <p>REGISTRATION FORM   <br> <br> <%= note %></p>
       <p>Fill-up all the fields below and click the SUBMIT button </p>
<form id="form1" name="form1" method="post" action="">
  <label>username: 
  <input name="username" type="text" id="username" /></label>
  <p>
    <label>password:
    <input name="password" type="password" id="password" />
    </label>
</p>
  <p>
    <label></label>
  </p>
  <p>
    <label>Name:
    <input name="name" type="text" id="name" />
    </label>
</p>
  <p>
    <label></label>Address:
    <input name="address" type="text" id="address" />
  </p>
  <p>Email Address:
    <input name="emailAd" type="text" id="emailAd" />
  </p>
  <p>ContactNos:
    <input name="contactNo" type="text" id="contactNo" />
</p>
  <p> </p>
  <p> </p>
  <table width="396" border="0">
    <tr>
      <td width="46"> </td>
      <td width="144"><input name="uname" type="text" id="uname" /></td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
    </tr>
  </table>
  <p>   </p>
  <p>
    <label>
    <input type="submit" name="Submit" value="Submit" />
    </label>
  </p>
</form>
</body>
</html>

String connectionURL = "jdbc:mysql://localhost:3306/petdepot?user=root&password=12345";The connectionURL is WRONG
Probably it could be like ..
String connectionURL = "jdbc:mysql://localhost:3306/petdepot"
I hope petdepot is your DB name and mysql is installed locally on your machine.
Class.forName("com.mysql.jdbc.Driver").newInstance();Remove .newInstance() and it should be ..
Class.forName("com.mysql.jdbc.Driver");
I suggest you make a java bean for DBConnection as below ..
package yourpackage;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
* The class file will be responsible for returning the database connection information.
* @author Rohit Kumar
* @version 1.0
* @date 17-Dec-2004
public class DbConnection
     * This method shall be used for getting Client Connection.
     * @return Connection
     * @throws Exception
    public Connection getClientConnection() throws Exception
        try
            Class.forName(ApplicationPropertyRead.getProperty("DBDRIVER"));
        catch (Exception e)
            System.out.println("Exception :"+e);
        Connection oCon=DriverManager.getConnection(ApplicationPropertyRead.getProperty("DBURL"),
                                                    ApplicationPropertyRead.getProperty("DBUSER"),
                                                    ApplicationPropertyRead.getProperty("DBPASSWORD"));
        return oCon;
}Instead of my method call ApplicationPropertyRead.getProperty("..") you may hardcode it for now as you are learning JSP.
Then check if your connection is successful or not in your JSP.
<%@ page import="yourpackage.DbConnection*" %>
<%
DbConnection dbConn = new DbConnection()
Connection connection = null;
try
     Connection connection = dbConn.getClientConnection();
    System.out.println("connection :"connection);
catch (Exception e)
    System.out.println("Exception Error :" + e);
finally
     if (connection != null)
          connection.close();
%>Only if the above steps is successful then you should proceed with DB transactions.
Regards
Rohit

Similar Messages

  • I need help with a 1 Page Form with scrollable text field (5000 limit characters) and printing

    Hello, I have no training in using Adobe Acrobat Pro or Livecycle Designer so I need major help with a 1 page form that I am attempting to create. Basically the form will be used to nominate employees for a Job Well Done Award.
    The form contains the following:
    1.) The name(s) of the employees being nominated and the date of the accomplishment.
    2.) In the middle of the page I have a section for a write up, limited to 5000 characters, this is were I am needing the most help. A couple of things, about this section: The font is set at 11 and I don't want it to change. The text field has multiple-line, scroll long text enabled. The text field is a certain size and can only hold so much text, then it starts to scroll, which I am ok with, I like that feature. The issue I am having is during printing. I would like to keep the text field scrollable but when I print I would like to be able to print everything in that field. Executing this is the problem, I have no clue how to do it. I was hoping for some setting within Acrobat Pro or LiveCycle to be available, but the more I read and research this, it appears that it may require java, xml, basically some coding. I don't know for sure.
    3.) Below the text field I have another field for the person nominating to type their name and right next to that another field for a digital signature.
    4.) And finally below those two fields I have a Submit button that is setup to start email application so the form can be emailed to the proper inbox.
    Thank you in advance.

    With an Acrobat form the only thing you can do is export the text to
    another location (like a blank field on another page) or to another file
    format. With an LCD form you can expand the text box itself, but you'll
    need to ask about that over at the LCD Scripting forum.

  • Need help with a 9-page form

    I've created a single-page PDF form with LOTS of form fields (most of them checkboxes). I need to duplicate the page/form another eight times so that I have the same form across nine pages. My problem is, if I don't change the names of the form fields on each page (which would take a REALLY long time), as soon as something gets checked on the first page, it will also get checked on all eight of the other pages. Is there a way to make my nine-page form work without having to re-name each and every form field? Thank you for any assistance you can provide! I'm working in Acrobat 9 standard on a Windows computer.

    Yes, make the single page into a template and spawn it eight times, specifying that you want to rename the fields in the process. Here are some previous threads that discuss this in more detail:
    http://forums.adobe.com/message/4745648
    http://forums.adobe.com/thread/1084011
    The code in the second topic doesn't include the parameter that causes the fields to be renamed, you you could easily include it:
    // Make a template out of the first page
    var t1 = createTemplate("t1", 0);
    // Spawn the template to create a new page
    var oXO = t1.spawn({nPage: numPages, bRename: true, bOverlay: false});
    // Now that we have the XObject, spawn the rest of the pages
    while (numPages < 9) {
        t1.spawn({nPage: numPages,  bRename: true, bOverlay: false, oXObject: oXO});
    Message was edited by: George Johnson to correct a typo.

  • Help with registration page

    Hi, I had a couple of questions with making a registration
    page. First, I'm having trouble figuring out how to make it so that
    when someone submits there email address, it has to be a valid one
    to continue, or even just an email address to begin with. Also, how
    to prevent a user from using numbers when a user types in their
    name as well as not let them type less than 3 characters. My last
    question if anyone can answer it is how do you send an email to the
    user after they submit the form, and make it so they have to click
    on a link before they can access the website, so that what they put
    in the form does not go into my database until they have clicked
    the link. Thanks, sorry for asking so many questions, any help for
    any of the questions would be greatly appreciated.

    The fundamental problem is that the OP is asking questions about Servlet and JSP development without fully understanding the basics of containers and the rendezvous method of data sharing, life-cycle, data scope, and the like.
    It is better that (s)he read up on the basics.

  • PHP registration page help!!

    Hi, I am in the process of redesigning my union's website to
    include a member area. Here's my problem...
    I already have a database for our union members. What I want
    to do is to be able to have register using data that I already have
    for them in a table: Last Name, First Name, Date of Birth, Last 4
    digits of SSN. There will also be fields for user name and password
    (which will originally be blank in the table). When the user hits
    the submit button, the form data needs to compare those first 4
    submitted fields to the corresponding ones in the existing table
    (much the same way a credit card company might do with an existing
    account). If the data submitted matches what's in the table, the
    user name and password submitted in the form are written to the
    table and the user should be redirected to a login page.
    How should i go about building such a registration page??
    Help!!! ???
    Thanks,
    rborc415

    rborc415 wrote:
    > I've been knocking around with what you suggested and
    I'm kind of flying blind
    > at this point... could I ask you to be a little more
    specific?
    Basically, what you are doing is creating a search page. If
    the search
    produces a result, you want to display an update form. You
    can either do
    it all in one page, and control what it displayed with
    conditional
    logic, or you can use session variables pass the information
    from one
    page to the next.
    The basic way to do it with separate pages is to create a
    search form in
    page 1. Get the user to enter the four items. Send the form
    using the
    GET method to page 2.
    In page 2, create a recordset to search for the record, using
    the $_GET
    variables. If the recordset is empty, display a message
    saying "record
    not found". If the recordset is not empty, display the
    results in an
    update form, using readonly fields for the already-registered
    values.
    Use ordinary text fields for the items you want the user to
    fill in.
    Apply an Update Record server behavior.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Is it possible to use two diff forms in same jsp/jsf page?

    Hi all,
    My requirement is to submit the form based on selection of radio button.
    since half part needs to be jsp based which is not using any tags etc.
    But i am trying to use some jsf based component which requires to be inside <f:view><h:form> of
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    i.e. some <c:comboBox>
    </h:form> </f:view>
    Now earlier i was submitting the form as
    <form action="/techstacks-v2_1/reportAction.do" method="post" name=doSearch id='doSearch'>
    But now i found, in order to use combo box component which is entirely jsf based i need to use <f:view><h:form> which is kind of taking over the previous form submission mechiansm.
    I am trying to keep them separate as two differnt forms.
    one entirely jsp based and other as jsf based.
    Now my question is can i use such way of doing so or is there any better way of implementing so.
    My friend suggested that i can pass the value of jsf based form in hidden form to a input box of form to be submitted finally instead of submitteing two diff forms.
    but in that case also i ahev to use two forms in a single jsp/jsf page.
    suggest me something which can really work out.
    thanks
    vijendra

    You can use as many forms as you want as long as you don't nest forms. The HTML spec probibits that.

  • How to get context sensitive help  in JSP Pages

    Is it possible to display context sensitive help in JSP Pages when I press the tab key on the keyboard base on the key focus. I don�t want to use any applet or Swing components, because it�s a web page viewed on the browser
    Thanks

    Java code inside a JSP is interpreted on the server and the HTML produced by the server it is shown in the client browser. The JSP code can incorporate calls to the JavaHelp API if it is available to the server. Those calls can be used on the server side to map parts of the JSP to contents of a help set (HTML pages).
    Given that, you can provide context sensitive help, but when it comes to view help information, you either can show HTML only (without TOC, index, etc.) or you'd need an applet.
    Ulrich

  • Just got an iphone4 and itunes wont recognize it.thr registration page is blank except where you fill in answers. and it already wants me to update a new version but says network timed out. help

    just got an iphone 4 and the registration page is blank. it also says there is a new version available but says network keeps taking time out

    Hi Jen.  My daughter just compleated her nursing program and is now working as a full time nurse.  Focus and study hard and soon you will be there too.  Now to the problem at hand.  I have the same problem.  I gave up on it and satisfied myself with my iPod without the upgrade.  Reason being I've read so many posts of people having problems after the upgrade.  But I'm sure other factors are involved.  Nevertheless here is the fix most say works to solve the problem:  What ever virus protection you have installed on your computer, disable it.  Then try to install the update. After that enable the protection. I had Kaspersky, and it does it's job well. The thinking is, the virus protection is blocking the upgrade.  Hope this works.   Charlie

  • How do I compensate for only one ADDT ' tNG_config.inc.php file with many Registration pages to build?

    My dynamic site has a lot of different languages funneled into one website, using various cookies, url params, php includes, etc. all to obtain similar info in different languages. Thank you David Powers.
    It is working really well and now I’ve come to the Registration section. Okay, so registration isn’t all that hard; I could do most of it with the standard Dreamweaver set of tools. Alas, I really like much of what ADDT has to offer with welcome email messages and activation and such.
    Here’s the setup: Obviously, with many different language people, I have many different databases for them. I did that becuase we’re expecting a big audience and I really don’t want to have all those different language names in the same table. Furthermore, these tables, whereby the students will login, will also contain a lot of information about their work so again, don’t want to have one massive table. I’ve divvied them up into tables by language and I’m using those tables to keep track of them and their work.
    I want to use ADDT’s User Registration Wizard and I have looked at all the neat stuff in the Control Panel/Login Settings.
    Here’s my situation: I notice that when I’m done with the configuring of one of the registration pages, I’m asked if I want to upload the tNG_config.inc.php page and that it has changed since the last upload. I saved a copy of the _config.inc.php and did a new registration form with the same info and when done, I compared the two _config.inc.php files. As one would guess, there is a small difference in the Connection string to the databases  $tNG_login_config["connexction"] = "connString_Ital_db".
    My problem is that I have 13 of these registration pages to do but ADDT only has the one tNG_config.inc.php. That’ll work great for the one with which it is associated, but the others will obviously break. I’ve looked through the code in the Registration pages, to find the ADDT link to the tNG_config.inc.php file hoping to rename it Italian, Spanish, etc, but the name of the file does not appear in the Registration page.  I realize that ADDT Control panel is designed for use on one site, and can then be used on others, with the changes etc. But my site seems a little unique since so many sites are actually in one.
    Has anyone whipped this problem before? I just don’t understand why there is no link in the head code of the Registration page to let me change it and to create more config files with different names. Thanks for you help!
    [Moved by moderator to appropriate forum]

    Hi Brian,
    I just tried to check all of ADDT´s "includes" files for any internal references (read: "require" or "require_once" statements) to the file "tNG_config.inc.php". So far I can only see this file referenced in the file "tNG.inc.php" (within the "$KT_tNG_uploadFileList1" array).
    So what could this mean ? Maybe you´ll have to make copies of the the original "tNG.inc.php" as well and save them as, say, "tNG.inc_ital.php" file plus make sure that these copies internally point to a different "tNG_config_ital.inc.php" file -- because it´s always the first mentioned file which gets referenced from e.g. an ADDT login page (see the "Load the tNG classes" - part)
    I want to use ADDT’s User Registration Wizard and I have looked at all the neat stuff in the Control Panel/Login Settings
    The Control Panel will always update the main "tNG_config.inc.php" file, so any further modifications will have to become manually applied to the custom files you´re creating.
    Cheers,
    Günter

  • Query : Addition of extra fields in the User Registration page of portal.

    Hi All,
    I have a query, about adding extra fields in the new user registration page of portal.
    If you can suggest the required source files in details,inorder to incorporate two more fields.
    Say, AGE and COMPANY,with the existing fields in the same page.
    Along with this,can you please send the details of retrieving those information from backend and the backend functionalities associated with the SUBMIT button on the registration page.
    Regards,
    Sudeep

    Hi,
    Your query is divided into two parts.
    The first part is adding new fields into existing form. This feature comes under Branding of portal. Plz use the link below understanding the same and related help :
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/affe402a5ff223e10000000a155106/frameset.htm
    The second part is retrieving the values from backend.Here it will be the UME database. You need to develop a logon.par file and replace the same in your portal.
    Happy Customizing.
    Sukanta Rudra

  • Passing new values as extension to FM in registration page in b2c ISA..

    Hi experts,
    I have b2c application with CRM50. I have added new fields in the user(consumer) registration page.I need to pass these values to the backend. The standard function module CRM_ISA_REGISTER_CONSUMER  which has an parameter EXTENSION_IN to pass the extension data is called from UserCrm.class.
    The standard action SaveRegisterAction.class in config.xml after i click save button is called.
    I am not able to find the exact method to overwrite in which where i can add the addExtensiondata() method.
    Is anyone added new fields in the register.jsp page? Kindly help me out in this if any one has some idea.
    Also if anyone has the API for CRM50 please mail me to [email protected]
    thanks in advance.
    Nitin

    Hi Nitin,
        Could you find any code to call business object "User"  in action "SaveRegisterAction"?if you find, i think you can create new action extends from "SaveRegisterAction" ,and in the new action call method "addExtensiondata()" of object "User",after this you can get data in the function module you are mention.
    Best Regards.
    jason

  • Trying to add captcha to forum registration page...

    I just put up a site and my forum is getting terrible spam so I need to add a captcha to the registration page.
    Here is the html code with my attempt to add a captcha module with the help of a support agent, it does not work for some reason.
    <h1>Forum Registration</h1>
    <div class="error">{module_error}</div>
    <div class="forum-registration">
    <h2>Existing Users - Login</h2>
    <form method="post" action="{module_pageaddress}" onsubmit="return check_RegistrationForm(this,'login')">
        <div class="form">
        <div class="item">
        <input type="hidden" name="OrderLogin_Info" />
        <label>Username</label><br />
        <input name="Username" maxlength="255" class="cat_textbox" />
        </div>
        <div class="item">
        <label>Password</label><br />
        <input type="password" name="Password" maxlength="255" class="cat_textbox" />
        </div>
        <div class="item">
        <input type="submit" value="Login" class="cat_button" /><a href="#" onclick="document.getElementById('lostpassword').style.display='inline';return false;">Forgot your username/password?</a>
        </div>
        </div>
    </form>
    <form method="post" action="/LostPasswordProcess.aspx" name="catseczonelpform57982" style="display: none;" id="lostpassword">
        <h2>Forgot Password</h2>
        <div class="form">
        <div class="item">
        <label>Enter Username or Email Address</label><br />
        <input name="Username" maxlength="255" class="cat_textbox" />
        </div>
        <div class="item">
        <input type="submit" value="Retrieve" class="cat_button" /><br />
        </div>
        </div>
    </form>
    <hr />
    <h2>New User - Registration</h2>
    <form method="post" action="{module_pageaddress}" onsubmit="return check_RegistrationForm(this,'newuser')">
        <div class="form">
        <div class="item">
        <input type="hidden" name="OrderRegistration_Info" />
        <label>Name</label><br />
        <input name="Registration_Name" value="{module_RegistrationInfo,Name}" class="cat_textbox" />
        </div>
        <div class="item">
        <label>Email</label><br />
        <input name="Registration_Email" value="{module_RegistrationInfo,Email}" class="cat_textbox" />
        </div>
        <div class="item">
        <label>User Name</label><br />
        <input name="Registration_Username" value="{module_RegistrationInfo,Username}" class="cat_textbox" />
        </div>
        <div class="item">
        <label>Password</label><br />
        <input type="password" name="Registration_Password" value="{module_RegistrationInfo,Password}" class="cat_textbox" />
        </div>
        <div class="item">
        <label>Confirm Password</label><br />
        <input type="password" name="Registration_ConfirmPassword" value="{module_RegistrationInfo,ConfirmPassword}" maxlength="255" class="cat_textbox" />
        </div>
        <div class="item">
        <label>Alias</label><br />
        <input name="Registration_Alias" value="{module_RegistrationInfo,Alias}" class="cat_textbox" />
        </div>
        <div class="item">
        <label>Signature</label><br />
        <textarea type="text" rows="4" name="Registration_Signature" class="comment">{module_RegistrationInfo,Signature}</textarea>
        </div>
        <div class="item">
        <label>Enter Word Verification in box below <span class="reg">*</span></label><br />
        {module_recaptcha}</div>
        <div class="item">
        <input type="submit" value="Register" class="cat_button" />
        </div>
        </div>
    </form>
    </div>
    <!-- END .forum-registration -->
    <script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>
    <script type="text/javascript">
        //<![CDATA[
         function check_RegistrationForm(theForm,name) {  var why = "";  if (name == 'login') {  why += isEmpty(theForm.Username.value, "Username");  why += isEmpty(theForm.Password.value, "Password");  }  else {  why += isEmpty(theForm.Registration_Name.value, "Full Name");  why += isEmpty(theForm.Registration_Email.value, "Email Address");  why += isEmpty(theForm.Registration_Username.value, "Username");  why += isEmpty(theForm.Registration_Password.value, "Password");  why += isEmpty(theForm.Registration_ConfirmPassword.value, "Password Confirmation"); if (theForm,CaptchaV2) why += captchaIsInvalid(theForm, "Enter Word Verification in box below", "Please enter the correct Word Verification as seen in the image");  }  if (why != "") {   alert(why);   return false;  }    return true; }
        //]]>
    </script>

    You can do that on all forms Penny, Does keep them clean.
    It does mean that with no javascript they will never work, but in this day an age that should not be an issue.
    It looks like they were not hitting the registration url, but may have had a cached version of the page and using that to submit Penny.
    Its a good sollution - ideally for properness data- is a html5 attribute so the doctype really needs to be that. In XHML using rel="" on the form with the action in there is a good alternative as well.
    As a note Lynda's code was :
    $('.data-submit').data();
    This woud return all data
    $('.data-submit').data('action');
    Is more specifc and faster, if you had other data elements it would just fetch all or fall over.

  • Using JSP based PCR forms in ERP2005 rather than Adobe interactive forms

    We are currently upgrading from EP5.0 business package 50 to EP7.0 with ERP2005 (ECC 6.0) and are trying to configure our existing custom personal change request forms with our scenarios.
    Originally our custom PCR scenarios where JSP iView and we are hoping to use these again as part of ERP2005. The customisation seems to support this – transaction QISESCENARIO for each scenario you have the option ‘Entry Type in Web’ and you can set it to ‘Entry Using JSP iView’. We can configure the internet link and the portal component also for our JSP view.
    When we try to run this however we get the exception ‘No Adobe Form Is Assigned to the Scenario’. After a quick debug it seems that you always need the Adobe form to be configured.
    None of the documentation for ERP2005 suggests that you can use anything other than Adobe forms, which contradicts the configuration in QISESCENARIO.
    The ISR cookbook (written July 2004) details the creation and configuration of JSP request forms but not what versions they are compatible with.
    Developing you own PCRs for ERP2004 (Can’t find an ERP 2005 version) does not mention JSP iViews at all.
    The release notes for ERP2005 don’t give this a specific mention.
    So, my question is are the use of JSP based request forms permitted with ERP2005 ?

    Hi Phil,
       Interesting - I have a similar issue.  We want to use the Request for Transfer scenario in ERP 2005, but it has not been developed in Adobe forms by SAP yet (it isn't available in 2004 either)!  So, we have decided to use the old JSP PCRs instead.
    Your issue is probably because you're using the same 2005 iviews to create your PCRs.  The 2005 PCR iviews are written in WebDynpro, and appear to assume that each one will be an Adobe form!  If you assign the old PCR iviews to your manager (give them the old MSS role under Migrated Content->EP5.0... in the pcd if you have it installed), you will be able to create a PCR with the JSP forms (regardless of the "Entry in Web" setting in QISRSCENARIO).
    The next issue is the approval.  In 2005, transaction SWFVISU has task TS50000075 configured as Java Webdynpro.  You'll need to change that to iView, and specify ID = com.sap.pct.hcm.isrdispatcher.default.  I'm following the UWL item type guide for this at:
    http://help.sap.com/saphelp_nw04s/helpdata/en/b1/cc1357eead454bb144face4a66be7d/content.htm
    Having said this, my approval is not working!  The item type has clearly changed, because the workitem name is no longer a hyperlink (rather annoying), but when I hit the "Launch Task Page" button (default name I think) I get the error:
    "Unable to perform action because the system returned an invalid URL"
    I can't see this "invalid url" anywhere in the logs, so I can't see where it is getting it from, or what path, etc I'm meant to put!  In your old system, what did you have as the "Server for ISR call" under "Additional Data for Scenario" in QISRSCENARIO?  Also, what did you have in the "URL" box that appears under the Additional Data for Scenario button when you change the Entry Type to JSP?
    Many thanks,
    Russell.

  • Need serious help with JSP + JDBC/Database connection

    Hey all,
    I have to build an assignment using JSP pages. I am still pretty new and only learning through trial and error. I understand a bit now, and I have managed to get a bit done for it.
    I am having the most trouble with a Login Screen. The requirements are that the a form in a webpage has Username/Number and Password, the user clicks Login, and thats about it. The values for the username/number and password NEED to come from the database and I cannot manage to do this. The thing I have done is basically hardcode the values into the SQL statement in the .jsp file. This works, but only for that one user.
    I need it so it checks the username/number and password entered by the user, checks the database to see if they are in it, and if so, give access. I seriously am stuck and have no idea on what to do.
    I dont even know if I have made these JSP pages correct for starters, I can send them out if someone is willing to look/help.
    I have setup 3 other forms required for the assignment and they are reading data from the db and displaying within tables, I need to do this with non-hardcoded values aswell. Im pretty sure I need to use for example 'SELECT .... FROM .... WHERE username= +usrnm' (a variable instead of username="john" , this is hardcoded), I just CANNOT figure out how to go about it.
    Its hard to explain through here so I hope I gave enough info. A friend of mine gave some psuedocode i should use to make it, it seems ok to follow, its just I do not know enough to do it. He suggested:
    get the username and pass from the env vars
    open the db
    make an sql (eg SELECT user, pass FROM users WHERE user = envuser)
    index.jsp points to login.jsp
    login.jsp get the vars you put into index.jsp
    opened the db
    is the query returns nothing - then the user is wrong
    OR if the passwords dont match
    - redirect back to index.jsp
    if it does match
    - set up a session
    - redirect to mainmenu.jsp
    Anyway, thanks for any help you can give.
    -Aaron

    Hi,
    Try this... it may help you...
    mainMenu.jsp
    <html>
    <body>
    <form method="POST" action="login.jsp">
    Username: <input type="text" name="cust_no">
    <p>
    Password: <input type="password" name="password">
    <p>
    <input type="submit" value="LOGIN">
    </form>
    </body>
    </html>
    login.jsp
    <%@ page import="java.io.*, java.sql.*"%>
    <html>
    <body>
    <%
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection("jdbc:odbc:rocky");
    Statement statement = connection.createStatement();
    String query = "SELECT cust_no, password FROM customers WHERE cust_no='";
    query += request.getParameter("cust_no") + "' AND password='";
    query += request.getParameter("password") + "';";
    ResultSet resSum = statement.executeQuery(query);
    if (request.getParameter("cust_no").equalsIgnoreCase(resSum.getString("cust_no") && request.getParameter("password").equalsIgnoreCase(resSum.getString("password"))
    %>
    <h2>You are logged in!</h2>
    <%
    else
    %>
    <h2>You better check your username and password!</h2>
    <%
    }catch (ClassNotFoundException cnfe){
    System.err.println(cnfe);
    }catch (SQLException ex ){
    System.err.println( ex);
    }catch (Exception er){
    er.printStackTrace();
    %>
    </body>
    </html>
    I didn't check the code that I wrote. So you may have to fix some part of it. Also this may not be the best solution, but it will help you to understand the process easily.
    The more efficient method is to check whether the result set returned from the database is null or not.... I hope you got the idea... Good luck!
    Rajesh

  • Plz help in jsp upload

    Exam.jsp
    <html>
      <body>
            <form action="Exam1.jsp"  enctype="multipart/form-data">
          <input type="text" name="s1"><br>
          <input type="file" name="f1"><br>
          <input type="text" name="ans1"><br>
          <input type="text" name="num1"><br>
              <input type="submit" value="submit"> 
            </form>
        </body>
    </html>Exam1.jsp
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <%
    String s2 = request.getParameter("s1");
    String s3 = request.getParameter("ans1");
    String s4=request.getParameter("num1");
    out.print(s2);
    out.print(s3);
    out.print(s4);
    String contentType = request.getContentType();
    System.out.println("Content type is :: " +contentType);
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength)
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String file = new String(dataBytes);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex + 1,contentType.length());
    int pos;
    pos = file.indexOf("filename=\"");
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    saveFile = "C:\\Documents and Settings\\Administrator\\jspexm\\sri123\\web\\uploads\\" + saveFile;
    FileOutputStream fileOut = new FileOutputStream(saveFile);
    //fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    out.println("File saved as " +saveFile);
    is this code correct
    Please help
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    hi
    thanks for reply
    iam not geting Exceptions
    i am unable to print the values from Exam.jsp
    using this in Exam1.jsp
    String s2 = request.getParameter("s1");
    String s3 = request.getParameter("ans1");
    String s4=request.getParameter("num1");
    out.print(s2);
    out.print(s3);
    out.print(s4);while uploding the file

Maybe you are looking for

  • How can i use an barcode scanner and a keyboard at the same time on Ipad

    HI I am looking to find a way to use a barcode scanner and the on screen key bard at the same time, so far i cant seem to find a way to do it. Does any one know how this can be done. thanks

  • Strange problem with MSSQL2K (SP3)

    Hi, I have downloaded for evaluation Kodo 2.4. After installing and configuring it I tried to run the PetShop example that is provided with the package. Unfortunately I got very strange error: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver

  • Regarding Bapi data blocking

    HI friends,please help me on following issue"how to block the data of the customized bapi in R3 system." it is very urgent. point will be awarded.

  • [JS] CS4 Anchored frame within anchored frame

    With this code myGB is not returning the correct geometric bounds. Is anyone else noticing this? myFrame = myStory.insertionPoints[0].textFrames.add() myAGB = myFrame.geometricBounds; myAGB[1] = myFrame.geometricBounds[3] + 10 myAGB[2] = myFrame.geom

  • How to transform this PL/SQL request into a PL/SQL function ?

    Hi nice people ! I have a beautiful flash chart which SQL code is below. I want to display this chart only if this query returns results. I tried to put it as condition. How to transformt this SQL ciode as "SLQ Function returning a boolean" ? DECLARE