• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

help with module level struts config

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post your web.xml ...
[ February 02, 2007: Message edited by: Milan Jagatiya ]
 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>

*****************************************************************
 
Alas, poor Yorick, he knew this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic