Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9277265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:03:53+00:00 2026-06-18T17:03:53+00:00

I am new to struts2. I was trying a small application for practice but

  • 0

I am new to struts2. I was trying a small application for practice but I hit an issue.

I was trying to forward directly from index.jsp to login.jsp. I know I can directly forward to login.jsp but the below code should also be valid. I am attaching the code I was trying.
below is the code from what I was trying.

index.jsp

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Home</title>
</head>
<body>
       <jsp:forward page="login.action" />
</body>
</html>

struts.xml

<struts>
<include file="example.xml"/>
<!-- Configuration for the default package. -->
<package name="default" extends="struts-default">
    <action name="login">
        <result>/login.jsp</result>
</action>
</package>
</struts>

login.jsp

 <%@page contentType="text/html" pageEncoding="UTF-8"%>
 <%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>JSP Page</title>
</head>
<body>
    <s:form>
        <s:textfield name="user" label="User Name" />
        <s:password name="passwd" label="Password" />
    </s:form>
</body>
</html>

In web.xml the index.php page is set as welcome page. Suppose XYZ is the context name, when I put /XYZ/login its take to login page but when I put /XYZ/in the browser it give and resource not found error.

when I use <META HTTP-EQUIV="Refresh" CONTENT="0;URL=login.action"> again it works fine.

I am using tomcat7 as a web server. Why is this happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:03:56+00:00Added an answer on June 18, 2026 at 5:03 pm

    Not all the containers by default perform FORWARD to non-JSP resources – <jsp:forward/> – to say container to do it please add the following mapping to web.xml:

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am familier with jQuery,Ajax and JSP Servlets but new to Struts2.I want to
I am trying to create a new application using Struts2 framework on Tomcat 7.
I m new to Struts2 and Hibernate. I am trying to save values from
I'm trying to start a new struts 2 project using maven (struts2 blank archetype)
I am new to Struts . I downloaded Struts2 from its website. Now I
I am new to struct 2.0. I am trying to run my first small
I'm trying to upload a file using struts2. In the jsp page there is
I am new to struts2 tiles. Here i am trying to execute 1 simple
I'm new to Struts2, but I'm consistently running into issues with jQuery selectors not
I am new to Swing. I am trying to develop an application using Swing.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.