Checking simple login

Can anyone tell me how to fix the following piece of code to get my login check working?
The code is as follows:
<HTML><HEAD><TITLE>Check User Login Against Parameters</TITLE></HEAD>
<%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<BODY bgcolor="#FF9900">
<H1></H1>
<%
     Class.forName("COM.mysql.core.JDBCDriver");
     java.sql.Connection = java.sql.DriverManager.getConnection
     "jdbc:mysql:C:\mysql\data\gcdBB");
     java.sql.Statement statement = connection.createStatement();
     String usernameFormParamValue = request.getParameter("usernameFormParam");
     String passwordFormParamValue = request.getParameter("passwordFormParam");
     if(usernameFormparamValue!=null)
          String usernameInitParamValue = config.genInitParameter("username");
          String passwordInitParamValue = config.genInitParameter("password");
          if(usernameFormParamValue.equals(usernameInitParamValue)&&
               passwordFormParamValue.equals(passwordInitParamValue))
               // login correct, greetings %> Welcome to the GCD Computing Bulletin
Board !!! <br>
<%
          else
               // login incorrect, please try again %> To proceed, please click
here <br>
<% }
     else
          // login incorrect, please try again %> Sorry but your login is incorrect,
please try again <%)
%>
</BODY></HTML>
Here is the code for my login page which works fine:
<HTML><HEAD><TITLE>GCMB User Login</TITLE></HEAD>
<body bgcolor="#FF9900">
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<P align=left><IMG height=70 src="Login_files/GCDMsgLogo.gif" width=564></P>
<form method="get" action="LoginCheck.jsp">
<table cellspacing=0 cellpadding=0 width=372 border=0>
<tbody>
<tr>
<td width=138> </td>
<td colspan=2><font face=Arial><b>User Login:</b></font></td>
</tr>
<tr>
<td width=138><font face=Arial>Username:</font></td>
<td colspan=2>
<input name=textfield2>
</td>
</tr>
<tr>
<td width=138><font face=Arial>Password:</font></td>
<td colspan=2>
<input name="textfield3" type="password">
</td>
</tr>
<tr>
<td width=138 height="33"> </td>
<td colspan=2 height="33">
<select name="select">
<option>---- Please Select! ----</option>
<option>Administrator</option>
<option>Lecturer</option>
<option>Student</option>
</select>
</td>
</tr>
<tr>
<td width=138> </td>
<td colspan=2>
<input type=submit value=Login name=Submit>
</td>
</tr>
<tr>
<td width=138> </td>
<td colspan=2> </td>
</tr>
</tbody>
</table>
</form>
<P align=left> </P>
<TABLE height=72 cellSpacing=0 cellPadding=0 width=772 border=0>
<TBODY>
<TR>
<TD colSpan=2 height=7><IMG height=3 src="Login_files/bar.gif"
width=774></TD></TR>
<TR>
<TD width=568 height=30>
<P><IMG height=24
src="Login_files/GCDHome.gif" width=115 border=0><IMG height=24
src="Login_files/Email.gif" width=115></P></TD>
<TD width=206 height=30>
<DIV align=right></DIV></TD></TR>
<TR>
<TD colSpan=2><FONT face="Times New Roman, Times, serif" size=2>Griffith
College Dublin, South Circular Road, Dublin 8, Ireland. Tel/Fax: +353 1
415 0400/ +353 1 454 9265 <BR>email: <A
href="mailto:[email protected]">[email protected]</A> website: <A
href="http://www.gcd.ie/">http://www.gcd.ie/</A> </FONT><FONT
face="Times New Roman, Times, serif" size=2>� 2002 Design: Niall
Magner</FONT></TD></TR></TBODY></TABLE>
<P align=left> </P>
<P> </P>
<P> </P></BODY></HTML>

Hii
In this piece of code
-->request.getParameter("usernameFormParam");
check that "usernameFormParam" is the name that you have given for the field username in the HTML file
I think you need to change the code as follows in the HTML file
<input type="text" name="usernameFormParam">

Similar Messages

  • What's wrong with a simple login.jspx?

    Hello,
    I wrote a simple login.jspx page by following the indications at http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/adding_security.htm#BABDEICH
    Now, the page works with Firefox 5, but does not with IE 7. When under IE 7, the page keeps reloading giving errors about *"AdfBootStrap undefined*" or *"AdfLogger undefined".*
    What is wrong? Please note that I have already read all the threads on the forum about this issue, without actually solving my problem (I have not really seen any useful solutions there to be honest).
    Jdeveloper is 11.1.1.5.0, only adf authentication is enabled.
    The error messages are like the following ones:
    http://forums.oracle.com/forums/thread.jspa?threadID=952977&tstart=29
    thanks.
    Edited by: user10047839 on 27-giu-2011 8.07
    Changing from jspx to jsp does not solve the problem.

    Hello codeplay,
    in the source code of the page I have the following similar to your line:
    <script type="text/javascript" src="/Myapp/afr/partition/ie/default/opt/boot-11.1.1.5.0-1095.js"></script>
    No lines with SHERMAN inside.
    I could not open "/Myapp/afr/partition/ie/default/opt/boot-11.1.1.5.0-1095.js" or
    "afr/partition/ie/default/opt/boot-11.1.1.5.0-1095.js". Page not found
    Why does it happen with login page only?
    In firefox, as opposite to ie, where the page is rendered a little better (not as good as it should be though, due to these problems), I can login and be redirected to the secured main page, which is another .jsp, more complex than the simple login page, and there I have no problems at all.
    I noticed that the badly rendered page has a link pointing to the generated html below. NOTE that JavaScript IS ENABLED in my IE despite what this html says at the end. I checked this twice:
    WHAT IS WRONG??????????
    <html lang="en-EN"><head><script>
    ** Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
    * This is the loopback script to process the url before the real page loads. It introduces
    * a separate round trip. During this first roundtrip, we currently do two things:
    * - check the url hash portion, this is for the PPR Navigation.
    * - do the new window detection
    * the above two are both controled by parameters in web.xml
    * Since it's very lightweight, so the network latency is the only impact.
    * here are the list of will-pass-in parameters (these will replace the param in this whole
    * pattern:
    * viewIdLength view Id length (characters),
    * loopbackIdParam loopback Id param name,
    * loopbackId loopback Id,
    * loopbackIdParamMatchExpr loopback Id match expression,
    * windowModeIdParam window mode param name,
    * windowModeParamMatchExpr window mode match expression,
    * clientWindowIdParam client window Id param name,
    * clientWindowIdParamMatchExpr client window Id match expression,
    * windowId window Id,
    * initPageLaunch initPageLaunch,
    * enableNewWindowDetect whether we want to enable new window detection
    * jsessionId session Id that needs to be appended to the redirect URL
    * enablePPRNav whether we want to enable PPR Navigation
    var id = null;
    var query = null;
    var href = document.location.href;
    var hashIndex = href.indexOf("#");
    var hash = null;
    /* process the hash part of the url, split the url */
    if (hashIndex > 0)
    hash = href.substring(hashIndex + 1);
    /* only analyze hash when pprNav is on (bug 8832771) */
    if (false && hash && hash.length > 0)
    hash = decodeURIComponent(hash);
    if (hash.charAt(0) == "@")
    query = hash.substring(1);
    else
    var state = hash.split("@");
    id = state[0];
    query = state[1];
    href = href.substring(0, hashIndex);
    /* process the query part */
    var queryIndex = href.indexOf("?");
    if (queryIndex > 0)
    /* only when pprNav is on, we take in the query from the hash portion */
    query = (query || (id && id.length>0))? query: href.substring(queryIndex);
    href = href.substring(0, queryIndex);
    var jsessionIndex = href.indexOf(';');
    if (jsessionIndex > 0)
    href = href.substring(0, jsessionIndex);
    /* we will replace the viewId only when pprNav is turned on (bug 8832771) */
    if (false)
    if (id != null && id.length > 0)
    href = href.substring(0, href.length - 10) + id;
    var isSet = false;
    if (query == null || query.length == 0)
    query = "?";
    else if (query.indexOf("_afrLoop=") >= 0)
    isSet = true;
    query = query.replace(/_afrLoop=[^&]*/, "_afrLoop=12570889997779");
    else
    query += "&";
    if (!isSet)
    query = query += "_afrLoop=12570889997779";
    /* below is the new window detection logic */
    var initWindowName = "_afr_init_"; // temporary window name set to a new window
    var windowName = window.name;
    // if the window name is "_afr_init_", treat it as redirect case of a new window
    if ((true) && (!windowName || windowName==initWindowName ||
    windowName!="1bvr27bkx4_1"))
    /* append the _afrWindowMode param */
    var windowMode;
    if (false)
    /* this is the initial page launch case,
    also this could be that we couldn't detect the real windowId from the server side */
    windowMode=0;
    else if ((href.indexOf("/__ADFvDlg__") > 0) || (query.indexOf("__ADFvDlg__") >= 0))
    /* this is the dialog case */
    windowMode=1;
    else
    /* this is the ctrl-N case */
    windowMode=2;
    if (query.indexOf("_afrWindowMode=") >= 0)
    query = query.replace(/_afrWindowMode=[^&]*/, "_afrWindowMode="+windowMode);
    else
    query = query += "&_afrWindowMode="+windowMode;
    /* append the _afrWindowId param */
    var clientWindowId;
    /* in case we couldn't detect the windowId from the server side */
    if (!windowName || windowName == initWindowName)
    clientWindowId = "null";
    // set window name to an initial name so we can figure out whether a page is loaded from
    // cache when doing Ctrl+N with IE
    window.name = initWindowName;
    else
    clientWindowId = windowName;
    if (query.indexOf("_afrWindowId=") >= 0)
    query = query.replace(/_afrWindowId=\w*/, "_afrWindowId="+clientWindowId);
    else
    query = query += "&_afrWindowId="+clientWindowId;
    var sess = "";
    if (sess.length > 0)
    href += sess;
    /* if pprNav is on, then the hash portion should have already been processed */
    if ((false) || (hash == null))
    document.location.replace(href + query);
    else
    document.location.replace(href + query + "#" + hash);
    </script><noscript>JavaScript is not enabled in your browser.</noscript></head></html>

  • Initial and expired password status is not checked during login for ITS Services

    Dear all,
    we have the following Basic problem or question regarding ITS-based ABAP Services provided via browser to internal and external customers:
    The user call the ITS via URL "https://<host>:<port>/sap/bc/gui/sap/its/it13?sap-client=03&sap-language=en" his browser.
    To access the Service a simple login Dialog appears for entering the credentials (UserID + Password).
    The problem with this simple Dialog is that after resetting the users password this initial password status seems not to be checked here.
    That means, that the user is able to login with this initial password and he is not forced to change the password.
    In difference to this the intended behavior is provided for example when the SAP Standard ITS Service "webgui" is launched by the user:
    The user launches der Service via URL "https://<host>:<port>/sap/bc/gui/sap/its/webgui?sap-client=03&sap-language=en"
    In this case an additional first SAP WebAS login dialog appears where the users has to click on a Login-Button. This login button opens
    another login dialog as a popup where the user is able to enter his credentials. But if the password has an initial status the user is
    forced afterwards to change his password.
    So the login behavior of the webgui Service is what we also want for the any other ITS Service. We've already compared the service properties and
    settings (SICF), but we could not find any difference.
    What can we do to change the login behavior for the ITS services ?
    Thanks in advance for any kind of help !
    Joerg

    Hello Joerg,
    Can you attach a screenshot of the "Logon Data" tab of the service 'it13' in transaction SICF?
    In SICF - Tab: Error Pages -> Logon Errors
    is 'SYSTEM Logon' selected for both the 'WEBGUI' service and 'IT13' service?
    Regards,
    Oisin

  • I upgraded to mountain lion a week ago and now on startup of my macbook pro, microsoft excel and word start up automatically and then crash? very strange can anyone please help? I have checked the login items under users and groups and there is nothing.

    I upgraded to mountain lion a week ago and now on startup of my macbook pro, microsoft excel and word start up automatically and then crash? very strange can anyone please help? I have checked the login items under users and groups and there is nothing.

    Are you using the Office for Mac 2011 version, as you need to do?  The Office for Mac 2004 is Not at all compatible with Mountain Lion, and the 2008 version has been noted to have some problems running with ML.
    Hope this helps

  • How to check Agent login details in a particular CTIOS

    How to check Agent login details in a particular CTIOS

    Yes, you'll need to provide more information.  If you login a supervisor to the CTIOS supervisor desktop who is part of every team you would be able to tell every agent who is logged in and what state they are in.
    david

  • I am new on flex, and i would like to create a simple login + password using amfphp

    Hi all,
    I try to make a simple login password using mysql and amfphp, i have a little quesiton, i dont' know how to get back my response from php. Thanks in advance if anyone could help me.
    Best regards
    i would like to tell to the label    <mx:Label x="380" y="10" id="lResponse"/> the response from php
    I juste want to take back response from php.
    Here is my mxml :
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
        <fx:Script>
            <![CDATA[
                import mx.controls.dataGridClasses.DataGridColumn;
                import flash.net.Responder;
                import mx.events.DataGridEvent;
                import org.corlan.VOAuthor;
                private function checkpassword():void {
                    var newauthor:VOAuthor=new VOAuthor();
                    newauthor.lname_aut = nom.text;
                    newauthor.fname_aut = prenom.text;
                    myRemote.validate(newauthor);
                private function checkInput():void
                    if(nom.text == "" || prenom.text == "")
                        lResponse.text = "Veuillez completer tout les champs";
                    else
                        lResponse.text = "connecter";
                        checkpassword();
                    //    checkLogin("login.Verify.validate",[nom.text,prenom.text]);
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <mx:RemoteObject id="myRemote" destination="MyService" source="MyService"
                             endpoint="http://localhost/amfphp/gateway.php" showBusyCursor="true"/>
            </fx:Declarations>
        <s:Panel x="334" y="168" width="245" height="135" title="Identifiez vous" textAlign="center">
            <s:TextInput x="102" y="10" textAlign="left" id="nom" />
            <s:TextInput x="102" y="40" textAlign="left" id="prenom" />
            <s:RichText x="50" y="6" text="Login :" height="22" width="56" textAlign="left" verticalAlign="bottom"/>
            <s:RichText x="27" y="46" text="Password :" height="20"/>
            <s:Button x="125" y="70" label="Connecter" width="105" click="checkInput()"/>
            <mx:Label x="380" y="10" id="lResponse"/>
        </s:Panel>
    </s:Application>
    Here is my php code :
    <?php
    session_start();
    require_once ('./vo/org/corlan/VOAuthor.php');
    //conection info
    define( "DATABASE_SERVER", "127.0.0.1");
    define( "DATABASE_USERNAME", "root");
    define( "DATABASE_PASSWORD", "xxxx");
    define( "DATABASE_NAME", "flex360");
    class MyService {
        function validate($author){
            $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
            mysql_select_db(DATABASE_NAME);
            $user = $author[0];
            $pass = $author[1];
            $query = "SELECT DISTINCT * FROM authors_aut WHERE fname_aut = '$user' AND lname_aut = '$pass'";
            $rs = mysql_query($query);
            $var = mysql_fetch_assoc($rs);
            $u = $var["fname_aut"];
            $p = $var["lname_aut"];
            if ($pass != $p){
                $response[0] = "INVALID";
                $response[1] = "Invalid username and/or password";
            } else {
                $response[0] = "VALID";
                $response[1] = "Welcome $u";
            return $response;
    ?>

    I usually have a resultHandler function, to handle stuff from the server.
    resultHandler(event:ResultEvent):void

  • Creating a simple Login screen

    Hi folks,
    I'm a beginner trying to develop some code for a simple login screen for a database.
    I know that some packages (Access) have tailor-made code for this but can't seem to find
    anything in Oracle to do this. Can anyone help or point me in the right direction ?
    I'm using Oracle 8i and Forms 6i(8.1.7) running on Windows NT4.
    Thanks in advance,
    John

    Forms has a default for that.
    When you start a form with Forms runtime, the login screen is displayed automatically.

  • SIMPLE login script install of zfd4 agent?

    Is there is simpler way of installing the zfd4 agent via a login script when
    I'm not using an intermediate tier or use the application explorer. The
    login script examples I've found onlnie (and information in the Novell docs
    and Novel Press books) seem complex and frought with pitfalls...
    Thanks,
    KB

    > I'm reviewing this TID; I may be able to do this on my own. However, if
    > anyone has an example, working "simple" login script they could post as
    an
    > example, it would be REALLY appreciated....
    >
    > Thanks!
    > KB
    > "KB" <[email protected]> wrote in message
    > news:mHgfg.738$[email protected]..
    > > Forgot to mention - I want to run this in silent mode, and need to
    handle
    > > the issue where someone already has the agent installed...
    > >
    > > Thanks,
    > > KB
    > >
    > > "KB" <[email protected]> wrote in message
    > > news:Dfgfg.703$[email protected]..
    > >> Is there is simpler way of installing the zfd4 agent via a login
    script
    > >> when I'm not using an intermediate tier or use the application
    explorer.
    > >> The login script examples I've found onlnie (and information in the
    > >> Novell docs and Novel Press books) seem complex and frought with
    > >> pitfalls...
    > >>
    > >> Thanks,
    > >> KB
    > >>
    > >
    > >
    >
    >
    Hi,
    your Login Script must be seen like this:
    #z:exist c:\programme\novell\zenworks\nalwin32.exe
    if "%ERRORLEVEL"="0" THEN GOTO NOTHING
    #z:\zfdagent\agent.bat
    NOTHING:
    END
    the agent.bat is a batch File to install the agent in silent mode
    it looks like that:
    msiexec /i z:\zfdagent\zfdagent.msi /qn ADDLOCAL=ALL EDITABLE_MT_ADDRESS=1
    STARTUP_APPWINDOW=1 STARTUP_APPEXPLORER=0 REBOOT=ReallySuppress /l*v %
    WINDIR%\zfdagent.log
    the z:\zfdagent is a subdirectory in the sys:\system\Public where
    zfdagent.msi file exists.
    hier is a link to download exist.exe
    Download: http://www.novell.com/coolsolutions/...oads/exist.zip
    Best regards
    Issam

  • Tutorial for simple login form

    Can anyone post a link to a tutorial for a simple login form in Oracle form devloper 10g?
    Thanks,
    Va
    Message was edited by:
    user450092

    > 1. When I enter the correct username and password, it
    just drops me back
    > into the login page.
    This - header("Location=
    http://thenewpage.com");
    should be this - header("Location= thenewpage.php");
    > 2. When I enter the incorrect username and password, it
    drops me back into
    > the login page without the error message.
    Post the rest of the form, please.
    (Now I'm really off for the Philles game!)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Virginia Carter" <[email protected]> wrote in
    message
    news:g0pibi$lu2$[email protected]..
    > I'm trying to create a simple login using a form and php
    and am having
    > difficulty in troubleshooting - if someone could give me
    a little help, I
    > would greatly appreciate it.
    >
    > Here is the code:
    >
    > <?php
    >
    > $error = FALSE;
    >
    > if (isset($_POST['client_password']) &&
    isset($_POST['client_username']))
    > {
    > if (($_POST['client_password'] == 'blah') &&
    > ($_POST['client_username'] == 'blahblah')) {
    > header("Location=
    http://thenewpage.com");
    > exit();
    > }
    > else {
    > $error = "<h2>You have entered an incorrect
    password/username.
    > Please try again.</h2>";
    > }
    > }
    >
    > ?>
    >
    > (and in the document body)
    >
    > <?php echo $error?$error:''; ?>
    > <form method="POST" action="<?php echo
    $_SERVER['PHP_SELF']; ?>"
    > name="form1
    > " id="form1">
    > <rest of form follows here>
    >
    > In testing this page in the browser:
    >
    > 1. When I enter the correct username and password, it
    just drops me back
    > into the login page.
    >
    > 2. When I enter the incorrect username and password, it
    drops me back into
    > the login page without the error message.
    >
    > Thanks in advance.

  • How to work with EJBs and database for a simple login application

    Hi all :)
    I am new in JSP,EJB and Servlets. I just wanted to develop a simple login application, using JSP+EJBand servlets. In some tutorial I found that the beans are already populatesd with database records. But will it be good logic to retrive all records into a bean and then search for a perticuler users data for authentication.
    Can any one tell me me what is the best logic for doing so. :(
    Thanx in advance.

    Himanshu.Shekhar wrote:
    Hi all :)
    I am new in JSP,EJB and Servlets. I just wanted to develop a simple login application, using JSP+EJBand servlets. In some tutorial I found that the beans are already populatesd with database records. But will it be good logic to retrive all records into a bean and then search for a perticuler users data for authentication.No. Let the database do the search. It's far more efficient.
    %

  • Help needed "tabEnabling" not working in simple login page - Flex

    Hello Friends,
    I need a small help in Flex. I am doing a simple login page application  in FlashBuilder 4.0 & i have kept 2 input boxes like Login,Password  and a submit buttion. On clicking the button i am calling a method, so  far everything is working fine.... But some how tabenabling is not  working. suppose if you are in login inputbox and i press "tab key" it  has to go to password input box.. but its not working. can any one help  me on this, why it is not working. i have tried all the attempts using  tabEnabled = "true". but stil i am failing to do this.
    your help would be appreciated.
    Rajesh
    Message was edited by: Rajeshb_Flash

    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
       width="100%"
       height="100%"
       verticalAlign="middle"
       horizontalAlign="center">
    <mx:Script>
      <![CDATA[
       import com.tel.model.EventConstants;
       import mx.controls.Alert;
       import mx.managers.CursorManager;
       import mx.rpc.events.FaultEvent;
       import mx.rpc.events.ResultEvent;
       import mx.rpc.http.mxml.HTTPService;
       private var httpService:HTTPService;
       public var userID:String = "";
       public function init():void{
       private function mouseClickSubmit():void{
        if(userName.text != "" && password.text != ""){
         userID = userName.text;
         initService();
        }else{
         if(userName.text == ""){
          Alert.show("Please enter 'User Name'.","Alert!")
         }else if(password.text == ""){
          Alert.show("Please enter 'Password'.","Alert!")
       private function initService():void{
        var params:Object = new Object();
        params["userName"] = userName.text;
        params["password"] = password.text;
        httpService = new HTTPService();
        httpService.showBusyCursor = true;
        httpService.resultFormat = "xml";
        httpService.method=URLRequestMethod.POST;
        httpService.addEventListener(ResultEvent.RESULT, httpServiceResultHandler);
        httpService.addEventListener(FaultEvent.FAULT, httpServiceFaultHandler);
        httpService.url = "Login.action";
        httpService.send(params);
       private var boolFirstRun = true;
       private function httpServiceResultHandler(event:ResultEvent):void{
        httpService.removeEventListener(ResultEvent.RESULT, httpServiceResultHandler);
        httpService.removeEventListener(FaultEvent.FAULT, httpServiceFaultHandler);
        httpService = null;
        var resultXML:XML = new XML(event.result.toString());
        if(resultXML.children().toString() == "true"){
         boolFirstRun = false;
         dispatchEvent(new Event(EventConstants.LOGIN_SUCCESS))
        }else{
         userName.text = "";
         password.text = "";
         Alert.show("Login Failed! Invalid 'User Name' or 'Password'.","Alert")
       private function httpServiceFaultHandler(event:FaultEvent):void{
        httpService.removeEventListener(ResultEvent.RESULT, httpServiceResultHandler);
        httpService.removeEventListener(FaultEvent.FAULT, httpServiceFaultHandler);
        httpService = null;
      ]]>
    </mx:Script>
    <mx:Panel title="Login Page" width="400" height="300" styleName="loginPanel" verticalAlign="middle" horizontalAlign="center" backgroundImage="assets/images/hello.jpg" backgroundAlpha=".1">
       <mx:VBox width="260" height="95" styleName="loginBox" backgroundAlpha=".2">
       <mx:HBox width="100%">
        <mx:Label width="85" text="User Name" styleName="loginTextStyle"/>
        <mx:TextInput width="150" id="userName"/>
       </mx:HBox>
       <mx:HBox width="100%">
        <mx:Label width="85" text="Password" styleName="loginTextStyle"/>
        <mx:TextInput width="150" id="password" displayAsPassword="true"/>
       </mx:HBox>
       <mx:HBox width="100%">
        <mx:Spacer width="80%"/>
        <mx:Button label="Enter" id="submit" click="mouseClickSubmit()"/>
       </mx:HBox>
      </mx:VBox>
    </mx:Panel>
    </mx:VBox>

  • ADF correct way to implement simple login?

    I have an ADF app that just needs some simple login functionality.
    I found a tutorial somewhere and did the following:
    Put this in my jazn-data.xml file
    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
          <form-login-page>/login.html</form-login-page>
          <form-error-page>/login.html</form-error-page>
        </form-login-config>
      </login-config>
    Created static page login.html
    Created the users
    And it works!
    Problems:
    - I would like to have an ADF page as my login page, not some simple HTML page that looks nothing like the rest of my application. If I replace the html page with a jspx in the above xml file then I get java.lang.RuntimeException: Cannot find FacesContext
    - On failed login it should redirect to login page and provide an error message, not just redirect.
    I have not been able to find a definitive tutorial on how to do this. Help would be appreciated, thanks.
    JDeveloper 11.1.1.6

    Hi,
    because you have to use faces/filename.jspx
    Frank

  • Simple login

    can anyone sharing some vi's or idea on how to do a simple login file without using a sub vi??
    i want to compare what the user input with a constant number. If it is correct, then it'll prompt "Correct", if wrong, "Wrong".
    It will verify when user press the ok button.

    Hi mahe,
    with this little modification, it do what you want.
    Mike
    Message Edited by MikeS81 on 04-28-2008 02:35 PM
    Attachments:
    Unbenannt.PNG ‏14 KB

  • Any tutorials on creating a simple Login using Mysql and sessions?

    Hey guys. I cannot seem to find any information(online) or books that cover sessions in JSF and how to do a simple log in. I can get the application to query a mysql table and check the credentials and go to the next page, but I'm not sure how to make that page locked from non authorized access. I am very familiar with PHP and using it to create database driven applications. It's very straightforward, making safe logins using mysql, and creating sessions once the user has logged in(making pages locked unless the user is logged in, etc).. I have the core java server faces book but it's a joke. I feel like its an incomplete book. It merely skims a topic, and when you think it's going to get interesting it moves on to something else. It teaches basic stuff but nothing of what I want to do(or need to do). The older Javaserver faces book that came out in 2004 from O'Reilly doesn't seem to help either. I'm just wondering where people learn JSF at. I know Java, I would say pretty well as far as desktop applications go. I really like the way JSF is layed out and would really like to use it in my next project. At the level I know it now it's perfect for static web pages with no dynamic information.(but I could use plain html for that). Thanks for all your help.

    dothedru22 wrote:
    but I'm not sure how to make that page locked from non authorized access.You can use a Filter for that. Map the filter on the desired url-pattern and write doFilter() logic which checks if the user is logged in (basically: if there is an User object in the HttpSession) and handle accordingly (chain.doFilter() on success or response.sendRedirect on fail).
    and creating sessions once the user has logged in(making pages locked unless the user is logged in, etc).. The HttpSession is backed by a cookie (as is PHP's $_SESSION, did you know that?), you don't need to do any low-level stuff with cookies. Maybe at highest if you ever want a "remember me on this computer" option.
    booksThe mentioned books learns you the JSF basics. They doesn't really learn the best practices / practical use cases. There you have other resources for (or just practical experiences). Besides, I recommend you to go get a book which covers JSF 1.2 or newer. The mentioned ones are outdated, as is everything else older dan two years in the programming world.

  • Simple Login and Session maintaining with Mysql

    Hi everybody,
    I'm not expert in Java servlets and I'm writing and application that recognize users and maintain their session trough application's pages.
    This application, after authentication, will displays a table coming from a query where I will have to modify only a "square" ( i Don't know the right english name for it,sorry...) of a row, more exactly the notes
    I need a hand about Session and Login, and if you can post the code of a "row-selectionable" (to modify notes) query resulted table it will be very appreciated ;) (for the table, does'nt matter if it will be a Servlet or a JSP)
    This is my actual Login code, but it doesn't works! (I tried to manage session reading some tutorials around the net)
    package Login;
    import java.sql.*;
    import javax.servlet.http.*;
    import javax.swing.JOptionPane;
    * @author Alessio
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class Login extends HttpServlet{
         private Connection con;
         private Statement st;
         private ResultSet rs,rs2;
         boolean autenticato= false;
         public void doGet(HttpServletRequest req,HttpServletResponse res) {
              try{
              Class.forName("com.mysql.jdbc.Driver");
              con=DriverManager.getConnection("jdbc:mysql://localhost:3306/gecoprova","root","argoilcane");
              HttpSession session=req.getSession(true);
              String sessione = session.getId();
              //APRE uno statement e con una query pesca dal DB tutte le tuple che hanno i dati passati allaservlet (nome, cognome,...)
              st=con.createStatement();     
              rs=st.executeQuery("SELECT * FROM anagrafe_procuratori WHERE ragsoc='"+req.getParameter("ID")+"'");
              //se il RESULTSET non � vuoto fa un check per vedere cosa restituisce RULES mentre nel frattempo pone 1 su LOGGED
              PreparedStatement updateProcuratore = con.prepareStatement("UPDATE privilegi_procuratore SET Logged=? WHERE (userid=? AND pass=?)");
              if(rs!=null){
                   if(rs.next())try {
                        st=con.createStatement();
                        rs2=st.executeQuery("SELECT * FROM privilegi_procuratore WHERE (userid='"+req.getParameter("ID")+"' AND pass='"+req.getParameter("pass")+"' AND Logged=0)");
                        if(rs2!=null){
                             if(rs2.next())try {
                                          autenticato = true;
                                          String utente=req.getParameter("ID");
                                          String password=req.getParameter("pass");
                                          HttpSession s= req.getSession(true);
                                          Utente u =(Utente)s.getValue("Login.utente");
                                          if (u==null){
                                               u =new Utente (utente,password);
                                          else{
                                               u.ID=utente;
                                               u.pass=password;
                                          s.putValue("Login.utente",s);
                                            rs2.close();     
                                            con.close();
                                            updateProcuratore.close();
                                            }catch (Exception e){e.printStackTrace();}
                                                 if (autenticato=true){               
                                                 res.sendRedirect("RulezAmministration");
              else{
                   res.sendRedirect("errorlogin.html");
                   }catch (Exception e){e.printStackTrace();}
                                  res.sendRedirect("errorlogin.html");
              else{
                   res.sendRedirect("errorlogin.html");
              res.sendRedirect("errorlogin.html");
              catch(Exception e){
                   try {
                        e.printStackTrace();
                        res.sendRedirect("errorlogin.html");
                   catch(Exception e1){}
         public void doPost(HttpServletRequest req,HttpServletResponse res){
              try{
              HttpSession s=req.getSession(false);
              Utente u=(Utente)s.getValue("Login.utente");
              u.Logout();
              s.putValue("Login.utente",s);
              res.sendRedirect("index.htm");
                   catch(Exception e1){}
    public class RulezAmministration extends HttpServlet{
         private Connection con;
         private Statement st;
         private ResultSet rs;
         public void doGet(HttpServletRequest req,HttpServletResponse res){
              try{
                   HttpSession s=req.getSession(false);
                   if (s!=null){
                        Utente u= (Utente)s.getValue("Login.utente");
                        if (u!=null){
                             if (u.ID!=null){
                                  res.sendRedirect("Inserimento.jsp");
                             else res.sendRedirect("errorlogin.html");
              catch(Exception e){}
         }

    After you can use:
    String utente=req.getParameter("ID");          
    String password=req.getParameter("pass");
    to get the ID and password, use a Database Access Object to communicate with the database. A sample block of code would something like:
    Connection conn = null;
    Context ctx = null;
    DataSource ds = null;
    try {
         DriverManager.registerDriver(new OracleDriver());
         String connectString = "jdbc:oracle:thin:@...";
                   conn = DriverManager.getConnection(connectString, userName, password);
    } catch (Exception e) {
    e.printStackTrace();
    Then,
    statement = conn.createStatement();
    resultSet = statement.executeQuery("select * from TABLE where Id = id and pass=password");
    if it returns you a result, then, it means the login info is valid, you can set this info in a session object, like:
    request.setSesion().setAttribute("login", "true");
    Later on, in your application, you can chk whether the user has logon by
    request.getSesion().setAttribute("login");
    You should organize your code so that it separate different functions in your program.
    Hope that helps.

Maybe you are looking for

  • ITunes 11 AirPlay 15000 error

    I am currently running iTunes 11.0.1 and I am trying to play music through AirPlay through my Denon 2113 receiver, but I keep getting a 15000 error.  I have searched for a solution and I have come up with nothing.  Does anyone have any ideas or solut

  • How to use select a vi function inside a loop?

    I am modifying the notifier basics part 2.vi to send a notifier to each of 64 sub-vi's. How can you use the 'select a vi' function inside a loop for 64 iterations to access the individual filenames?? Attachments: Notifier_BASICS_Part_2.vi ‏87 KB

  • 3D Graph axis font property missing

    I just updated to LV6.1 and now I have a broken VI in my application. One of my displays uses the 3D graph and when formatting data for display, I set the font size of the graph axes. This worked in 6.0.2 but in 6.1 apparently the font refnum no long

  • UN-pairing wireless mouse and keyboard ?

    I have a new(ish) 27" iMac, OS X 10.6.3 [ with two-tone display ...but that's another story ] I set it up with the wireless mouse and wireless keyboard that came with it. The instructions were pretty clear how to "pair" the mouse and keyboard. So I p

  • PARAMETER ID VALUE NOT DEFAULTED in CREATE MATERIAL MASTER (MM01)

    Hi, Currently when we create material master we like to defualt the field material group, using PARAMETER ID (MKL-Material group). I have defined the parameter ID for MKL(material group) and assigned a material group value, log off and log in again.