Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Http 404 Error

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Iam new to struts. Iam developing a web application using JDK 1.4.2, Tomcat 5.5.23 and Struts 1.3.8

When Iam requesting for my logon page(http://localhost:5523/smt/logon.jsp) on the browser I get "The page cannot be found" error (HTTP 404 File Not Found)

My tomcat listens to port 5523 and Iam deployoing my war file inside "webapps" folder of tomcat.

My web.xml looks like this

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

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>SMT</display-name>

<!-- Standard Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>40</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>503</error-code>
<location>/error.jsp</location>
</error-page>


<!-- Adding TLD Files -->

<taglib>
<taglib-uri>/WEB-INF/displaytag.tld</taglib-uri>
<taglib-location>/WEB-INF/displaytag.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts/apache.org/tags-bean</taglib-uri>;
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://struts/apache.org/tags-html</taglib-uri>;
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts/apache.org/tags-logic</taglib-uri>;
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts/apache.org/tags-nested</taglib-uri>;
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>

<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>logon.jsp</welcome-file>
</welcome-file-list>

</web-app>

My Struts-Config file looks like this



<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>
<!-- ==================== Form Bean Definitions ======================= -->

<form-beans>
<form-bean name="logonForm" type="com.spcs.smt.forms.LogonForm" />
<form-bean name="mainSearchForm" type="com.spcs.smt.forms.mainSearchForm" />
</form-beans>


<!-- ==================== Global Exception Definitions ================= -->




<!-- ==================== Global Forward Definitions =================== -->



<!-- ==================== Action Mapping Definitions =================== -->

<action-mappings>
<action name="logonForm" type="com.spcs.smt.actions.TestAction" input="/logon.jsp" scope="request" path="/test">
<forward name="success" path="/logon2.do" />
<forward name="failure" path="/error.jsp" />
<forward name="sessiontimeout" path="/logon.do" />
<forward name="roleNotFound" path="/roleNotFound.jsp" />
</action>

<action name="logonForm" type="com.spcs.smt.actions.LogonAction" input="/logon.jsp" scope="request" path="/logon">
<forward name="success" path="/logon2.do" />
<forward name="failure" path="/error.jsp" />
<forward name="sessiontimeout" path="/logon.do" />
<forward name="roleNotFound" path="/roleNotFound.jsp" />
</action>

<action name="mainSearchForm" type="com.spcs.smt.actions.LogonAction2" validate="false" scope="session" path="/logon2">
<forward name="success" path="/mainSearch.jsp" />
<forward name="failure" path="/error.jsp" />
<forward name="sessiontimeout" path="/logon.do" />
<forward name="roleNotFound" path="/roleNotFound.jsp" />
</action>

</action-mappings>


<!-- ==================== Message Resources Definitions ================= -->

<message-resources parameter="com.spcs.smt.MessageResources" />


<!-- ======================== Plug Ins Configuration ==================== -->

<!-- ============================ Tiles plugin ======================== -->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation

Paths found in Tiles definitions are relative to the main context.

To use this plugin, download and add the Tiles jar to your WEB-INF/lib
directory then uncomment the plugin definition below.

<plug-in className="org.apache.struts.tiles.TilesPlugin" >

<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
</plug-in>
-->


<!-- ============================ Validator plugin ========================= -->

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/org/apache/struts/validator/validator-rules.xml,
/WEB-INF/validation.xml"/>
</plug-in>

</struts-config>
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where have you put logon.jsp in the application ?
Is this directly under the context root ?
 
Anirban Das
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks, posted in wrong place. Reposted in appropriate place.


Sorry for the inconvinience.
 
Marshal
Posts: 28271
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You configured the name of your application as "SMT" but you requested it as "smt". HTTP URL's are case-sensitive except for the host name.
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic