• 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

Check and Passing Values

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
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
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
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

reply
    Bookmark Topic Watch Topic
  • New Topic