• 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 ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Help - javax.servlet .ServletException: Cannot retrieve mapping for action  RSS feed

Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im following an online tutorial and for the las t day i can't figure out why this won't work, i keep getting the error message javax.servlet .ServletException: Cannot retrieve mapping for action /login

My web.xml file which i think is ok is:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app

PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"



<!-- Action Servlet Configuration -->




<!-- Resources bundle base class -->





<!-- Context-relative path to the XML resource containing Struts configuration information -->





<!-- Setting the locale parameter -->





<!-- The debugging detail level for this servlet, which controls how much information is logged. -->







<!-- Action Servlet Mapping -->





<!-- The Welcome File List -->




<!-- Struts Tag Library Descriptors -->














My struts-config.xml file which is where is think the problem is, is:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"

Logon form bean
<form-bean name="LoginForm"

<forward name="mainmenu"path="/mainmenu.jsp" />


Process a user logon
<action path="/login"
</action-mappings> -->

<message-resources parameter="application"/>


And the LoginForm.class is

package src;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.io.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LoginForm extends ActionForm {

private String login;

private String password;

public User()

public void setLogin(String login)
{ this.login = login; }

public void setPassword()
{ this.password = password; }

public String getLogin()
{ return this.login; }


It is a basic login tutorial from www. isabelle-hurbain.com

The page that is supposed to use the above is index.jsp

<%@ page language="java" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>

<html:html locale="true">


<title>Welcome to RegisterUser</title>


<form:form action="/login">
Login:<form:text property="login" />
<br />
Password:<form assword property="password" />
<br />
</form:form> -->

And finally the layout of my project is

- registeruser
- index.jsp
- classes
- ApplicationResources.properties
- ApplicationResources_de.properties
- lib
- All the .jar files
- src
- LoginForm.class
- web.xml
- struts-config.xml
- All the strut .tld files

Any help at all will be most appreciated


Nicola Guy
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just noticed the commetns in the strut-config.xml file, these were inserted so i could check the problem elsewhere i removed these and stil get an error message but its now

javax.servlet.ServletException: Exception creating bean of class app.LoginForm: {1}
Ranch Hand
Posts: 235
Java Python Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posts: 17344
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Web Frameworks forum.

His brain is the size of a cherry pit! About the size of this ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!