- This topic has 8 replies, 2 voices, and was last updated 19 years, 7 months ago by Riyad Kalla.
-
AuthorPosts
-
iEvil.cnMembertype Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:88)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)root cause
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
org.apache.jsp.userLogin_jsp._jspx_meth_html_form_0(userLogin_jsp.java:104)
org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
I use Eclipse3.0.1 . myEclipse 3.8.4 and Tomcat 5.0.28
I followed the Help Files to do a Sturts Login Demo but something Wrong!
Who can tell how to ………….
THANK YOU VERY MUCH !
Riyad KallaMemberI followed the Help Files to do a Sturts Login Demo but something Wrong!
I’m going to go out on a limb here and say your code is wrong… ever so wrong 😀
You know, if you posted it for us, we would be able to help you (struts-config.xml, JSP page causing the problem, how you are accessing it, etc.).
iEvil.cnMemberSorry I’m a struts beginner.
Here is my files===========struts-config.xml============
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”>
<struts-config>
<data-sources />
<form-beans >
<form-bean name=”loginForm” type=”com.yourcompany.struts.form.LoginForm” /></form-beans>
<global-exceptions />
<global-forwards ></global-forwards>
<action-mappings >
<action
attribute=”loginForm”
input=”/login.jsp”
name=”loginForm”
path=”/login”
scope=”request”
type=”com.yourcompany.struts.action.LoginAction” >
<forward name=”logined” path=”/Success.jsp” />
<forward name=”failure” path=”/login.jsp” />
</action></action-mappings>
<message-resources parameter=”com.yourcompany.struts.ApplicationResources” />
</struts-config>
===========================================================
iEvil.cnMember==========LoginAction.java===================
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.4/xslt/JavaClass.xslpackage com.yourcompany.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;import com.yourcompany.struts.form.LoginForm;
/**
* MyEclipse Struts
* Creation date: 03-26-2005
*
* XDoclet definition:
* @struts:action path=”/login” name=”loginForm” input=”/login.jsp” scope=”request” validate=”true”
*/
public class LoginAction extends Action {// ——————————————————— Instance Variables
// ——————————————————— Methods
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
LoginForm loginForm = (LoginForm) form;
request.getSession().setAttribute(“userName”,loginForm.getUserName());
return mapping.findForward(“logined”);
}}
========================================================================
iEvil.cnMember=========LoginForm.java==========================
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.4/xslt/JavaClass.xslpackage com.yourcompany.struts.form;
import org.apache.struts.action.ActionForm;
/**
* MyEclipse Struts
* Creation date: 03-26-2005
*
* XDoclet definition:
* @struts:form name=”loginForm”
*/
public class LoginForm extends ActionForm {// ——————————————————— Instance Variables
/** userName property */
private String userName;// ——————————————————— Methods
/**
* Returns the userName.
* @return String
*/
public String getUserName() {
return userName;
}/**
* Set the userName.
* @param userName The userName to set
*/
public void setUserName(String userName) {
this.userName = userName;
}}
=================================================================
iEvil.cnMember===============Success.jsp==================
<%@ page language=”java”%>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean” prefix=”bean” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-html” prefix=”html” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-logic” prefix=”logic” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-tiles” prefix=”tiles” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-template” prefix=”template” %>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-nested” prefix=”nested” %><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html:html locale=”true”>
<head>
<html:base /><title>Success.jsp</title>
<meta http-equiv=”pragma” content=”no-cache”>
<meta http-equiv=”cache-control” content=”no-cache”>
<meta http-equiv=”expires” content=”0″>
<meta http-equiv=”keywords” content=”keyword1,keyword2,keyword3″>
<meta http-equiv=”description” content=”This is my page”>
</head><body>
Hi <bean:write name = “userName” scope = “request”/>
</body>
</html:html>
iEvil.cnMember================login.jsp=======================
<%@ page language=”java”%>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean” prefix=”bean”%>
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-html” prefix=”html”%><html>
<head>
<title>JSP for loginForm form</title>
</head>
<body>
<html:form action=”/login”>
userName : <html:text property=”userName”/><html:errors property=”userName”/><br/>
<html:submit/><html:cancel/>
</html:form>
</body>
</html>
iEvil.cnMember==========web.xml====================
<?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/j2ee http://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>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>===============================================
If you can help. I’ll be appricated.
Thanks
Riyad KallaMemberIn your JSP, try and change this line:
<html:form action=”/login”>
To this:
<html:form action=”/login.do”>
-
AuthorPosts