This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Redisplay info when a user goes back to previous page

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble redisplaying the information the user entered on a previous screen.
I have a "prev" and "next" bottom.
If the user wants to correct some information on the "prev" screen. Upon their return, the information is gone and they have to re-enter the information?!?
If I do a <jsp:getProperty> I get an null object exception.
Any help/suggestions/sample code?
Thanks much!
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to save the request from the current page in e.g. a HashMap in e.g. Session. Then run the Map through when you 'reenter' the page and parse the values to the fields.
/Rene
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply, I'm a newbie so that is part of the problem.
I am using a session, whether I'm setting it up right is another question.
The exception comes on the first time thru when I make a call to the Bean and I get the exception:
org.apache.jasper.JasperException: Attempted a bean operation on a null object.
On the call to:
<jsp:getProperty name="customer" property="firstName" />
This probably isn't enough information but any ideas???
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a question - do you only use JSP or are you in for Servlet as well?
/Rene
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've made a sample:
first.jsp

second.jsp, next.jsp....

HelperBean.java

Just to give you an idea.
/Rene
[ July 17, 2002: Message edited by: Rene Larsen ]
 
darren schild
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help!
I am using a servlet, JSPs & a bean.... Haven't worked, much, with hashmaps but i'm getting there.....
So, I have 3 JSPs a contact.jsp, a contactInfo.jsp and a contactDisplay.jsp, along with the Contact(servlet) and ContactCustomer(bean). When I fill out the contact page the request is then forwarded to the contactInfo.jsp when I hit "prev" to go back and edit, everything is gone.
It's gotta be something simple but.........
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, as I can read from your post, the sample I just gave you will fulfil what you need
/Rene
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!