• 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

jsp

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello everybody,
i am very new to jsp and facing a very priliminary problem.
please help me.
i have a html form in which i am accepting text im text field and i want to pass this text to my jsp program on pressing submit in html.
how can i accept this data from html in jsp prog?
i am familiar with servlet programming.
i have tried with object.getParameter("");
i am getting the html content of JSP file but i am not getting the dynamically generated page.
can i use this method in jsp or their is any other way.
please suggest me
thanx in advance
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To access the form parameters, you will have to use getParameter method of "request" object. "request"(instance of HttpServletRequest) is an implicitly available object for any JSP. If you have named your text field as "text1", then to extract its value use: String t1 = request.getParameter("text1");
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi sachin,

u have to use the 'request' object(this object is implicit one..u need not declare) in JSP to capture the value passed from HTML page..
Suppose, u have a text field by name 't1', then in JSP page,
u have to write the code as
<% String name=request.getParameter("t1");
out.println(name);
%>
U said u are familiar with servlet prog..so it won't be a problem for u..
try this and get back!!
best of luck!!
regds,
Sandeep.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic