struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dasari Taraka Rajendra Prasad (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-3568) using <s:select list="{....}"> tag
Date Sat, 12 Feb 2011 11:26:57 GMT

    [ https://issues.apache.org/jira/browse/WW-3568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993887#comment-12993887
] 

Dasari Taraka Rajendra Prasad commented on WW-3568:
---------------------------------------------------

If i use a list that is on value stack the same problem is not coming

> using <s:select list="{....}"> tag
> ----------------------------------
>
>                 Key: WW-3568
>                 URL: https://issues.apache.org/jira/browse/WW-3568
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Integration
>    Affects Versions: 2.2.1.1
>         Environment: windows vista, tomcat7,commandline
>            Reporter: Dasari Taraka Rajendra Prasad
>            Assignee: Lukasz Lenart
>              Labels: freemarker-integration-failure
>             Fix For: 2.2.2
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> in clValid.jsp, i had used input page
> <%@ taglib prefix="s" uri="/struts-tags" %>
>    <s:form action="ClientValid" validate="true" >
>   -------
>  ----------------------------------    
>        <s:select label="Service Name" emptyOption="true"
>          list="#{'DrivingLicence':'DrivingLicence',
>                  'ElectricityBill':'ElectricityBill',
>          'WaterBill':'WaterBill','InsurancePremium':'InsurancePremium'}" 
>          name="service" />   
>    <s:submit align="center" value="show client-Side validation"/>
>  </s:form>
> in struts.xml
> <package name="htcstruts" 
>             extends="struts-default">
>   <action name="ClientValid" 
>           class="htcstruts.ClientValidAction">
>     
>     <result name="success">
>           /clResult.jsp
>     </result>
>     <result name="input">
>        /clValid.jsp
>     </result>
>   </action>
> action class is 
> public class ClientValidAction extends ActionSupport {
>  
>   private String applName;
>   private String service;
>   private double charges;
>   
>   private String resStr;
>   private ConcurrentHashMap<String,Double> services;
>   public ClientValidAction() {
>    services = new ConcurrentHashMap<String,Double>();
>    services.put("DrivingLicence",new Double(100.5));
>    services.put("ElectricityBill",new Double(40.5));
>    services.put("WaterBill",new Double(35.5));
>    services.put("InsurancePremium",new Double(30.5));
>   }
>   public String execute() throws Exception {
>    double cost = services.get(service);
>    resStr = "hello! "+applName+" Charges for "+
>              service+ " are "+cost+".Please ready to pay";
>    return  SUCCESS;
>   }
>   public String getResStr() {
>    return resStr;
>   } 
>   public String getApplName() {
>    return applName;
>   }
>   
>   public void setApplName(String newName) {
>    applName = newName;
>   }
>   public String getService() {
>    return service;
>   }
>   
>   public void setService(String newService) {
>     service = newService;
>   }
>   public double getCharges() {
>    return charges;
>   }
>   
>   public void setCharges(double newCharge) {
>     charges = newCharge;
>   }
> }
> used a validator.xml  ClientValidAction-validation.xml
>    <!DOCTYPE validators PUBLIC 
>   		"-//OpenSymphony Group//XWork Validator 1.0.2//EN" 
>   		"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
>   <validators>
>        <field name="applName">
>  	<field-validator type="requiredstring">
>         <param name="trim">true</param>
>         <message>Applicant's name is required</message>
>       </field-validator>
>     </field>
>     <field name="charges">
>      <field-validator type="double">
>        <param name="minExclusive">9.99</param>
>        <param name="maxInclusive">120.0</param>
> 	<message>
>          Charges should be higher than ${minExclusive} and lessequal          to ${maxInclusive}
>          
>        </message>
>       </field-validator>
>      </field>
>   </validators>
>  
> when i am asking the input , i am getting in browser
> FreeMarker template error!
> Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String)
threw an exception when invoked on org.apache.struts2.components.Form@1be20c
> The problematic instruction:
> ----------
> ==> list tag.getValidators("${tagName}") as validator [on line 46, column 9 in template/xhtml/form-close-validate.ftl]
>  in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on line 25, column
1 in template/xhtml/form-close.ftl]
> ----------
> Java backtrace for programmers:
> ----------
> freemarker.template.TemplateModelException: Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String)
threw an exception when invoked on org.apache.struts2.components.Form@1be20c
> 	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
> 	at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
> 	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
> 	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
> 	at freemarker.core.Environment.visit(Environment.java:417)
> 	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.Environment.include(Environment.java:1483)
> 	at freemarker.core.Include.accept(Include.java:169)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:210)
> 	at freemarker.core.Environment.process(Environment.java:190)
> 	at freemarker.template.Template.process(Template.java:237)
> 	at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
> 	at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
> 	at org.apache.struts2.components.UIBean.end(UIBean.java:513)
> 	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
> 	at org.apache.jsp.clValid_jsp._jspx_meth_s_005fform_005f0(clValid_jsp.java:164)
> 	at org.apache.jsp.clValid_jsp._jspService(clValid_jsp.java:85)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:68)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:332)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237)
> 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.NullPointerException
> 	at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorKey(AnnotationActionValidatorManager.java:212)
> 	at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:69)
> 	at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:65)
> 	at org.apache.struts2.components.Form.getValidators(Form.java:265)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at freemarker.ext.beans.BeansWrapper.invokeMet
> application is working 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message