Results 1 to 2 of 2

Thread: ejb login page

  1. #1
    mtrsykl is offline Member
    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Default ejb login page

    I want to create a simple login page, I use loginEJB, loginManagedBean, user entity clas and an xhtml index page. I want to check the user exist or not via ejb when the user put name and pasword to form and post it, how can I check this user and password exist on database?

    I want to use something like this

    TypedQuery<User> list = em.createNamedQuery("userCheck",User.class);
    login if

    list.name == user.name
    and

    list.password == user.password
    user.name and user.password coming from login form.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: ejb login page

    createNamedQuery returns a TypedQuery, not a result.
    Presumably your query takes parameters for user name and password, so you need to provide those and getSingleResult.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. login page
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-09-2008, 08:37 AM
  2. JSP login page
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-06-2008, 04:23 AM
  3. login page
    By keerthi_y19 in forum New To Java
    Replies: 9
    Last Post: 08-06-2008, 11:58 AM
  4. Login page
    By banie in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-03-2008, 02:05 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
  •