Results 1 to 4 of 4
  1. #1
    proksy is offline Member
    Join Date
    Jun 2012
    Posts
    7
    Rep Power
    0

    Question Login Authentication Using Bean and Servlet in JSP

    I am going through a tutorial I found on roseindia.net, which can be found here login Authentication using Bean and Servlet In JSP following the tutorial I found there was a small syntax error in the file loginbean.jsp causing the error:

    org.apache.jasper.JasperException: /jspbeanlogin/loginbean.jsp(9,57) Attribute value request.getParameter("userName") is quoted with " which must be escaped when used within the value
    org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:40)

    to be thrown. I have replaced the double quotes with single quotes and have resolved this syntax issue. I have now run into another problem. The loginbean.jsp is throwing the error:

    org.apache.jasper.JasperException: /jspbeanlogin/loginbean.jsp(7,0) The value for the useBean class attribute logbean.LoginBean is invalid.

    I have recompiled the LoginBean.java file a few different times in both the /WEB-INF/classes and /WEB-INF/classes/logbean folders and am still having this error. Here is the contents of my loginbean.jsp file which is throwing the error:

    Java Code:
    <HTML>   
    <HEAD><TITLE>DataBase Search</TITLE></HEAD>  
    <BODY>
    
    <%@ page language="Java" import="java.sql.*" %>  
    
    <jsp:useBean id="db" scope="request" class="logbean.LoginBean" >
    
    <jsp:setProperty name="db" property="userName" 
        value='<%=request.getParameter("userName")%>'/>
    <jsp:setProperty name="db" property="password" 
        value='<%=request.getParameter("password")%>'/>
    
      </jsp:useBean>
    <jsp:forward page="hello">
    <jsp:param name="username" value='<%=db.getUserName()%>' />
    <jsp:param name="password" value='<%=db.getPassword()%>' />
    
    </jsp:forward> 
    
    
    </body>
    </html>
    and here is the contents of the JavaBean.java file the javabean.jsp file is trying to resolve:

    Java Code:
    package logbean;  
    //<---I have commented this out and recompiled outside of the logbean folder 
    // and changed class="logbean.LoginBean" to class="LoginBean" with no success
    public class LoginBean {
             
            String userName="";
    	    String password="";
    
            public String getUserName() {
                return userName;
            }
            public void setUserName(String userName) {
                this.userName = userName;
            }
        
            public String getPassword() {
                return password;
            }
            public void setPassword(String password) {
                this.password = password;
            }
        }
    Thank you all so much for the help with this. I am ready to have fun with this stuff
    Last edited by proksy; 06-11-2012 at 12:45 AM.

  2. #2
    proksy is offline Member
    Join Date
    Jun 2012
    Posts
    7
    Rep Power
    0

    Default Re: Login Authentication Using Bean and Servlet in JSP

    I have been told from a reputable professional that this tutorial or example is of poor quality and is terribly outdated. I guess this thread can be deleted as I am abandoning this tutorial and will do some more reading on jsp and servlets before attempting another post. Thanks

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Login Authentication Using Bean and Servlet in JSP

    I have noticed that your tutorial link was to roseindia, and yes, that site has a reputation for spotty quality. Please read BalusC blog on the site: What is it with RoseIdia for a little more detail on this.

  4. #4
    fufransas is offline Member
    Join Date
    Aug 2014
    Location
    USA
    Posts
    1
    Rep Power
    0

    Default Ray Ban Sunglasses Outlet

    <a href="https://www.microskincenter.com/conditions/RayBan.cfm" title="Ray Ban Outlet"><strong>Ray Ban Outlet</strong></a> Ray Ban Outlet https://www.microskincenter.com/conditions/RayBan.cfm Ray Ban Outlet
    <a href="https://www.microskincenter.com/conditions/RayBan.cfm" title="Cheap Ray Bans"><strong>Cheap Ray Bans</strong></a> Cheap Ray Bans https://www.microskincenter.com/conditions/RayBan.cfm Cheap Ray Bans
    <a href="https://www.microskincenter.com/conditions/RayBan.cfm" title="Ray Ban Sunglasses Outlet"><strong>Ray Ban Sunglasses Outlet</strong></a> Ray Ban Sunglasses Outlet https://www.microskincenter.com/conditions/RayBan.cfm Ray Ban Sunglasses Outlet
    <a href="https://www.microskincenter.com/conditions/RayBan.cfm" title="Cheap Ray Ban Sunglasses"><strong>Cheap Ray Ban Sunglasses</strong></a> Cheap Ray Ban Sunglasses https://www.microskincenter.com/conditions/RayBan.cfm Cheap Ray Ban Sunglasses
    <a href="https://www.microskincenter.com/conditions/RayBan.cfm" title="Ray Ban Sunglasses Discount"><strong>Ray Ban Sunglasses Discount</strong></a> Ray Ban Sunglasses Discount https://www.microskincenter.com/conditions/RayBan.cfm Ray Ban Sunglasses Discount
    <a href="https://www.microskincenter.com/conditions/RayBan.cfm" title="Ray Ban Sunglasses"><strong>Ray Ban Sunglasses</strong></a> Ray Ban Sunglasses https://www.microskincenter.com/conditions/RayBan.cfm Ray Ban Sunglasses

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2011, 07:55 AM
  2. Single user Login authentication
    By vinoopraj in forum Web Frameworks
    Replies: 0
    Last Post: 07-20-2010, 08:19 AM
  3. Replies: 2
    Last Post: 05-18-2010, 03:12 PM
  4. Biometric Thumb Impression Authentication for login in jsp
    By kishore rajkumar in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-12-2009, 02:30 PM
  5. Replies: 1
    Last Post: 08-05-2008, 10:18 AM

Posting Permissions

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