• Post Reply Bookmark Topic Watch Topic
  • New Topic

Check and Passing Values

 
Sam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I am new to JSP.
I have two JSPs a and b.
In (a), I am getting Login and Passwd and passing to (b) and then calling a class to connect to the db.
Please let me know how,
(1) How I can pass values to another JSP and call the java class to connect to the db ?
thanks for a ll the help
:roll:
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Paraankusam!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Fourm Bartender
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With regards to your question.
Your username and password are being submitted to the 'b' JSP and are available as parameters on the servlet request instance.
Might I use this oppurtunity to suggest that you follow a 'Model 2' pattern and submit your form to a servlet rather than a JSP. The servlet, after processing your parameters, would then forward to a JSP page to display the results of the processing. This is considered a better practice than performing operations in a JSP page.
hth,
bear
 
Sam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your mail. I u/stand using Model 2 is traditional and better practice.
But, can I also use an applet or java program that processes the ID I am passing from JSP and return it ?
'Cause, first of all, I am new to web environment and I would like to achieve this asap.
Your timely help are reall appreciated.
Rgds,
Paraankusam
Originally posted by Bear Bibeault:
With regards to your question.
Your username and password are being submitted to the 'b' JSP and are available as parameters on the servlet request instance.
Might I use this oppurtunity to suggest that you follow a 'Model 2' pattern and submit your form to a servlet rather than a JSP. The servlet, after processing your parameters, would then forward to a JSP page to display the results of the processing. This is considered a better practice than performing operations in a JSP page.
hth,
bear
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!