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

  • Home
  • SEARCH
  • 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 8327363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:05:08+00:00 2026-06-09T01:05:08+00:00

I’ve developed a simple struts2 web application. In that there are two pages index.jsp

  • 0

I’ve developed a simple struts2 web application.
In that there are two pages index.jsp and page1.jsp which are within a folder named as Page

I used the following jar files

 antlr.jar
 commons-beanutils.jar
 commons-digester.jar
 commons-fileupload.jar
 commons-logging.jar
 commons-logging-1.0.4.jar
 commons-validator.jar
 freemarker-2.3.8.jar
 jakarta-oro.jar
 jsf-api.jar
 jsf-impl.jar
 jstl-1.2.jar
 ognl-2.6.11.jar
 struts.jar
 struts2-core-2.0.11.2.jar
 xwork-2.0.5.jar

struts.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
   "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
   "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.custom.i18n.resources" value="ApplicationResources" />
   <package name="helloworld" extends="struts-default">

      <action name="log1" class="com.loginAction">
            <result name="success">/index.jsp</result>
      </action>
   </package>
</struts>

web.xml

<?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_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>Struts2_Sample</display-name>

   <filter>
      <filter-name>struts2</filter-name>
      <filter-class>
         org.apache.struts2.dispatcher.FilterDispatcher
      </filter-class>
   </filter>

   <filter-mapping>
      <filter-name>struts2</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>


  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
<body>
<s:a href="Page/page1.jsp">LOGIN</s:a>
</body>
</html>

Page/page1.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
<body>
<s:form action="log1" method="post">
  <s:textfield name="name" label="USERNAME"></s:textfield>
   <s:password name="pass" label="PASSWORD"></s:password>
  <s:submit method="execute" label="LOGIN"></s:submit>
</s:form>
</body>
</html>

style.css

body 
{
background:olive;
}

loginAction.java

package com;
import com.opensymphony.xwork2.ActionSupport;
public class loginAction extends ActionSupport {

    public String execute() {
         return SUCCESS;        
    }
}

The following picture shows the directory structure of the my application.
http://www.sendspace.com/file/zm46c1

when I run the application, it will direct to index.jsp page with a LOGIN hyperlink appears in that. This page has an olive background color which I defined within a style.css. Now when I click that it will then direct to page1.jsp showing two text-fields and a submit button.

THE PROBLEM:

When I click the submit button it will direct to the previous index.jsp but without any background color. Even when I click that, it shows an error page.

The following pictures attachment show all my web pages of my application.
http://www.sendspace.com/file/djnqvo

when I click the LOGIN hyperlink I’d get the error page.

Can anyone tell me why I’m getting like this.

Is there any solution for this problem.

  • 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-09T01:05:09+00:00Added an answer on June 9, 2026 at 1:05 am

    Put <s:url value="/css/style.css"/> instead of css/style.css. It works firstly with the index.jsp, because the jsp is searching the css folder in the same directory, but when you access to the other two pages, is searching the css folder in the Page folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.