java - Unable to get Struts2 Hello World to work using Eclipse and Maven -
this site doesn't allow user ask technical questions tutorial believe broken:
http://www.mkyong.com/misc/how-to-use-mkyong-tutorial/
i'm using:
- maven: 3.2.1
- tomcat 7
- java 1.7
- eclipse: luna release (4.4.0)
i'm getting message:
warning: not find action or result there no action mapped namespace [/] , action name [] associated context path [/struts2example]. - [unknown location] i can never login.jsp page unless enter full url. then, when click on submit button, doesn't go welcome_user.jsp page either.
can tell me how can fix , hello world example work in using eclipse?
if follow tutorial, linked page struts 2 hello world example, , done till p. 7 should run it written
in struts2, can access action class directly suffix of .action.
http://localhost:8080/struts2example/user/login.action
if tried access application
http://localhost:8080/struts2example you message , 404 error code returned browser.
warning: not find action or result there no action mapped namespace [/] , action name [] associated context path [/struts2example]. - [unknown location]
the workaround add file web root folder redirect browser correct location.
index.html:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <meta http-equiv="refresh" content="0;url=user/login.action"> </head> <body> <p>loading ...</p> </body> </html> also modify web application deployment descriptor include file name welcome files list.
web.xml:
<welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> that's it, if looking hello world tutorial, should use these references:
Comments
Post a Comment