Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: JSP N HTML SIMPLE PROGRAM

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JSP N HTML SIMPLE PROGRAM

    Hello people,


    I have configured TOMCAT6.0. I followed the following steps to configure:
    1. Opened catalina n gave the path. JAVA_HOME="JDK1.6_PATH"
    2. Opened CMD gave the tomcat path... STARTED THE SERVER.Then STOPPED IT
    3. Installed Netbeans6.1, configured tomcat server in it.



    Later i typed a simple program with JSP N HTML:
    The following is the HTML code:
    <html>

    <head>
    <title>HELLO WORLD123</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <form action="index.jsp">
    firstname<input type="text" name="firstname" value="username">
    password<input type="password" name="password" value="password">
    <input type="submit" value="submit">
    </form>
    </body>
    </html>


    JSP code:


    <html>
    <head>
    <title>123</title>
    </head>
    <body>
    <h2>Hello World!</h2>

    <%
    String firstname=request.getParameter("firstname");
    String lastname=request.getParameter("lastname");
    %>

    <%=firstname%>
    <%=lastname%>

    <form action="newhtml.html" method="post">
    <input type="submit" value="return">
    </form>
    </body>
    </html>



    When i save n run this program the browser is giving a diff output. It is showing the out of index.jsp. The output looks like the following:

    Hello World!




    Please help me solve this issue. What should i do now.
    Regards
    JUGAL


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: JSP N HTML SIMPLE PROGRAM

    What did you save the jsp file as, and what is the url you are looking up?

Similar Threads

  1. urgent simple help for a very simple program
    By albukhari87 in forum Java Applets
    Replies: 4
    Last Post: June 5th, 2010, 03:43 PM
  2. simple program
    By Memb in forum Paid Java Projects
    Replies: 0
    Last Post: March 17th, 2010, 01:47 PM
  3. PLEASE HELP!!!! simple java program...
    By parvez07 in forum Object Oriented Programming
    Replies: 5
    Last Post: August 26th, 2009, 06:38 AM
  4. help with simple java program
    By parvez07 in forum Java Theory & Questions
    Replies: 4
    Last Post: August 25th, 2009, 07:19 AM
  5. Someone please help me write a simple program!!!
    By ocean123 in forum Loops & Control Statements
    Replies: 3
    Last Post: June 14th, 2009, 09:46 PM