Weird Error: Hitting enter key on a page leads to " does not contain handler parameter named ‘action’" error
I got a weird error about a couple of days back. My JSP page was submitting the contents of my page when I hit the enter key whilst inside the LONE textbox on the page.
I googled for the answer and found that it was probably because of the browser that was submitting the page since it found ONLY ONE TEXT ELEMENT.
So the solution:
This error was solved by simply creating another text element with “style=display:none”. The page will hence have TWO elements and so the browser wont submit the page. The user will however see only the textbox that is visible.
Here’s the weird error:
javax.servlet.ServletException: Request[/RecoverPassword] does not contain handler parameter named ‘action’. This may be caused by whitespace in the label text. org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:215) org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:249) org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:710) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
Thanks!!
It was hard to find the solution on Google, but your blog helped me today
Thanks Márcio. Glad it helped.