RE: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-20 Thread Dave Newton
You need to use the actual location, not what you think eclipse wants you
to use.
On Jun 20, 2014 12:03 PM, "Tri Quan"  wrote:

> This URL : http://localhost:8080/IteratorKFC/IteratorKFC/menu.action
>  receives the following error
>
> Status report
> message /IteratorKFC/IteratorKFC/pages/iteratorkfc.jsp
> description The requested resource
> (/IteratorKFC/IteratorKFC/pages/iteratorkfc.jsp) is not available.
>
> I use Eclipse for development.
> Per Eclipse, iteratorkfc.jsp resides inside Web Pages as listed below:
>
> Project IteratorKFC
> Web Pages
> iteratorkfc.jsp
>
> any advices ?
>
> thanks
> Tri Quan
>
> -Original Message-
> From: Lukasz Lenart [mailto:lukaszlen...@apache.org]
> Sent: Friday, June 20, 2014 8:14 AM
> To: Struts Users Mailing List
> Subject: Re: need help on struts.xml configuration using Struts 2.3,
> Tomcat 7, Java JDK 1.6
>
> Wrong url, it supposed to be:
>
> http://localhost:8080/IteratorKFC/IteratorKFC/menu.action
>
> /IteratorKFC <- name of the war file, ie. context /IteratorKFC <-
> namespace defined in struts.xml
>
>
> 2014-06-20 13:33 GMT+02:00 Tri Quan :
> > All,
> >
> > I am green horn in Struts 2 and need help with
> struts.xml.
> > I got the following error when try this URL :
> >
> > localhost:8080/IteratorKFC/menu  or
> localhost:8080/IteratorKFC/menu.action .
> >
> >
> >
> >
> >
> >
> > what is wrong ?  Incorrect configuration or incorrect
> URL ?
> >
> >
> >
> > Struts has detected an unhandled exception:
> >
> > There is no Action mapped for namespace / and action name menu. -
> > [unknown location]
> >
> > com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.
> > java:1
> > 89)
> >
> >
> > org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.ja
> > va:61)
> >
> >
> > org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(Str
> > utsAct
> > ionProxyFactory.java:39)
> >
> >
> > com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(De
> > faultA
> > ctionProxyFactory.java:58)
> >
> >
> > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java
> > :488)
> >
> >
> > org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatch
> > er.jav
> > a:434)
> >
> >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> > cation
> > FilterChain.java:243)
> >
> >
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> > lterCh
> > ain.java:210)
> >
> >
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> > lve.ja
> > va:240)
> >
> >
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> > lve.ja
> > va:164)
> >
> >
> > org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticat
> > orBase
> > .java:462)
> >
> >
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> > va:164
> > )
> >
> >
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> > va:100
> > )
> >
> >
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:5
> > 63)
> >
> >
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
> > e.java
> > :118)
> >
> >
> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> > :403)
> >
> >
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> > 301)
> >
> >
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> > s(Http
> > 11Protocol.java:162)
> >
> >
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> > s(Http
> > 11Protocol.java:140)
> >
> >
> >
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:
> > 309)
> >
> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> > Source)
> >
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> >
> > java.lang.Thread.run(Unknown Source)
> >
> >
> >
> > Strut.xml source 
> >
> > 
> >
> >  >
> > "

RE: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-20 Thread Tri Quan
This URL : http://localhost:8080/IteratorKFC/IteratorKFC/menu.action  receives 
the following error

Status report
message /IteratorKFC/IteratorKFC/pages/iteratorkfc.jsp
description The requested resource 
(/IteratorKFC/IteratorKFC/pages/iteratorkfc.jsp) is not available.

I use Eclipse for development.
Per Eclipse, iteratorkfc.jsp resides inside Web Pages as listed below:

Project IteratorKFC
Web Pages
iteratorkfc.jsp

any advices ?

thanks
Tri Quan

-Original Message-
From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
Sent: Friday, June 20, 2014 8:14 AM
To: Struts Users Mailing List
Subject: Re: need help on struts.xml configuration using Struts 2.3, Tomcat 7, 
Java JDK 1.6

Wrong url, it supposed to be:

http://localhost:8080/IteratorKFC/IteratorKFC/menu.action

/IteratorKFC <- name of the war file, ie. context /IteratorKFC <- namespace 
defined in struts.xml


2014-06-20 13:33 GMT+02:00 Tri Quan :
> All,
>
> I am green horn in Struts 2 and need help with struts.xml.
> I got the following error when try this URL :
>
> localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action .
>
>
>
>
>
>
> what is wrong ?  Incorrect configuration or incorrect URL ?
>
>
>
> Struts has detected an unhandled exception:
>
> There is no Action mapped for namespace / and action name menu. - 
> [unknown location]
>
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.
> java:1
> 89)
>
>
> org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.ja
> va:61)
>
>
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(Str
> utsAct
> ionProxyFactory.java:39)
>
>
> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(De
> faultA
> ctionProxyFactory.java:58)
>
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java
> :488)
>
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatch
> er.jav
> a:434)
>
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> cation
> FilterChain.java:243)
>
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lterCh
> ain.java:210)
>
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> lve.ja
> va:240)
>
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> lve.ja
> va:164)
>
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticat
> orBase
> .java:462)
>
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> va:164
> )
>
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> va:100
> )
>
>
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:5
> 63)
>
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
> e.java
> :118)
>
>
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :403)
>
>
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 301)
>
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> s(Http
> 11Protocol.java:162)
>
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> s(Http
> 11Protocol.java:140)
>
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:
> 309)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown 
> Source)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
> java.lang.Thread.run(Unknown Source)
>
>
>
> Strut.xml source 
>
> 
>
> 
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
>
>
> 
>
>
>
> 
>
>
>
>
>
> 
>
>  extends="struts-default">
>
>  method="execute">
>
>  name="success">pages/iteratorkfc.jsp
>
> 
>
> 
>
> 
>
>
>
> ItertorKFCAction java ==
>
> package iteratorkfc;
>
> import java.util.*;
>
>
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class IteratorKFCAction extends ActionSupport{
>
> private List comboMeals;
>
>
>
> public List getComboMeals() {
>
> return comboMeals;
>
> }
>
>
>
> public v

RE: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-20 Thread Martin Gainty
unless otherwise specified webappName is segment following localhost:port 
in your case IteratorKFC

Action classes map URLS via struts configuration maps URL path-names to action 
classes via action-mapping in struts*.xml e.g


   




/empmanager/listEmployees.jsp






so in your case the action name *should be* menu in struts*xml

did you have a specific question?
Martin 



> Date: Fri, 20 Jun 2014 18:13:57 +0530
> Subject: Re: need help on struts.xml configuration using Struts 2.3, Tomcat 
> 7, Java JDK 1.6
> From: yaragallamur...@gmail.com
> To: user@struts.apache.org
> 
> localhost:8080/IteratorKFC/menu.action . there is some problem in
> this. where is the webapp name?
> 
> *Thanks and Regards,*
> Muralidhar Yaragalla.
> 
> *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*
> 
> 
> On Fri, Jun 20, 2014 at 5:03 PM, Tri Quan  wrote:
> 
> > All,
> >
> > I am green horn in Struts 2 and need help with struts.xml.
> > I got the following error when try this URL :
> >
> > localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action
> > .
> >
> >
> >
> >
> >
> >
> > what is wrong ?  Incorrect configuration or incorrect URL ?
> >
> >
> >
> > Struts has detected an unhandled exception:
> >
> > There is no Action mapped for namespace / and action name menu. - [unknown
> > location]
> >
> >
> > com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1
> > 89)
> >
> >
> >
> > org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
> >
> >
> >
> > org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct
> > ionProxyFactory.java:39)
> >
> >
> >
> > com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultA
> > ctionProxyFactory.java:58)
> >
> >
> > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
> >
> >
> >
> > org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
> > a:434)
> >
> >
> >
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:243)
> >
> >
> >
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:210)
> >
> >
> >
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:240)
> >
> >
> >
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:164)
> >
> >
> >
> > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> > .java:462)
> >
> >
> >
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> >
> >
> >
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100
> > )
> >
> >
> > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
> >
> >
> >
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :118)
> >
> >
> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
> >
> >
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
> >
> >
> >
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> > 11Protocol.java:162)
> >
> >
> >
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> > 11Protocol.java:140)
> >
> >
> >
> > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:
> > 309)
> >
> > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> >
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> >
> > java.lang.Thread.run(Unknown Source)
> >
> >
> >
> > Strut.xml source 
> >
> > 
> >
> >  >
> > "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> >
> > "http://struts.apache.org/dtds/struts-2.0.dtd";>
> >
> >
> >
> > 
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> > 
> >
> >  > extends="

Re: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-20 Thread Yaragalla Muralidhar
localhost:8080/IteratorKFC/menu.action . there is some problem in
this. where is the webapp name?

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ *


On Fri, Jun 20, 2014 at 5:03 PM, Tri Quan  wrote:

> All,
>
> I am green horn in Struts 2 and need help with struts.xml.
> I got the following error when try this URL :
>
> localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action
> .
>
>
>
>
>
>
> what is wrong ?  Incorrect configuration or incorrect URL ?
>
>
>
> Struts has detected an unhandled exception:
>
> There is no Action mapped for namespace / and action name menu. - [unknown
> location]
>
>
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1
> 89)
>
>
>
> org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
>
>
>
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct
> ionProxyFactory.java:39)
>
>
>
> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultA
> ctionProxyFactory.java:58)
>
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
>
>
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
> a:434)
>
>
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:243)
>
>
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:210)
>
>
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:240)
>
>
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:164)
>
>
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:462)
>
>
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
>
>
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100
> )
>
>
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>
>
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :118)
>
>
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
>
>
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
>
>
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> 11Protocol.java:162)
>
>
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> 11Protocol.java:140)
>
>
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:
> 309)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
> java.lang.Thread.run(Unknown Source)
>
>
>
> Strut.xml source 
>
> 
>
> 
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
>
>
> 
>
>
>
> 
>
>
>
>
>
> 
>
>  extends="struts-default">
>
>  method="execute">
>
>  name="success">pages/iteratorkfc.jsp
>
> 
>
> 
>
> 
>
>
>
> ItertorKFCAction java ==
>
> package iteratorkfc;
>
> import java.util.*;
>
>
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class IteratorKFCAction extends ActionSupport{
>
> private List comboMeals;
>
>
>
> public List getComboMeals() {
>
> return comboMeals;
>
> }
>
>
>
> public void setComboMeals(List comboMeals) {
>
> this.comboMeals = comboMeals;
>
> }
>
>
>
> @Override
>
> public String execute() {
>
>
>
> comboMeals = new ArrayList();
>
> comboMeals.add("Snack Plate");
>
> comboMeals.add("Dinner Plate");
>
> comboMeals.add("Colonel Chicken Rice
> Combo");
>
> comboMeals.add("Colonel Burger");
>
> comboMeals.add("O.R. Fillet Burger");
>
> comboMeals.add("Zinger Burger");
>
>
>
> return SUCCESS;
>
> }
>
>
>
> }
>
>
>
> Jsp 
>
> <%@ page contentType="text/html; charset=UTF-8" %>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
>Struts 2 Iterator tag example
>
>
>
>Simple Iterator
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
>   Iterator with IteratorStatus
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  (This is first value) 
>
> 
>
> 
>
>

Re: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-20 Thread Lukasz Lenart
Wrong url, it supposed to be:

http://localhost:8080/IteratorKFC/IteratorKFC/menu.action

/IteratorKFC <- name of the war file, ie. context
/IteratorKFC <- namespace defined in struts.xml


2014-06-20 13:33 GMT+02:00 Tri Quan :
> All,
>
> I am green horn in Struts 2 and need help with struts.xml.
> I got the following error when try this URL :
>
> localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action .
>
>
>
>
>
>
> what is wrong ?  Incorrect configuration or incorrect URL ?
>
>
>
> Struts has detected an unhandled exception:
>
> There is no Action mapped for namespace / and action name menu. - [unknown
> location]
>
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1
> 89)
>
>
> org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
>
>
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct
> ionProxyFactory.java:39)
>
>
> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultA
> ctionProxyFactory.java:58)
>
>
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
>
>
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
> a:434)
>
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:243)
>
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:210)
>
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:240)
>
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:164)
>
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:462)
>
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
>
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100
> )
>
>
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :118)
>
>
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
>
>
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
>
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> 11Protocol.java:162)
>
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
> 11Protocol.java:140)
>
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:
> 309)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
> java.lang.Thread.run(Unknown Source)
>
>
>
> Strut.xml source 
>
> 
>
> 
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
>
>
> 
>
>
>
> 
>
>
>
>
>
> 
>
>  extends="struts-default">
>
>  method="execute">
>
>  name="success">pages/iteratorkfc.jsp
>
> 
>
> 
>
> 
>
>
>
> ItertorKFCAction java ==
>
> package iteratorkfc;
>
> import java.util.*;
>
>
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class IteratorKFCAction extends ActionSupport{
>
> private List comboMeals;
>
>
>
> public List getComboMeals() {
>
> return comboMeals;
>
> }
>
>
>
> public void setComboMeals(List comboMeals) {
>
> this.comboMeals = comboMeals;
>
> }
>
>
>
> @Override
>
> public String execute() {
>
>
>
> comboMeals = new ArrayList();
>
> comboMeals.add("Snack Plate");
>
> comboMeals.add("Dinner Plate");
>
> comboMeals.add("Colonel Chicken Rice
> Combo");
>
> comboMeals.add("Colonel Burger");
>
> comboMeals.add("O.R. Fillet Burger");
>
> comboMeals.add("Zinger Burger");
>
>
>
> return SUCCESS;
>
> }
>
>
>
> }
>
>
>
> Jsp 
>
> <%@ page contentType="text/html; charset=UTF-8" %>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
>Struts 2 Iterator tag example
>
>
>
>Simple Iterator
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
>   Iterator with IteratorStatus
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  (This is first value) 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> 

Re: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-19 Thread Lukasz Lenart
Attachment is missing and mailing doesn't allow to send attachments ;-)


2014-06-20 3:26 GMT+02:00 Tri Quan :

>
>
> All,
>
> I am green horn in Struts 2 and need help with
> struts.xml.  I got the following error when try this URL :
>
> localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action
> .
>
>
>
>
>
> what is wrong ?  Incorrect configuration or incorrect URL ?
>
>
>
>
>
> Thank you for your help and advices.
>
>
>
> [image: cid:image001.png@01CF8B13.3038C4E0]
>
>
>
>
>
>
>
> Strut.xml source 
>
> 
>
> 
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
>
>
> 
>
>
>
> 
>
>
>
>
>
> 
>
>  extends="struts-default">
>
>  method="execute">
>
>  name="success">pages/iteratorkfc.jsp
>
> 
>
> 
>
> 
>
>
>
> ItertorKFCAction java ==
>
> package iteratorkfc;
>
> import java.util.*;
>
>
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class IteratorKFCAction extends ActionSupport{
>
> private List comboMeals;
>
>
>
> public List getComboMeals() {
>
> return comboMeals;
>
> }
>
>
>
> public void setComboMeals(List comboMeals) {
>
> this.comboMeals = comboMeals;
>
> }
>
>
>
> @Override
>
> public String execute() {
>
>
>
> comboMeals = new ArrayList();
>
> comboMeals.add("Snack Plate");
>
> comboMeals.add("Dinner Plate");
>
> comboMeals.add("Colonel Chicken Rice
> Combo");
>
> comboMeals.add("Colonel Burger");
>
> comboMeals.add("O.R. Fillet Burger");
>
> comboMeals.add("Zinger Burger");
>
>
>
> return SUCCESS;
>
> }
>
>
>
> }
>
>
>
> Jsp 
>
> <%@ page contentType="text/html; charset=UTF-8" %>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
>Struts 2 Iterator tag example
>
>
>
>Simple Iterator
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
>   Iterator with IteratorStatus
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  (This is first value) 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
> 
>
>
>
> Tri Quan
>


Re: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-19 Thread Łukasz Lenart
Attachment is missing and mailing doesn't allow to send attachments ;-)


2014-06-20 3:26 GMT+02:00 Tri Quan :

>
>
> All,
>
> I am green horn in Struts 2 and need help with
> struts.xml.  I got the following error when try this URL :
>
> localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action
> .
>
>
>
>
>
> what is wrong ?  Incorrect configuration or incorrect URL ?
>
>
>
>
>
> Thank you for your help and advices.
>
>
>
>
>
>
>
>
>
> Strut.xml source 
>
> 
>
> 
> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
>
>
> 
>
>
>
> 
>
>
>
>
>
> 
>
>  extends="struts-default">
>
>  method="execute">
>
>  name="success">pages/iteratorkfc.jsp
>
> 
>
> 
>
> 
>
>
>
> ItertorKFCAction java ==
>
> package iteratorkfc;
>
> import java.util.*;
>
>
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class IteratorKFCAction extends ActionSupport{
>
> private List comboMeals;
>
>
>
> public List getComboMeals() {
>
> return comboMeals;
>
> }
>
>
>
> public void setComboMeals(List comboMeals) {
>
> this.comboMeals = comboMeals;
>
> }
>
>
>
> @Override
>
> public String execute() {
>
>
>
> comboMeals = new ArrayList();
>
> comboMeals.add("Snack Plate");
>
> comboMeals.add("Dinner Plate");
>
> comboMeals.add("Colonel Chicken Rice
> Combo");
>
> comboMeals.add("Colonel Burger");
>
> comboMeals.add("O.R. Fillet Burger");
>
> comboMeals.add("Zinger Burger");
>
>
>
> return SUCCESS;
>
> }
>
>
>
> }
>
>
>
> Jsp 
>
> <%@ page contentType="text/html; charset=UTF-8" %>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
>Struts 2 Iterator tag example
>
>
>
>Simple Iterator
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
>   Iterator with IteratorStatus
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>  (This is first value) 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> 
>
> 
>
>
>
> Tri Quan
>



-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/


RE: need help on struts.xml configuration using Struts 2.3, Tomcat 7, Java JDK 1.6

2014-06-19 Thread Tri Quan
 

All,

I am green horn in Struts 2 and need help with struts.xml.
I got the following error when try this URL :

localhost:8080/IteratorKFC/menu  or localhost:8080/IteratorKFC/menu.action .


 

 

what is wrong ?  Incorrect configuration or incorrect URL ?

 

 

Thank you for your help and advices. 

 

cid:image001.png@01CF8B13.3038C4E0

 

 

 

Strut.xml source 



http://struts.apache.org/dtds/struts-2.0.dtd";>

 







   

  







pages/iteratorkfc.jsp





 

 

ItertorKFCAction java ==

package iteratorkfc;

import java.util.*;

 

import com.opensymphony.xwork2.ActionSupport;

public class IteratorKFCAction extends ActionSupport{

private List comboMeals;

 

public List getComboMeals() {

return comboMeals;

}

 

public void setComboMeals(List comboMeals) {

this.comboMeals = comboMeals;

}

 

@Override

public String execute() {

 

comboMeals = new ArrayList();

comboMeals.add("Snack Plate");

comboMeals.add("Dinner Plate");

comboMeals.add("Colonel Chicken Rice
Combo");

comboMeals.add("Colonel Burger");

comboMeals.add("O.R. Fillet Burger");

comboMeals.add("Zinger Burger");

 

return SUCCESS;

}



}

 

Jsp 

<%@ page contentType="text/html; charset=UTF-8" %>

<%@ taglib prefix="s" uri="/struts-tags" %>

 









 



   Struts 2 Iterator tag example

 

   Simple Iterator











 

  Iterator with IteratorStatus















 (This is first value) 















 





 

Tri Quan