I`m new to Struts2 and trying to get a simple example up and running. Can't seem to figure out where I`m going wrong.
I`m just trying to print out a hello message with the value input in the index.jsp. Once the value is submitted in the Index.jsp, I keep getting
a HTTP 404 error saying that 'The requested resource is not available'. Appreciate answers to point me in the right direction.
I had already tried using the struts tags as you mentioned earlier, but resorted to using the html tag as I was getting the following exception.
When using html tags, I was able to view the index.jsp page atleast, the problem occurred only when submitting the page.
1) Are you trying to access the JSP page directly with the struts tags ? Sometimes this error arises due to directly accessing the JSP and not letting the Dispatcher to initialize the request processing cycle and create needed value stack. In this case , you will have to write an action class that you will initialy hit which will then render the JSP page for you.
2) My second guess is the filterDispatcher. This may be the cause of the issue and I am just sharing my experience because I spent countless hours to determine the solution to this problem when I started learning struts. In the web.xml you have defined the filterDispatcher as org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter , try changing this to the old dispatcher org.apache.struts2.dispatcher.FilterDispatcher. Again , this step is just a wild guess I am taking , it may or may not solve your problem.
3) what URL do you type to invoke your action ?
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop