Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 56284 invoked from network); 13 Dec 2004 14:22:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 13 Dec 2004 14:22:27 -0000 Received: (qmail 50140 invoked by uid 500); 13 Dec 2004 14:21:33 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 50113 invoked by uid 500); 13 Dec 2004 14:21:33 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 50093 invoked by uid 99); 13 Dec 2004 14:21:32 -0000 X-ASF-Spam-Status: No, hits=3.1 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,HTML_50_60,HTML_MESSAGE,MIME_HTML_MOSTLY,URIBL_SBL X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from rwcrmhc12.comcast.net (HELO rwcrmhc12.comcast.net) (216.148.227.85) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 13 Dec 2004 06:21:28 -0800 Received: from bhutkarlaptop (c-24-6-76-172.client.comcast.net[24.6.76.172]) by comcast.net (rwcrmhc12) with SMTP id <2004121314212501400ek40ce>; Mon, 13 Dec 2004 14:21:25 +0000 From: "S.B." To: "'Struts Users Mailing List'" Subject: RE: Cannot find ActionMappings or ActionFormBeans collection Date: Mon, 13 Dec 2004 06:21:12 -0800 Message-ID: <002801c4e11f$02ea45c0$6401a8c0@bhutkarLaptop> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0029_01C4E0DB.F4C705C0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <001d01c4e0df$582c3ec0$cc4b10ac@netcraftm26hqk> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0029_01C4E0DB.F4C705C0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Where are you putting jsp file? In which folder? Is it under pages directory? ------=_NextPart_000_0029_01C4E0DB.F4C705C0 Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: attachment Reply-To: "Struts Users Mailing List" From: "uma.k" To: "'Struts Users Mailing List'" Subject: RE: Cannot find ActionMappings or ActionFormBeans collection Date: Sun, 12 Dec 2004 22:45:33 -0800 Message-ID: <001d01c4e0df$582c3ec0$cc4b10ac@netcraftm26hqk> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0024_01C4E0DB.F4C57F20" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-Originating-IP: [209.237.227.199] In-Reply-To: <01b701c4e0dc$46afcd90$240110ac@eddie> List-Unsubscribe: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal List-Subscribe: List-Help: X-ASF-Spam-Status: No, hits=0.8 required=10.0tests=URIBL_SBL X-Spam-Check-By: apache.org X-Virus-Checked: Checked X-Virus-Scanned: by amavisd-new at net-kraft.com This is a multi-part message in MIME format. ------=_NextPart_000_0024_01C4E0DB.F4C57F20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Bush, Its confusing me. How do I call an Action without the Template.jsp form being submitted? My Action and ActionForm are i web-inf/classes/articles folder. My Template.jsp will take that information from the user and send it to the respective jsp based on the "execute" method. If I am wrong please correct me. Thanks Uma -----Original Message----- From: Eddie Bush [mailto:eabush@swbell.net] Sent: Monday, December 13, 2004 11:54 AM To: Struts Users Mailing List Subject: Re: Cannot find ActionMappings or ActionFormBeans collection In order to have a request properly setup, you need to be going through the controller. To go through the controller, you need to be viewing an action instead of a JSP page. Try invoking an action that uses the template and see if the problem persists. You can't expect Struts to set things up for a page it doesn't know you're requesting, and it can't know you're requesting the page unless you go through the controller :-) Good Luck, Eddie ----- Original Message ----- From: "uma.k" To: "'Struts Users Mailing List'" Sent: Sunday, December 12, 2004 11:00 PM Subject: RE: Cannot find ActionMappings or ActionFormBeans collection > Hi David, > That error is displayed while I am loading my Template.jsp itself. > http://localhost:8080/test/Template.jsp Not able to see the GUI itself. > > Uma > > -----Original Message----- > From: David G. Friedman [mailto:humble@ix.netcom.com] > Sent: Monday, December 13, 2004 10:28 AM > To: Struts Users Mailing List > Subject: RE: Cannot find ActionMappings or ActionFormBeans collection > > > Is that error at start-up or when you are invoking an action by going to a > Struts *.do action through a URL? > > Regards, > David > > -----Original Message----- > From: uma.k [mailto:uma.k@net-kraft.com] > Sent: Sunday, December 12, 2004 11:54 PM > To: 'Struts Users Mailing List'; suneel@collab.net > Subject: RE: Cannot find ActionMappings or ActionFormBeans collection > > > Hi Sunny, > Thanks for the reply. The classpath is set right and my struts-config.xml > file looks the same way as you posted, I just removed the un necessary > tags. > Any ideas now? > > Uma > > -----Original Message----- > From: Sunny [mailto:suneel@collab.net] > Sent: Monday, December 13, 2004 10:04 AM > To: Struts Users Mailing List > Subject: Re: Cannot find ActionMappings or ActionFormBeans collection > > > hi, > Ensure that your are having your struts-config like the one below. And > also please check your class path > > regards, > Sunny > > > > Struts Configuration 1.1//EN" > "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> > > > > > > > path="/Article" > type="articles.ArticleAction" > name="articleForm" > scope="request" > validate="true" > input="/Template.jsp"> > > > > > > > > > uma.k wrote: > >>Hello, >>I am new to Struts, my first application is giving me this error. I am > using >>Tomcat 4.0 >>and struts 1.2.4. Where did I go wrong? Please help me. >>javax.servlet.ServletException: Cannot find ActionMappings or >>ActionFormBeans collection >> >> >>Here are my files >> >>-----Template.jsp >> >><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> >> >> >> >> >> >> >> >> >> >> >>
Keywords
>>Submit >> >>
>> >> >>---- web.xml >> >> >>> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" >> "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> >> >> >> >> >> >> action >> org.apache.struts.action.ActionServlet >> >> config >> /WEB-INF/struts-config.xml >> >> >> debug >> 2 >> >> >> detail >> 2 >> >> 2 >> >> >> >> >> action >> *.do >> >> >> >> >> /WEB-INF/struts-bean >> /WEB-INF/struts-bean.tld >> >> >> >> /WEB-INF/struts-html >> /WEB-INF/struts-html.tld >> >> >> >> /WEB-INF/struts-logic >> /WEB-INF/struts-logic.tld >> >> >> >> /WEB-INF/struts-nested >> /WEB-INF/struts-nested.tld >> >> >> >> /WEB-INF/struts-tiles >> /WEB-INF/struts-tiles.tld >> >> >> >> >> >> >>----struts-config.xml >> >> >> >> >> >> >> > path="/Article" >> type="articles.ArticleAction" >> name="articleForm" >> scope="request" >> validate="true" >> input="/Template.jsp"> >> >> >> >> >> >> >> >> >> >>--ArticleForm.java >> >>package articles; >> >>import javax.servlet.http.HttpServletRequest; >>import org.apache.struts.action.ActionForm; >>import org.apache.struts.action.ActionMapping; >>import org.apache.struts.action.ActionMessage; >>import org.apache.struts.action.ActionErrors; >> >>public class ArticleForm extends ActionForm >>{ >> private String keywords = null; >> >> public String getKeywords(){ >> return keywords; >> } >> >> public void setKeywords(String keywords){ >> this.keywords = keywords; >> } >> >> public ActionErrors validate(ActionMapping mapping, HttpServletRequest >>request) >> { >> ActionErrors errors = new ActionErrors(); >> if( getKeywords() == null || getKeywords().length() < 1 ) >> { >> errors.add("keywords",new >>ActionMessage("error.keywords.required")); >> } >> >> return errors; >> >> } >>} >> >> >> >>--ArticleAction.java >> >>package articles; >> >>import java.io.IOException; >>import javax.servlet.ServletException; >>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 articles.ArticleForm; >> >>public class ArticleAction extends Action >>{ >> private String keywords = null; >> >> public ActionForward execute(ActionMapping mapping, ActionForm form, >> HttpServletRequest request, HttpServletResponse response) throws >>IOException, ServletException >> { >> String target = new String("success"); >> >> if(form != null) >> { >> // Use the ArticleForm to get the request parameters >> ArticleForm articleForm = (ArticleForm)form; >> keywords = articleForm.getTitle(); >> } >> >> // if no title is supplied, set the target to failure >> if ( keywords == null ) >> { >> target = new String("failure"); >> } >> else >> { >> request.setAttribute("keywords", keywords); >> } >> >> return (mapping.findForward(target)); >> } >> >>} >> >> >>Thank you, >>Uma >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >>For additional commands, e-mail: user-help@struts.apache.org >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0450-1, 12/09/2004 Tested on: 12/13/2004 12:23:36 AM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org ------=_NextPart_000_0024_01C4E0DB.F4C57F20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: Cannot find ActionMappings or ActionFormBeans = collection

Hi Bush,
Its confusing me. How do I call an Action without the = Template.jsp form
being submitted? My Action and ActionForm are i = web-inf/classes/articles
folder. My Template.jsp will take that information = from the user and send it
to the respective jsp based on the = "execute" method.

If I am wrong please correct me.

Thanks
Uma

-----Original Message-----
From: Eddie Bush [mailto:eabush@swbell.net]
Sent: Monday, December 13, 2004 11:54 AM
To: Struts Users Mailing List
Subject: Re: Cannot find ActionMappings or = ActionFormBeans collection


In order to have a request properly setup, you need to = be going through the
controller.  To go through the controller, you = need to be viewing an action
instead of a JSP page.  Try invoking an action = that uses the template and
see if the problem persists.

You can't expect Struts to set things up for a page it = doesn't know you're
requesting, and it can't know you're requesting the = page unless you go
through the controller :-)

Good Luck,

Eddie

----- Original Message -----
From: "uma.k" = <uma.k@net-kraft.com>
To: "'Struts Users Mailing List'" = <user@struts.apache.org>
Sent: Sunday, December 12, 2004 11:00 PM
Subject: RE: Cannot find ActionMappings or = ActionFormBeans collection


> Hi David,
> That error is displayed while I am loading my = Template.jsp itself.
> http://localhost:8080/te= st/Template.jsp Not able to see the GUI itself.
>
> Uma
>
> -----Original Message-----
> From: David G. Friedman [mailto:humble@ix.netcom.com]
> Sent: Monday, December 13, 2004 10:28 AM
> To: Struts Users Mailing List
> Subject: RE: Cannot find ActionMappings or = ActionFormBeans collection
>
>
> Is that error at start-up or when you are = invoking an action by going to a
> Struts *.do action through a URL?
>
> Regards,
> David
>
> -----Original Message-----
> From: uma.k [mailto:uma.k@net-kraft.com]
> Sent: Sunday, December 12, 2004 11:54 PM
> To: 'Struts Users Mailing List'; = suneel@collab.net
> Subject: RE: Cannot find ActionMappings or = ActionFormBeans collection
>
>
> Hi Sunny,
> Thanks for the reply. The classpath is set right = and my struts-config.xml
> file looks the same way as you posted, I just = removed the un necessary
> tags.
> Any ideas now?
>
> Uma
>
> -----Original Message-----
> From: Sunny [mailto:suneel@collab.net]
> Sent: Monday, December 13, 2004 10:04 AM
> To: Struts Users Mailing List
> Subject: Re: Cannot find ActionMappings or = ActionFormBeans collection
>
>
> hi,
> Ensure that your are having your = struts-config  like the one below. And
> also please check your class path
>
> regards,
> Sunny
>
>
> <?xml version=3D"1.0" = encoding=3D"ISO-8859-1"?>
> <!DOCTYPE struts-config PUBLIC = "-//Apache Software Foundation//DTD
> Struts Configuration 1.1//EN"
> "http= ://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
> <struts-config>
>  <form-beans>
>    <form-bean = name=3D"articleForm" = type=3D"articles.ArticleForm"/>
>  </form-beans>
>
>  <action-mappings>
>    <action
>        = path=3D"/Article"
>        = type=3D"articles.ArticleAction"
>        = name=3D"articleForm"
>        = scope=3D"request"
>        = validate=3D"true"
>        = input=3D"/Template.jsp">
>      <forward = name=3D"success" path=3D"/preview.jsp"/>
>      <forward = name=3D"failure" path=3D"/Template.jsp"/>
>    </action>
>  </action-mappings>
>
> </struts-config>
>
>
> uma.k wrote:
>
>>Hello,
>>I am new to Struts, my first application is = giving me this error. I am
> using
>>Tomcat 4.0
>>and struts 1.2.4. Where did I go wrong? = Please help me.
>>javax.servlet.ServletException: Cannot find = ActionMappings or
>>ActionFormBeans collection
>>
>>
>>Here are my files
>>
>>-----Template.jsp
>>
>><%@ taglib = uri=3D"/WEB-INF/struts-html.tld" prefix=3D"html" = %>
>><html>
>><body>
>><html:form = action=3D"/Article">
>>
>>
>><table border=3D"0" = width=3D"100%">
>>  <tr>
>>    <td = width=3D"18%"><font size=3D"2" = face=3D"Verdana">Keywords</font></td>
>>    <td = width=3D"32%"><input type=3D"text" = name=3D"keywords" size=3D"60"> </td>
>>  </tr>
>></table>
>><html:submit>Submit</html:submit>
>>
>></html:form>
>>
>>
>>---- web.xml
>><?xml version=3D"1.0" = encoding=3D"ISO-8859-1"?>
>>
>><!DOCTYPE web-app
>>    PUBLIC "-//Sun = Microsystems, Inc.//DTD Web Application 2.2//EN"
>>    "http://java.sun.co= m/j2ee/dtds/web-app_2_2.dtd">
>>
>><web-app>
>>
>>  <!-- Standard Action Servlet = Configuration (with debugging) -->
>>  <servlet>
>>    = <servlet-name>action</servlet-name>
>>    = <servlet-class>org.apache.struts.action.ActionServlet</servlet-c= lass>
>>    <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>2</param-value>
>>    </init-param>
>>    <init-param>
>>      = <param-name>detail</param-name>
>>      = <param-value>2</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>
>>
>>  <!-- Struts Tag Library Descriptors = -->
>>  <taglib>
>>    = <taglib-uri>/WEB-INF/struts-bean</taglib-uri>
>>    = <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
>>  </taglib>
>>
>>  <taglib>
>>    = <taglib-uri>/WEB-INF/struts-html</taglib-uri>
>>    = <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
>>  </taglib>
>>
>>  <taglib>
>>    = <taglib-uri>/WEB-INF/struts-logic</taglib-uri>
>>    = <taglib-location>/WEB-INF/struts-logic.tld</taglib-location><= /FONT>
>>  </taglib>
>>
>>  <taglib>
>>    = <taglib-uri>/WEB-INF/struts-nested</taglib-uri>
>>    = <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>=
>>  </taglib>
>>
>>  <taglib>
>>    = <taglib-uri>/WEB-INF/struts-tiles</taglib-uri>
>>    = <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location><= /FONT>
>>  </taglib>
>>
>></web-app>
>>
>>
>>
>>----struts-config.xml
>>
>><form-beans>
>>    <form-bean = name=3D"articleForm" = type=3D"articles.ArticleForm"/>
>></form-beans>
>>
>><action-mappings>
>>    <action
>>    = path=3D"/Article"
>>    = type=3D"articles.ArticleAction"
>>    = name=3D"articleForm"
>>    = scope=3D"request"
>>    = validate=3D"true"
>>    = input=3D"/Template.jsp">
>> <forward name=3D"success" = path=3D"/preview.jsp"/>
>> <forward name=3D"failure" = path=3D"/Template.jsp"/>
>> </action>
>>
>>
>></action-mappings>
>>
>>
>>
>>--ArticleForm.java
>>
>>package articles;
>>
>>import = javax.servlet.http.HttpServletRequest;
>>import = org.apache.struts.action.ActionForm;
>>import = org.apache.struts.action.ActionMapping;
>>import = org.apache.struts.action.ActionMessage;
>>import = org.apache.struts.action.ActionErrors;
>>
>>public class ArticleForm extends = ActionForm
>>{
>> private String keywords =3D null;
>>
>> public String getKeywords(){
>> return keywords;
>> }
>>
>> public void setKeywords(String = keywords){
>> this.keywords =3D keywords;
>> }
>>
>> public ActionErrors validate(ActionMapping = mapping, HttpServletRequest
>>request)
>> {
>> ActionErrors errors =3D new = ActionErrors();
>> if( getKeywords() =3D=3D null || = getKeywords().length() < 1 )
>> {
>>       = errors.add("keywords",new
>>ActionMessage("error.keywords.required"));
>>       }
>>
>>      return = errors;
>>
>> }
>>}
>>
>>
>>
>>--ArticleAction.java
>>
>>package articles;
>>
>>import java.io.IOException;
>>import javax.servlet.ServletException;
>>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 articles.ArticleForm;
>>
>>public class ArticleAction extends = Action
>>{
>> private String keywords =3D null;
>>
>> public ActionForward execute(ActionMapping = mapping, ActionForm form,
>> HttpServletRequest request, = HttpServletResponse response) throws
>>IOException, ServletException
>> {
>> String target =3D new = String("success");
>>
>> if(form !=3D null)
>> {
>> // Use the ArticleForm to get the request = parameters
>> ArticleForm articleForm =3D = (ArticleForm)form;
>> keywords =3D articleForm.getTitle();
>> }
>>
>> // if no title is supplied, set the target = to failure
>> if ( keywords =3D=3D null )
>> {
>>     target =3D new = String("failure");
>> }
>> else
>> {
>> request.setAttribute("keywords", = keywords);
>> }
>>
>> return (mapping.findForward(target));
>> }
>>
>>}
>>
>>
>>Thank you,
>>Uma
>>
>>
>>--------------------------------------------------------= -------------
>>To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: = user-help@struts.apache.org
>>
>>
>>
>
> = ---------------------------------------------------------------------
> To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
> For additional commands, e-mail: = user-help@struts.apache.org
>
>
> = ---------------------------------------------------------------------
> To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
> For additional commands, e-mail: = user-help@struts.apache.org
>
>
> = ---------------------------------------------------------------------
> To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
> For additional commands, e-mail: = user-help@struts.apache.org
>
>
> = ---------------------------------------------------------------------
> To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
> For additional commands, e-mail: = user-help@struts.apache.org
>



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0450-1, 12/09/2004
Tested on: 12/13/2004 12:23:36 AM
avast! - copyright (c) 2000-2004 ALWIL = Software.
http://www.avast.com




----------------------------------------------------------------= -----
To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
For additional commands, e-mail: = user-help@struts.apache.org


----------------------------------------------------------------= -----
To unsubscribe, e-mail: = user-unsubscribe@struts.apache.org
For additional commands, e-mail: = user-help@struts.apache.org

------=_NextPart_000_0024_01C4E0DB.F4C57F20-- ------=_NextPart_000_0029_01C4E0DB.F4C705C0 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org ------=_NextPart_000_0029_01C4E0DB.F4C705C0--