User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 425,982 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,636 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1781 | Replies: 26 | Solved
Reply
Join Date: Jul 2008
Posts: 40
Reputation: shijunair is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shijunair shijunair is offline Offline
Light Poster

Re: validation page

  #11  
Jul 24th, 2008
hi,
I have to install it .let me upgrade with the latest version as suggested then we can go ahead with the queries.I have never installed mysql because i had seen that there is mysql server,mysql enterprise,etc .so what exactly i have to download and where can i find it free.same thing goes for java also.For now thanks .
see you.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: validation page

  #12  
Jul 24th, 2008
Download
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Jul 2008
Posts: 40
Reputation: shijunair is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shijunair shijunair is offline Offline
Light Poster

Re: validation page

  #13  
Jul 24th, 2008
hi,
I am installing mysql server and over there it has several options for windows i.e
2.4.8.1. Choosing An Installation Package
2.4.8.2. Installing MySQL with the Automated Installer
2.4.8.3. Using the MySQL Installation Wizard
2.4.8.4. MySQL Server Configuration Wizard
2.4.8.5. Installing MySQL from a Noinstall Zip Archive
2.4.8.6. Extracting the Install Archive
2.4.8.7. Creating an Option File
2.4.8.8. Selecting a MySQL Server Type
2.4.8.9. Starting the Server for the First Time
2.4.8.10. Starting MySQL from the Windows Command Line
2.4.8.11. Starting MySQL as a Windows Service
2.4.8.12. Testing The MySQL Installation
2.4.8.13. Troubleshooting a MySQL Installation Under Windows
2.4.8.14. Upgrading MySQL on Windows
2.4.8.15. MySQL on Windows Compared to MySQL on Unix
now which one to choose and go ahead .after the complete installation of java and db,do i have to set any environment variables or else any other setting to be done.for that please assist me.thank you.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: validation page

  #14  
Jul 24th, 2008
Ehmm, what exactly did you downloaded?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Jul 2008
Posts: 40
Reputation: shijunair is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shijunair shijunair is offline Offline
Light Poster

Re: validation page

  #15  
Jul 24th, 2008
hi,
That was just a mistake from my side . Till now i have downloaded tomcat 6.0 and continuing to download mysql community server and JDK5.0 as well.so till now working fine.see u back after the download is over because assistance is still required.
thank you.
take care
Reply With Quote  
Join Date: Aug 2008
Posts: 18
Reputation: Sharaiha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
Sharaiha Sharaiha is offline Offline
Newbie Poster

Re: validation page

  #16  
Aug 2nd, 2008
Originally Posted by peter_budo View Post
You misunderstand the idea of JSP-servlet relation. Bellow is something you should do (I did not compile it so it may not be 100% correct)

Simple html login screen
  1. <html>
  2. <head>
  3. <title>Ask for Names Example</titls>
  4. </head>
  5. <body bgcolor="LightSkyBlue">
  6. <h3 align="center">Login event with use of the POST method</h3>
  7. <form action="LoginEvent" method="post">
  8. <p align="center">Username: <input type="text" site="20" name="username">
  9. &nbsp;&nbsp;&nbsp;
  10. Password: <input type="text" size="20" name="password"></p>
  11. <p align="center"><input type="submit" value="Submit"></p>
  12. </form>
  13. </body>
  14. </html>
Note: The form parameter action uses LoginEvent servlet that has been mapped through web.xml.

servlet to get data and connect to db
  1. import java.io.*;
  2. import java.util.*;
  3. import javax.servlet.*;
  4. import javax.servlet.http.*;
  5.  
  6. public class FrontController extends HttpServlet
  7. {
  8. Connection conn;
  9. Statement stmt;
  10.  
  11. public void init() throws ServletException
  12. {
  13. try
  14. {
  15. Class.forName("com.mysql.jdbc.Driver").newInstance();
  16. }
  17. catch (Exception ex)
  18. {
  19. System.out.println("Exception is : " + ex.toString() );
  20. }
  21.  
  22. public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
  23. {
  24. String username = request.getParameter("username");
  25. String password = request.getParameter("password");
  26. boolean bValid = true;
  27. HttpSession session = request.getSession();
  28.  
  29. if( (name.lenght() == 0) || (password.length() == ))
  30. {
  31. bValid = false;
  32. }
  33.  
  34. if(bValid) // submited data are OK
  35. {
  36. try
  37. {
  38. conn = DriverManager.getConnection("jdbc:mysql://localhost/"
  39. + "database_name?user=your_username&password=your_password");
  40. stmt = conn.createStatement();
  41. }
  42. catch(SQLException ex)
  43. {
  44. System.out.println("SQLException : " + ex.getMessage() );
  45. }
  46.  
  47. /**
  48. * DO THE REST OF DATABASE REQUESTS
  49. *
  50. * DO NOT FORGET TO CLOSE CONNECTION
  51. *
  52. **/
  53. }
  54.  
  55. if(bValid)
  56. {
  57. // YOU MAY WANT TO CREATE SOME SESSIONS HERE
  58. RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/accept.jsp");
  59. dispatcher.forward(request, response);
  60. }
  61. else
  62. {
  63. RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/reject.jsp");
  64. dispatcher.forward(request, response);
  65. }
  66. }
  67. }



does this get written directly to the Dreamweaver page or should it be different,
does the system.out.println() print on the browser and what about a mailto link can you help me with that?
i am sorry if these questions seem absurd but i am new with JSP and really need help for a major project
thankyou
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: validation page

  #17  
Aug 2nd, 2008
@does this get written directly to the Dreamweaver page or should it be different
You do not want to use Dreamweaver for Java web development. NetBeans is more reasonable

@does the system.out.println() print on the browser
No that is system message that will displayed if anything happens while Tomcat server running command prompt

@what about a mailto link can you help me with that
mailto is a basic of HTML that you should already know, if not visit w3schools.com website

@i am sorry if these questions seem absurd but i am new with JSP and really need help for a major project
Do you have any Java programming experiences?

PS: Hijacking other people thread is not a nice thing to do...
Last edited by peter_budo : Aug 2nd, 2008 at 5:09 pm. Reason: typo
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Aug 2008
Posts: 18
Reputation: Sharaiha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
Sharaiha Sharaiha is offline Offline
Newbie Poster

Re: validation page

  #18  
Aug 3rd, 2008
Originally Posted by peter_budo View Post
@does this get written directly to the Dreamweaver page or should it be different
You do not want to use Dreamweaver for Java web development. NetBeans is more reasonable

@does the system.out.println() print on the browser
No that is system message that will displayed if anything happens while Tomcat server running command prompt

@what about a mailto link can you help me with that
mailto is a basic of HTML that you should already know, if not visit w3schools.com website

@i am sorry if these questions seem absurd but i am new with JSP and really need help for a major project
Do you have any Java programming experiences?

PS: Hijacking other people thread is not a nice thing to do...



how can i say this...
this is an assignment by my web development lecturer which has to be done in dreamweaver as a jsp page which re-validates what has been entered in the previous page and if it is correct it has to print a mailto link on the page otherwise it displays an error message, the lectures are missing those points so i am going for any help i can get
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 296
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: validation page

  #19  
Aug 3rd, 2008
Do you have Tomcat on your pc or access to Tomcat based web hosting?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Aug 2008
Posts: 18
Reputation: Sharaiha is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
Sharaiha Sharaiha is offline Offline
Newbie Poster

Re: validation page

  #20  
Aug 3rd, 2008
Originally Posted by peter_budo View Post
Do you have Tomcat on your pc or access to Tomcat based web hosting?

no...
do you know where to get it from??
thanks a lot man
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 11:31 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC