Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Adam Slodowy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic