• 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

HttpServletRequest question

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp form that submits to a servlet, the servlet processes the request and sets attributes in the request and forwards it back to the same jsp page. The jsp page gives a status message and shows the same form. When I submit the form again, it process my new set of data plus the data I submitted last time.

Now I realize that this is because of the fact that I did a Request Dispatch forward which will the request back to the jsp. Is there another alternative way? I just do nto want my old request parameters to be submitted when I do another submit to the servlet.
I guess I could do a redirect or something. The only problem is I stored a status message inside an attribute in my request object.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

When I submit the form again, it process my new set of data plus the data I submitted last time.


Not sure what you mean by this. Since you are submitting one form, how are you getting and processing two sets of data?
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:

Not sure what you mean by this. Since you are submitting one form, how are you getting and processing two sets of data?


ditto. I think there's more of a logic problem in your code rather than JSP stuff (like redirect/forward).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic