Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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: 67192
    169
    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.
     
    crispy bacon. crispy tiny ad:
    RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
    https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!