• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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
     
    Author and ninkuma
    Marshal
    Posts: 66806
    168
    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.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!