tags in struts2



Share on Google+Share on Google+

Rashmi Joshi
tags in struts2
1 Answer(s)      5 years and 2 months ago
Posted in : Struts


I am using simple tags in struts2. Like this

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<s:form action="login" method="post" validate="true">
<table align="center" border="0">
                                                <td><s:textfield name="uname" value="" /></td>

                        <td><s:password name="password" value="" /></td>

                        <td><s:submit value="Submit" name="submit" /></td>

But it is showing me following exceptions

freemarker.template.TemplateModelException: Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String) threw an exception when invoked on [email protected]
        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:209)
        at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:167)
        at freemarker.core.Environment.visit(Environment.java:416)
        at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
        at freemarker.core.Environment.visit(Environment.java:209)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:209)
        at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
        at freemarker.core.Environment.visit(Environment.java:209)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:209)
        at freemarker.core.Environment.include(Environment.java:1482)
        at freemarker.core.Include.accept(Include.java:169)
        at freemarker.core.Environment.visit(Environment.java:209)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:209)
        at freemarker.core.Environment.process(Environment.java:189)
        at freemarker.template.Template.process(Template.java:237)
        at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:182)
        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.login_jsp._jspx_meth_s_005fform_005f0(login_jsp.java:152)
        at org.apache.jsp.login_jsp._jspService(login_jsp.java:76)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
        at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.buildValidatorKey(AnnotationActionValidatorManager.java:201)
        at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:58)
        at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:54)
        at org.apache.struts2.components.Form.getValidators(Form.java:264)
        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.invokeMethod(BeansWrapper.java:840)
        at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:106)
        ... 51 more

can any one tell me where i am going wrong?


Related Tutorials/Questions & Answers:
tags in struts2
tags in struts2  Hello I am using simple tags in struts2. Like...-tags" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN.../struts/struts2/struts2-login.shtml More Struts2 Tutorials
Struts2 tags - Struts
Struts2 tags  Q1. i define a statement like " style= "visibility:hidden" in my struts2. this statement is not working. Can you please tell me the solution of this. Q2. if above code can not work then how can i do
Struts2 Data Tags
Struts2 Data Tags           Struts2 Data Tags Apache Struts is an open-source... generic tags in the November issue. In this section, we will continue further
struts2  sir.... i am doing one struts2 application and i have to make pagination in struts2....how can i do
struts2  dear deepak sir plz give the struts 2 examples using applicationresources.properties file
Struts2  i want select multiple items from select list in struts2.when i did like that the two selected values must saved into databse in two diffirent rows.pls provide any one code for this i am new to Struts2
struts2  hi all i am going to run struts2.x program i got this error when server started java.lang.RuntimeException...: Struts2 Tutorials
struts2   Sir when i have run my struts 2 web application,every time i get error " request resources is not available",,,what is this,,,plz help me
Struts2  Hi, I need a solution for displaying success message in same page in struts2. how to redirect same page in struts2.Please help me.   hi friend, To know how redirect action can be done in struts 2 you can go
Struts2  Hi I am using struts 2,In struts2 architecture ,I couldn't understand the purpose of ActionMapper and ActionProxy.My Question is,when the request comes into the picture,the filterdispatcher consult the ActionMapper
Struts2  java.lang.NullPointerException org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69... exception while submitting the update form in struts2 I am using tomcat6.0 ... its
struts2  how to read properties file in jsp of struts2   Hi, You can use the Properties class of Java in your action class. Properties pro = new Properties(); FileInputStream in = new FileInputStream(f); pro.load
STRUTS2  sir but my question is using ApplicationResources.properties in STRUTS 2.i cant get the values into my application.but in the exmple given at roseindia,u cant use the properties file.i use actionclass-validation.xml
Struts2 Tags
Struts2 Tags        ... we will start introducing you with some tags provided with struts 2 framework... Tags are further classified into Control Tags: The Control Tags are used for flow
Struts2 Tags
Struts2 Tags           Apache Struts is an open-source framework used to develop Java web applications. In this section, struts 2 form tags (UItags) will be discussed
struts2 - Struts
Struts2 and Ajax Example  how to use struts2 and ajax
Struts2 and Hibernate
Struts2 and Hibernate  how to fetch database value from one page to another page in struts2 and hibernate
struts2 - Struts
struts2  how to pre populate the fields using struts2 from the database
html tags
html tags  html tags   Java Struts HTML Tags
datetimepicker not displayed in struts2
datetimepicker not displayed in struts2  Hi, I am facing problem in struts2(2.1 version) to diaplay datetimepicker. sample code: <[email protected] prefix="s" uri="/struts-tags"%> <[email protected] prefix="d" uri="/struts-dojo-tags
JSP Tags
JSP Tags  Defined JSP Tags?   Tags are a vital concept in Java Server Pages (JSP). Below is a list of tags used in JSP. This section... and explanations for both. List of the tags Declaration tag Expression tag
Struts2 tag
Struts2 tag  function of hidden tag?   Hi Friend, <s:hidden> tag create a hidden value field.It means it stores the value but cannot be visible. For more information, visit the following link: Struts2 Tutorial
Tags Alignemnt - Struts
Tags Alignemnt  How to align these form tags in a table? When i tryied to add in table i am getting the improper alignment. I used the datetimepicker, selec etc in struts2, Please any body help me to get thesealignment in proper
Struts2 and Hibernate
Struts2 and Hibernate  Sir/ madam, Can we use iterator tag in struts for fetch the database value and shown on form. if yes then how
New to struts2
New to struts2   Please let me know the link where to start for struts 2 beginners   Struts 2 Tutorials
struts2 - Framework
struts2  Hello, I am sathish.. I got problem in stuts2 ? Do tomcat5.5 support struts2 ? Now , currently my application running on tomcat 6... and mainly i want support with tiles(struts 2)...now which struts2 jars i have to use
struts2 - Framework
struts2   RoseIndia i m using this code for a bean in struts2.but geting error SEVERE: Could not instantiate bean how to resolve this.thnx
struts2 - Framework
struts2  Hello, I am sathish i got one problem with struts2 framework...i want to create a jsp page in struts2 i need two buttons in tha jsp ..but these buttons are not dispaly in same row.....once if i create two buttons
Help in Struts2
Help in Struts2  Hi, in struts 2 how to get the values from db and show in jsp page using display tag or iterator tag thanks in advance
themes in struts2
themes in struts2  i want to create themes in strut2 can any one tell the step by step procedure of how to create it.with example links thanks in advance
Struts2 - Struts
Struts2  Hi, I am using doubleselect tag in struts2.roseindia is giving example of it with hardcoded values,i want to use it with dynamic values. Please give a example of it. Thanks