• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Login Authentication Using Bean and Servlet in JSP

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad to be of help! Welcome to the Ranch!
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I always recommend that newcomers to JSP read these articles:
  • The Secret Life of JSPs
  • The Front Man

  • reply
      Bookmark Topic Watch Topic
    • New Topic