• 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

How to change ServletPath to repeat 'get' to refresh database put

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Was looking for an answer for hours now and can't crack this one.

On HolRequests.jsp which lists DB records I am making a post request to update a field in one of the records (via facade).
I'm using a form here:
                     
In the servlet I have:


How can I make the application to run the get request below for the jsp again:


As I'm new to servlets and JSPs, I may be doing something completely wrong here. My debugger observation: I do not get the updated results as the ServletPath still = "changeStatus" when entering the doGet block (why??) and so there's no match with the pattern. Thank you in advance!!
 
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
Don't redirect to the JSP, but to its page controller. You should never redirect or link to a JSP; always to its controller. In fact, put the JSPs under WEB-INF so that you cannot accidentally do that.

Please read this article which describes proper structure for Java web apps, and pay particular attention to the PRG pattern.
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic