Results 1 to 3 of 3
  1. #1
    kiz106 is offline Member
    Join Date
    May 2010
    Rep Power

    Default Connecting and Inserting Images to a java form.

    Am developing a database web driven application.I created my login page containing UserName and Password fields.When I Insert data into both fields and I click the login button,a message appears-Login Successfull but the next form isnt TRIGGERED.Can anyone help me with that Java code that will enable me TRIGGER/RETRIEVE my next form and where to place that code.
    Lastly I want to Insert an Image onto my java form.Where do I put the Image amongest my project folders or which icon do i use from the pallete window to do that?

  2. #2
    Prajin's Avatar
    Prajin is offline Senior Member
    Join Date
    Jun 2010
    Ktm, Nepal
    Rep Power


    your button only displays message.
    Java Code:
    In index.jsp,
    <h:commandButton action="#{login.confirmUser}"/>

    In face-config.xml,
    Java Code:

    Java Code:
    public String confirmUser() {
            EntityManager em = emf.createEntityManager();
            try {
                Query query = em.createNamedQuery("Login.findByLoginName");
                query.setParameter("loginName", user_name);
                Login log = (Login) query.getSingleResult();
                //-- if condition, if correct go to this page
                if (log.getLoginPassword().equals(user_password)) {
                    System.out.println("---* Login is Success!!! *---");
                    return "Success";
                } else {}...
    Moderator edit: code tags added
    Last edited by Fubarable; 07-01-2010 at 04:51 AM. Reason: Moderator edit: code tags added

  3. #3
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Rep Power

Similar Threads

  1. Replies: 2
    Last Post: 04-01-2010, 05:35 AM
  2. Connecting c with java
    By khajalid in forum Networking
    Replies: 6
    Last Post: 12-10-2008, 10:35 PM
  3. Connecting c with java
    By khajalid in forum Advanced Java
    Replies: 4
    Last Post: 09-11-2008, 05:47 AM
  4. Inserting data to database from the form
    By Ms.Ranjan in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-17-2008, 02:06 AM
  5. Form for uploading images
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-11-2008, 10:15 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