Results 1 to 2 of 2
  1. #1
    fernando is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Login with mysql

    Hi, Please help with the code for Login codes with JSP, JavaBean from mySQL database.

    Thanks.

  2. #2
    carl is offline Member
    Join Date
    Jul 2007
    Posts
    35
    Rep Power
    0

    Default

    Please check this:

    login.jsp

    Java Code:
    <%@ page import = "lbm.jsputil.*" %>
    <jsp:useBean id="_loginJSPBean" class="lbm.examples.LoginJSPBean"
    scope="session"/>
    <jsp:setProperty name="_loginJSPBean" property="*"/>
    <% AbstractJSPBean _abstractJSPBean = _loginJSPBean; %>
    <%@ include file="includeheader.jsp" %>
    <html>
    <head><title>Vote Login</title></head>
    <body bgcolor="white">
    <font size=4>
      Please enter your Voter ID and Password
    </font>
    <font size="3" color="Red">
      <jsp:getProperty name="_loginJSPBean" property="errorMsg"/>
    </font>
    <font size=3>
      <form method=post>
        Voter ID <input type=text name=voterId value=<jsp:getProperty
           name="_loginJSPBean" property="voterId"/>>
        Password <input type=password name=password value=<jsp:getProperty
           name="_loginJSPBean" property="password"/>>
      
        <input type=submit value="Login">
      </form>
    </font>
    </body>
    </html>
    <%@ include file="includefooter.jsp" %>
    includeheader.jsp

    Java Code:
    <%-- Set the SharedSessionBean --%>
    <jsp:useBean id="_sharedSessionBean" class="lbm.jsputil.SharedSessionBean" scope="session"/>
    <% _abstractJSPBean.setSharedSessionBean(_sharedSessionBean); %>
    <%-- Set implicit Servlet objects --%>
    <% _abstractJSPBean.setRequest(request); %>
    <% _abstractJSPBean.setResponse(response); %>
    <% _abstractJSPBean.setServlet(this); %>
    <%-- Perform the processing associated with the JSP --%>
    <% _abstractJSPBean.process(); %>
    <%-- If getSkipPageOutput equals false, do not output the JSP page --%>
    <% if (! _abstractJSPBean.getSkipPageOutput()) { %>
    Greetings.

Similar Threads

  1. Login Forms
    By dankonsoer in forum New To Java
    Replies: 1
    Last Post: 08-07-2008, 01:06 PM
  2. I want to get values from login jsp
    By trill in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 08:33 AM
  3. Struts and login
    By Peter in forum Web Frameworks
    Replies: 2
    Last Post: 07-04-2007, 04:36 PM
  4. problems with Login
    By Peter in forum Java Servlet
    Replies: 2
    Last Post: 06-12-2007, 02:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •