Newsgroup: it.comp.java
Titolo: [Struts] The requested resource (Servlet action is not available) is not available.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://
www.w3.org/TR/html4/loose.dtd
">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<title>Rischio Zero ::: WAREHOUSE MANAGEMENT SYSTEM DATABASE</title>
    <style type="text/css">
        body{font : 0.9em Verdana, Geneva, Arial, Helvetica, sans-
serif;
                background-image: url("img/gradiente.jpg");padding:
60px;}
                form{padding: 20px;padding-left: 100px;}
        h1{font-size: 20px;color: blue;}
                h2{font-size: 12px;color: red;}
                h3{font-size: 12px;color: green;}
    </style>
</head>
<body>
[...]
<html:form action="/login.do?method=verifica">
<table>
<tr>
        <td>
                Username:
        </td>
        <td>
                <html:text property="username" value=""/>
        </td>
</tr>
<tr>
        <td>
                Password:
        </td>
        <td>
                <html:password property="password" value=""/>
        </td>
</tr>
<tr>
        <td></td>
        <td><html:submit value="Login"/></td>
</tr>
</table>
</html:form>
</body>
</html>
//struts-config.xml
<?xml version="1.0"
 encoding="UTF-8" ?>
<!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-beans>
        <form-bean name="loginForm" type="controller.LoginForm"/>
  </form-beans>
  <global-exceptions>
  </global-exceptions>
  <action-mappings>
[...]
    <action path="/login" name="loginForm"
type="controller.LoginAction" scope="session" parameter="method">
      <forward name="loginDone" path="/demo/home.jsp"/>
      <forward name="error" path="/common/error.jsp"/>
    </action>
[...]
  </action-mappings>
</struts-config>
Ho realizzato la semplice jsp riportata che sembra non "vedere" la
action relativa, avete qualche suggerimento?
Errore: The requested resource (Servlet action is not available) is
not available.
Non riesco a capire da cosa dipenda, anche perchè non mi riporta
nemmeno il richiamo ai file di log del server (che sembra non scriva
proprio...)
Sto usando java 1.6 +Tomcat 5.5+Struts 2, grazie per l'aiuto!

sasa ha usato la sua tastiera per scrivere :

Ma esiste la LoginAction java?

Sì...
public class LoginAction extends DispatchAction{
	public ActionForward verifica(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
IOException, ServletException{
		LoginForm lf = (LoginForm)form;
		String user = lf.getUsername();
		String pass = lf.getPassword();
		boolean esito=ManagerAdmin.validaLogin(user, pass);
		if (esito){
			String page="main.jsp";//pagina da visualizzare nel bodyright
			request.getSession().setAttribute("page_right", page);
			return mapping.findForward("loginDone");
		}
		else
			return mapping.findForward("error");
	}
}
Grazie per l'interessamento...!
Gello Ramello ha scritto:
