I am learning struts 2 framework and i have also used OGNL in it for data transfer.

The problem is when i run the Login.jps page on apache tomcat server through Eclipse Indigo , i get the error "HTTP Status 404 - /Priyanjan_banking/Login.jsp"

Please help me out .

The code is given below

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<%@taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>HOME - PRIYANJAN Banking</title>
    <s:form action="login">
        <a:actionerror />
        <s:textfield name="log.user_id" label="User ID"></s:textfield>
        <s:password name="log.user_pass" label="Password"></s:password>



package com;

public class Login {

    String user_id;
    String user_pass;

    public String getUser_id() {
        return user_id;
    public void setUser_id(String user_id) {
        this.user_id = user_id;
    public String getUser_pass() {
        return user_pass;
    public void setUser_pass(String user_pass) {
        this.user_pass = user_pass;



package com;

import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {


    private static final long serialVersionUID = 1L;
    Login log;

    public Login getLog() {
        return log;

    public void setLog(Login log) {
        this.log = log;

    public String execute() throws Exception{

            return SUCCESS;
            addActionError("User id , password do not match");
            return "error";



<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">





<?xml version="1.0" encoding="UTF-8"?>
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
<package name="mypack" extends="struts-default">
    <action name="login" class"com.LoginAction">
      <result name="success">/welcome_user.jsp</result>
      <result name="error">/index.jsp</result>
      <result name="input">index.jsp</result>

Please help me .
I just want to get started , run this basic , because when it runs i will start adding features to it.

Thanks in advance

Member Avatar

I just want to get started , run this basic , because when it runs i will start adding features to it.


On your login.jsp, What is

<s:form action="login">

Where does the info go to?

On your struts.xml This is line

<action name="login" class"com.LoginAction">

Is that where the info goes to? You need to set it correctly