• 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

Function Declaration in jsp

 
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need some help.How can i use a function in jsp.
Example,

need to verify user entry at a submit jsp page.
without a function i can't verify the data.
If anyone can help i would be grateful.

thnx!!!
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With Java, you will have to do it in two steps...one have the action of the form go to an intermediate page, like so...



You can look that up in an HTML tutorial or resource.

Next on the page inputCheck.jsp, you would have something like this...



Then you can operate on the input, and check it as you need to. If you need simpler input checking you might try Javascript, because the request won't have to make a round trip to the server to verify the input. Hope this helps some.
 
Aris Doxakis
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It solved a couple of my problems.

Thnx man.
 
Aris Doxakis
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now that i tried it it doesn't really work.
how can i get the values from the fields at the new jsp page??

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

Originally posted by Aris Doxakis:
how can i get the values from the fields at the new jsp page??



<%
String yourVar = request.getParameter("yourFieldName");
// Do something with yourVar here
%>

or, if you want to display the values in the page:

<%= request.getParameter("yourFieldName") %>

Is that what you were asking?
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic