• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Forward pages with Servlets

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All!

I am trying to foward a jsp page in my servlet to teste to see if my Connetion to the database is working. I put the forward with the page but .I start the tomcat and put my user and pass but I dont donw if it is working because I am not being able to call the success page.

SO What is wrong??



Any Help Please!!

Thanks
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well a little more information would be helpfull.

Based on your code above either the request will be forwarded to the "success.jsp" or "retry.jsp". And based on your logic it should always go to "retry.jsp" more times than not.

You are comparing your request parameters with empty(DbUserName and DbPassword) strings. Also you are not querying your database to see if the username and password even exists in the database.

What are the messages are you seeing.

Craig.
 
campos teixeira
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want this. My login page calls the Servlet to check if the username and password matchs the user input with the database. I did a success page in the loop to see if it wors in red but nothing comes up. The code compiles fine but I think the Servlet class is not calling the databse??

I just saw that my username and password is empty but my intention is to get the strinb username and password in the table in the database.

So does anyone knows how or wher to get tutorials??

I come up with this inside the post method




SO what you think?? And how I do I do to get the string inside the table in the columns username and passord to compare with the user input??
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before doing anything else you need to get some JDBC basics under your belt. Find a JDBC tutorial and work through it. Here's one that I found with a three second google search.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are some Sun resources.
[ May 31, 2004: Message edited by: Bear Bibeault ]
 
campos teixeira
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply!

Will have a look at it?


bye
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frankly, no. You are making some very basic JDBC mistakes that going through a basic tutorial should help you solve. If you are not going to put at least that much effort into it, why should you expect people to put effort into helping you?
 
campos teixeira
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice reply hein?
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you may be getting an Exception while loading the driver or may be getting the null connection. Try to print the exception to a log file and see what exception you are getting. Becoz by looking at your code if an exception is thrown it will go to catch block and you will not be able to execute the lines for forwarding to other page.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic