aspose file tools*
The moose likes Struts and the fly likes help with module level struts config Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "help with module level struts config" Watch "help with module level struts config" New topic
Author

help with module level struts config

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
I created a module level struts config struts-config-employee.xml. I use eclipse 3.2.1 with myeclipse plugin. It creates an initparam entry in web.xml file.

I have a addemployee screen with firstname,lastname textbox.
On submit I show a thank you page

This is my tree structure


HEre is my Struts-config-employee.xml


when I try to http://localhost:8080/Employee/pages/Addemployee.jsp
gives me an error page

I try the same above using the default struts-config.xml . It works. I am not sure what the problem is?

-- added [ c o d e ] tags -- Merrill
[ February 02, 2007: Message edited by: Merrill Higginson ]
Milan Jagatiya
Ranch Hand

Joined: Jan 01, 2007
Posts: 164
post your web.xml ...
[ February 02, 2007: Message edited by: Milan Jagatiya ]

Milan.<br />I can because I think I can...
shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
I have changed my application and here are my web.xml and module level struts config.xml file. My action class just returns null.

when I try http:localhost:8080/myProject/Login/login.jsp
I get error "Cannot retrieve mapping for action /login"



myProject
WebRoot
Login
login.jsp
meta-inf
Web-inf
struts-config-Login.xml
struts-config.xml


web.xml
**************************************************************************
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>config/Login</param-name>
<param-value>/WEB-INF/struts-config-Login.xml</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>

****************************************************************8
Struts-config-Login.xml

<struts-config>
<form-beans >
<form-bean name="loginForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="password" type="java.lang.String" />
<form-property name="username" type="java.lang.String" />
</form-bean>

</form-beans>

<action-mappings >
<action
attribute="loginForm"
input="/Login/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="com.mycompany.struts.action.LoginAction" />

</action-mappings>

<controller />
</struts-config>

***************************************************************************

login.jsp

<html:form action="/login">
password : <html:text property="password"/
username : <html:text property="username"/
<html:submit/><html:cancel/>
</html:form>

*****************************************************************
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help with module level struts config