• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

redirect but textfields value should not empty  RSS feed

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have 2 textfield in a form in jsp page(a.jsp)
when i click on button it goes to another jsp page and check textfield1 value according to a condtion
if con. true then reurns to again previous page
so i used
response.sendRedirect("a.jsp");
but when it redirect to a.jsp the textfields are empty
i want to show textfields with fill values that i entered
how is that possible?
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to do one of the following:
  • Pass the text on the query string (not the best idea where you're talking about textareas which could have a lot of text)
  • Store the value of the text fields in session
  • Write the text to your database and read it again from the next JSP.





  •  
    deep raj
    Ranch Hand
    Posts: 186
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    ok i used string to store that textfield value
    but how can i fill textfield with that value when that page is reopen using response.sendRedirect
     
    Marshal
    Posts: 67256
    170
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Do you know HTML? Each form element has a value attribute.
     
    deep raj
    Ranch Hand
    Posts: 186
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    i know html
    i already set string value in textfield value.
    but at starting point string has null,so it sets textfield value null
    while value is stored in textfield which entered by user at run time.
     
    Sheriff
    Posts: 14691
    16
    Eclipse IDE Ubuntu VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This is probably a forward that you want to do, not a redirect.
     
    You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
    ScroogeXHTML - the small and fast RTF to HTML converter library
    https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!