Results 1 to 3 of 3
- 06-11-2012, 12:42 AM #1
Member
- Join Date
- Jun 2012
- Posts
- 7
- Rep Power
- 0
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:
and here is the contents of the JavaBean.java file the javabean.jsp file is trying to resolve: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>
Thank you all so much for the help with this. I am ready to have fun with this stuffJava 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; } }
Last edited by proksy; 06-11-2012 at 12:45 AM.
- 06-11-2012, 02:40 AM #2
Member
- Join Date
- Jun 2012
- Posts
- 7
- Rep Power
- 0
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
-
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.
Similar Threads
-
javax.servlet.jsp.JspException: Cannot find bean org.apache.struts.taglib.html.BEAN i
By gurpreet.singh in forum Advanced JavaReplies: 1Last Post: 03-23-2011, 07:55 AM -
Single user Login authentication
By vinoopraj in forum Web FrameworksReplies: 0Last Post: 07-20-2010, 08:19 AM -
Program to validate a user against LDAP for login Authentication
By syntel in forum Java ServletReplies: 2Last Post: 05-18-2010, 03:12 PM -
Biometric Thumb Impression Authentication for login in jsp
By kishore rajkumar in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-12-2009, 02:30 PM -
Proxy Authentication - Cannot login as multiple users
By Dikla in forum Advanced JavaReplies: 1Last Post: 08-05-2008, 10:18 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks