Struts application status 404

Posted on 2006-05-30
Medium Priority
Last Modified: 2012-06-27
my q is if i am put folder is context path and specify an path name in config-.xml file index page is an jsp file it will coming below
i but it donnt call to ao an action servlet i want solution
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<head><title>Welcome to our website</title></head>
<html:form action="/login.do">
<td>Enter your Area</td>
<td><html:text property="areaname"/>
<html:submit value="Go"/></td></tr>
welcome tothe Area of <%=request.getAttribute("AREA") %>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">


        <form-bean name="loginform" type="login.loginform"/>


        <forward name="failure" path="/strlogin.jsp" redirect="true"/>


              <action path="/login"
                        type="org.apache.struts.actions.ForwardAction" />

        <action path="/login"
                <forward name="chennai" path="/welcome.jsp"/>



    <controller processorClass="org.apache.struts.action.RequestProcessor" />

    <message-resources parameter="struts.example.MessageResources" null="false" />

    <message-resources parameter="struts.example.ImageResources" key="bundle.image" null="false" />

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

<!DOCTYPE web-app    PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"


    <display-name>Hello World Struts Application</display-name>






   <!-- <taglib>
    </taglib> -->




package login;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.Action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class loginform extends ActionForm
      private String areaname=null;

      public void setareaname (String area)
      public String getareaname()
            return areaname;
      public void Reset(ActionMapping mapping,HttpServletRequest request)
package login;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class loginaction extends Action

  public ActionForward execute(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws IOException,ServletException
      String target=null;
      String areaname=null;
          loginform lform=(loginform)form;
                target=new String ("chennai");
                     target= new String ("failure");
                         return (mapping.findForward("target"));
giving 404
if i am give
                 http://localhost:/contextpath(ie my folder name)/file name.jsp
 but not call action servlet
Question by:saravananvg

Author Comment

ID: 16788556
plz now only i learn struts so plz help me
LVL 92

Accepted Solution

objects earned 1000 total points
ID: 16788575
check your logs, there could be an error there that helps point you to whats going wrong

Expert Comment

ID: 16789016
What exactly is your problem/question?

Do you want to put your jsp's in a folder in your web project but you don't know how to reference the jsp's in your struts config?

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question