My problem is, that struts 2 does not look in the default package for the action.
struts.xml
login.xml
register.xml
Oleg Vakil
Greenhorn
Joined: May 25, 2011
Posts: 5
posted
0
Hello David,
I have exactly the same problem...
I am trying to start simplest my name example , basing on a lot of examples...
I dont want double your thread...
After near one day reading how simple and effective Struts2:-))) I have decided ask EXperts and saw your thread!
<struts>
<package name="default" extends="struts-default">
<action name="sayhello" class="mypackage.Hello">
<result>/response.jsp</result>
</action>
</package>
</struts>
Although Netbeans complaining on mistakes in this xml....
my jspps:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix = "s" uri="/struts-tags" %>
and second one
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix = "s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
I am <s:property value="message"/>
</body>
</html>
Be lucky
Also look at project's structure!
David Wimmer
Greenhorn
Joined: Jun 01, 2011
Posts: 13
posted
0
I did not want to bother a long time. So I've done all my actions in the default namespace and it works.
Oleg Vakil
Greenhorn
Joined: May 25, 2011
Posts: 5
posted
0
David Wimmer wrote:I did not want to bother a long time. So I've done all my actions in the default namespace and it works.
Nice. But I think, problem is not connected to default namespace.
I tried default namespace too, it did not work.
best regards
Oleg