Problems with a struts app
Hi,
I have done this simple login web app with Struts, with LoginAction, LoginForm and three JSP pages, login.jsp, success.jsp and failure.jsp. It's from a tutorial found here: http://www.roseindia.net/struts/struts-login-form.shtml
I have this in my web.xml:
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
....
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
.............
The app is deployed on Tomcat 6 on another computer, and when I type in:
http://ipadress:8080/StrutsLogin2
I get: The requested resource (/StrutsLogin2/) is not available.
If I type: http://ipadress:8080/StrutsLogin2/login.do
I get the success.jsp page saying: "Hi null"
StrutsLogin2 is the project name.
Help please,
Matt
# 2
Hi,
The index.jsp is removed and my web.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
-
This:
http://192.168.1.101:8080/StrutsLogin2/login.do
gives this in the browser: HTTP Status 500 - No action instance for path /login could be created
Thanks,
Matt
# 4
A little correction, this:
http://192.168.1.101:8080/StrutsLogin2/login.do
will forward me directly to the success.jsp, instead of asking for user/pass. I swear this is a simple error for someone with a little more experience in struts/JSP.
Is this class, <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
found in one of the jar-files under /lib?
/Matt