Failed to get Struts2 Hello World to work with Eclipse and Maven

This site does not allow the user to ask technical questions to his textbook, which, in my opinion, is broken:

http://www.mkyong.com/misc/how-to-use-mkyong-tutorial/

I use:

  • maven: 3.2.1
  • tomcat 7
  • java 1.7
  • Eclipse: Luna Release (4.4.0)

I get this message:

WARNING: Could not find action or result
There is no Action mapped for namespace [/] and action name [] associated with context path [/Struts2Example]. - [unknown location]

I can never get to the page login.jspunless I enter the full URL. But even when I click the submit button, it does not go to the page welcome_user.jsp.

Can someone tell me how I can fix this and get this Hello World example for working with Eclipse?

+1
source share
1 answer

, Struts 2 Hello World Example, . 7

Struts2 .action.

http://localhost:8080/Struts2Example/User/Login.action

http://localhost:8080/Struts2Example

, 404 .

: . [/] [], [/Struts2Example], . - [ ]

- -, .

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>

-, .

web.xml :

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

, Hello World, :

+1

All Articles