struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shenxiaojing" <leftka...@sina.com>
Subject struts2.1.8 generator tag problem
Date Sat, 17 Oct 2009 05:17:20 GMT
http://struts.apache.org/2.1.8/docs/generator.html
Example Three doesn't work!!!

Example Three:
<pre>
Generate an iterator with var attribute
<s:generator val="%{'aaa,bbb,ccc,ddd,eee'}" count="4" separator=","
var="myAtt" />
<%
 Iterator i = (Iterator) pageContext.getAttribute("myAtt");
 while(i.hasNext()) {
     String s = (String) i.next(); %>
     <%=s%> <br/>
<%    }
%>
</pre>
This generates an iterator and put it in the PageContext under the key as
specified
by the var attribute.


Struts has detected an unhandled exception:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWra
pper.java:524)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:4
35)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:654)
 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:445)
 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:379)
 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:292)
 
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispa
tcherResult.java:154)
 
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor
t.java:186)
 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionI
nvocation.java:361)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:265)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(Con
versionErrorInterceptor.java:122)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame
tersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame
tersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(St
aticParametersInterceptor.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterce
ptor.java:93)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInt
erceptor.java:235)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDr
ivenInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(S
copedModelDrivenInterceptor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(Prof
ilingActivationInterceptor.java:104)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu
ggingInterceptor.java:267)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn
terceptor.java:126)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn
terceptor.java:138)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto
r.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon
figInterceptor.java:164)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep
tor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex
ceptionMappingInterceptor.java:176)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
 
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
 
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOper
ations.java:77)
 
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsE
xecuteFilter.java:76)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java
:119)
 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
55)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsP
repareFilter.java:65)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:175)
 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
)
 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
 
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:
887)
 
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(H
ttp11NioProtocol.java:696)
 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:
2009)
 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:885)
 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
07)
    java.lang.Thread.run(Thread.java:619)
    
java.lang.NullPointerException
 
org.apache.jsp.tags.non_002dui.iteratorTag.showIteratorGeneratorTagDemo_jsp.
_jspService(showIteratorGeneratorTagDemo_jsp.java:93)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
93)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:654)
 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:445)
 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:379)
 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:292)
 
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispa
tcherResult.java:154)
 
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSuppor
t.java:186)
 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionI
nvocation.java:361)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:265)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(Con
versionErrorInterceptor.java:122)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame
tersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Parame
tersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(St
aticParametersInterceptor.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterce
ptor.java:93)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInt
erceptor.java:235)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDr
ivenInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(S
copedModelDrivenInterceptor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(Prof
ilingActivationInterceptor.java:104)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debu
ggingInterceptor.java:267)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingIn
terceptor.java:126)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareIn
terceptor.java:138)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Method
FilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nIntercepto
r.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletCon
figInterceptor.java:164)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasIntercep
tor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(Ex
ceptionMappingInterceptor.java:176)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:236)
 
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
 
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
 
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOper
ations.java:77)
 
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsE
xecuteFilter.java:76)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java
:119)
 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:
55)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsP
repareFilter.java:65)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:175)
 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
)
 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
 
org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:
887)
 
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(H
ttp11NioProtocol.java:696)
 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:
2009)
 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja
va:885)
 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
07)
    java.lang.Thread.run(Thread.java:619)


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


Mime
View raw message