Quantcast
Channel: Adobe Community : Popular Discussions - CQ5 (read only)
Viewing all articles
Browse latest Browse all 12476

Form, Servlet and repopulate form in case of error

$
0
0

Good morning,

 

I come to ask for help in this case where I am block.

 

I have an html form calling a servlet, if the servlet find an internal error or a validation error returns to the form and the form repopulate the values.

 

My problem is I am coming back to the form with a forward like that:

 

        final SlingHttpServletRequest req = new SlingHttpServletRequestWrapper(request) {

             @Override

             public String getMethod() {

                                                         return "GET";

                                          }

                           };

 

                  final RequestDispatcher dispatcher = req.getRequestDispatcher("URLofTheForm");

                           dispatcher.forward(req, response);

 

and in that way in the browser appears the path of the servlet where the form called and is not viable to me. Is there a way to achieve the same but in the browser appears the correct url where the form is?

 

Probably exist another way to achieve this behaviour, but I do not know.

 

Thank you for the help.

 

Miguel.


Viewing all articles
Browse latest Browse all 12476

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>