Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

v gang

Greenhorn
+ Follow
since May 07, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by v gang

I working on a project from scratch using RAD7.5,struts2.1.6,spring and hibernate. I just started integrating all these and created login page. when i tried to access the loginaction i am getting the following error.

com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Could not find action or result
No result defined for action gov.tx.hhsc.hraps.action.LoginAction and result success
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:363).....

Here are the configurations,

My web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<display-name>hrapsWeb</display-name>
<context-param>
<param-name>tilesDefinitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/struts/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

MY Struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.action.extension" value="action" />



<package name="gov" namespace="/hraps" extends="struts-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>

<action name="login" class="hraps.LoginAction" >
<result type="tiles">tiles.login</result>
</action>
</package>
</struts>

Tiles.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>
<definition name="tiles.login" template="/base/Layout.jsp">
<put-attribute name="application" value="(HRAPS)"/>
<put-attribute name="header" value="/base/Header.jsp"/>
<put-attribute name="navigation" value=""/>
<put-attribute name="body" value="/base/Login.jsp"></put-attribute>
<put-attribute name="footer" value="/base/Footer.jsp"/>
</definition>
</tiles-definitions>

Action class

public class LoginAction extends BaseAction {

/**
*
*/
private static final long serialVersionUID = 1L;

public LoginAction() {
// TODO Auto-generated constructor stub
}

public String execute() throws Exception {
System.out.println("In LoginAction execute method");
return SUCCESS;
}

}

Login.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page
language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@taglib uri="/struts-dojo-tags" prefix="sx"%>
<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<s:form name="frmLogin" action="login" theme="simple">
<div class="ContentRow">


</div>
<div class="ContentRow">
<div class="FieldLabel" style="width:22%">
<s:label value="Employee ID:" />
</div>
<div class="Field" style="width:38%" align="left">
<s:textfield name="user.employeeData.emplid" maxlength="25" size="25" required="true" />
</div>
</div>
<div class="ContentRow">
<div class="FieldLabel" style="width:22%">
<s:label name="password" value="Password:" />
</div>
<div class="Field" style="width:38%" align="left">
<s:password name="password" maxlength="25" size="25" required="true" />
</div>
</div>
<div class="displayButton">
<s:submit name="submit" value=" Submit " onclick="return validate();" />
<s:reset name="reset" value=" Reset " />
</div>
</s:form>
</body>
</html>

Can you please help me what is wrong in my files. I am struck here.

Thanks,
gang.
11 years ago
Hi,

I have to start my application from scratch. So we planned to go with RAD7,Struts2 and tiles. At present i am setting my workspace. So can you provide me some details to integrate tiles with struts2.

I have configured struts2 in RAD7 in the following way.
Added the required jars in lib folder.
Included the following in struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
< !DOCTYPE struts PUBLIC<br /> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"<br /> "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="" namespace="" extends="struts-default">
<action name="" class="">
<result></result>
</action>
</package>
</struts>

and web.xml looks like following

<?xml version="1.0"?>
< !DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"<br /> "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>My Application</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

Can you let me know what else i have to do to configure struts and i want to know how to integrate tiles in struts2.

Please help me in this.bcz i have to start my application and i am struck with integrating tiles.

Thanks for help in advance
14 years ago
I have to start my application from scratch. So we planned to go with RAD7,Struts2 and tiles. At present i am setting my workspace. So can you provide me some details to integrate tiles with struts2.

I have configured struts2 in RAD7 in the following way.
Added the required jars in lib folder.
Included the following in struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="" namespace="" extends="struts-default">
<action name="" class="">
<result></result>
</action>
</package>
</struts>

and web.xml looks like following

<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>My Application</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

Can you let me know what else i have to do to configure struts and i want to know how to integrate tiles in struts2.

Please help me in this.bcz i have to start my application and i am struck with integrating tiles.

Thanks for help in advance
14 years ago