• Post Reply Bookmark Topic Watch Topic
  • New Topic

Login Authentication Using Bean and Servlet in JSP  RSS feed

 
walt mull
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going through a tutorial I found on roseindia.net, which can be found here Login Authentication using Bean and Servlet In JSPfollowing 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:



I know others have got this thing working but I have hit a wall. I am very excited to get this working because this stuff looks like fun. Thanks for the help.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please find some place better than roseindia for example code. It's well known to be full of errors and promotion of really poor practices.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
walt mull wrote:org.apache.jasper.JasperException: /jspbeanlogin/loginbean.jsp(7,0) The value for the useBean class attribute logbean.LoginBean is invalid.

That most likely means that there is no class file that corresponds to this class name.
 
walt mull
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please find some place better than roseindia for example code. It's well known to be full of errors and promotion of really poor practices.


Sort of figures...I will go try and dig up some better tutorials. Any suggestions? I am looking for a good way to create a login for a mysql database. I can create a main driver or runner class that can login and validate a username and a password but I hit a wall when using jsp and setting up my web.xml file. Really appreciate the help bear ;)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And be aware that the JSP code you are using is over 10 years out of date. The use of actions like setProperty and the use of scriptlets and scriptlet expressions has been discredited since 2002 when the JSTL and EL were introduced with JSP 2.0.

You really ought to grab a modern book on JSP and Servlets to learn from rather than spending your time learning how to do things the wrong way.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JavaRanch Bunkhouse for book reviews. The Head First JSP and Servlets book is very popular.
 
walt mull
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:See the JavaRanch Bunkhouse for book reviews. The Head First JSP and Servlets book is very popular.


I'll check those out..thanks bear
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to be of help! Welcome to the Ranch!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I always recommend that newcomers to JSP read these articles:
  • The Secret Life of JSPs
  • The Front Man

  •  
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!