Struts application status 404

Posted on 2006-05-30
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="/">
<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" "">


        <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 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
    LVL 6

    Author Comment

    plz now only i learn struts so plz help me
    LVL 92

    Accepted Solution

    check your logs, there could be an error there that helps point you to whats going wrong
    LVL 5

    Expert Comment

    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?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    The viewer will learn how to implement Singleton Design Pattern in Java.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now