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

    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
    Location
    Ktm, Nepal
    Posts
    120
    Rep Power
    0

    Default

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

    -->
    In face-config.xml,
    Java Code:
    <managed-bean>
            <managed-bean-name>login</managed-bean-name>
            <managed-bean-class>com.LoginBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>

    -->
    In LoginBean.java,
    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 03:51 AM. Reason: Moderator edit: code tags added

  3. #3
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

Similar Threads

  1. Replies: 2
    Last Post: 04-01-2010, 04:35 AM
  2. Connecting c with java
    By khajalid in forum Networking
    Replies: 6
    Last Post: 12-10-2008, 09:35 PM
  3. Connecting c with java
    By khajalid in forum Advanced Java
    Replies: 4
    Last Post: 09-11-2008, 04: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, 01:06 AM
  5. Form for uploading images
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-11-2008, 09: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
  •