Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML
 
 
Hot Web Programming Job

 

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials

Core Java
JSP
Servlet
JDBC
Hibernate
Struts 1
Struts 2
JSF
Spring
J2EE
J2ME
Web Services
Ajax
Dojo
MySQL
Latest Comments
Null pointer excep
swap program faile
hi.........
very good
navigaton mobile
  All Comments...
 

 

 
Struts Tutorials
*Stuts TOC
*Apache Struts Introduction
* Struts Controller
* Struts Action Class
* Struts ActionFrom Class
* Using Struts HTML Tags
*Struts Validator Framework    
*Client Side Address Validation    
*Struts Tiles
*tiles-defs.xml
*Struts DynaActionForm
*Struts File Upload
*Struts DataSource
*AGGREGATING ACTIONS
*Internationalization
Struts Resources
*Struts Books
*Struts Articles
*Struts Frameworks
*Struts IDE
*Struts Alternative
*Struts Links
*Struts Presentations
*Struts Projects
*Struts Software
*Struts Reference
*Struts Resources
*Other Struts Tutorial
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Struts StrutsActionForms

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

103 comments so far (post your own) View All Comments Latest 10 Comments:

Hi,

For those who are looking to use the validate() method properly, dont forget that you have to add the error message to the applicationresources.properties file.

in this case it would be something like:

error.name.required=<li>Name Field is Required, Try Again</li>

Posted by AP on Friday, 07.10.09 @ 23:18pm | #89232

it is very nice

Posted by jax on Thursday, 04.9.09 @ 12:40pm | #86674

hello
thinks for the tutorials.
here you say :"Now we will create the Action class which is the model part of the application" and in the http://www.roseindia.net/struts/understandingstruts_action_class.shtml" you sau :"Action class acts as wrapper around the business logic and provides an inteface to the application's Model layer. It acts as glue between the View and Model layer"!!!
in any way thinks for the tutorial

Posted by Aymen on Wednesday, 04.8.09 @ 18:56pm | #86654


It would be more helpful if
coding for database connectivity provided in the same chapter as most of the people who use this tutorial familier with JSP and DB connectivity.
Its a wonderful tutorial to master Struts.

Posted by Abhishek Mohan.k on Wednesday, 12.10.08 @ 23:57pm | #82619

I am a Struts programmer at Chennai and this site is so helpful that i cant describe more.

This site is really really wonderful

Thanks.Keep up the good work

Posted by Chandra on Monday, 12.1.08 @ 05:39am | #82232

<action
path="/Address"
in the following example you have been using input="/pages/Address.jsp"
instead ot that can i use input="/pages.do"

type="roseindia.net.AddressAction"
name="AddressForm"
scope="request"
validate="true"
input="/pages/Address.jsp">
<forward name="success" path="/pages/success.jsp"/>
</action>

Posted by Vipul Khalasi on Saturday, 11.29.08 @ 03:59am | #82171

Hi,

Suppose i use an image like <html:image src="./images/email/cancelbutton.jpg"/> in the place of the <html:cancel>, the validate method is still being called. How can I bypass the validate method in this case?

Posted by Dharan on Thursday, 05.29.08 @ 12:12pm | #61331

hi
i want simple example for jsf in jboss with eclips so please give me replay soon.

Posted by agiurpadeep on Tuesday, 04.22.08 @ 10:17am | #57471

I am interested to participant in this site

Posted by Madhu on Wednesday, 03.19.08 @ 13:04pm | #53297

when i was execute above example its correct for address.jsp when i was click in the save button it is not goes to success.jsp and

server showing error for unable to read to ther 'success'.in last line pls tell me the answer

Posted by Tikam on Saturday, 02.23.08 @ 13:29pm | #49586

I am a Struts programmer at Net-temps,USA and this site is so helpful that i cant describe more.

This site is really really wonderful

Thanks.Keep up the good work

Posted by Nitin on Wednesday, 02.20.08 @ 16:17pm | #49206

please explain how to work struts project in eclipse3.0 IDE,tell me the step-by-step procedure of adding struts plugins to eclipseIDE

Posted by periasamy on Tuesday, 02.19.08 @ 05:15am | #48941

its must be ActionError insted of ActionMessage

ex: errors.add("name",new ActionError("error.name.required"));

and the message must be defined in the MessageResources.properties file...

ex: error.name.required= Name Required(Error Message).

Posted by varun on Monday, 02.11.08 @ 21:43pm | #47923

i am trying to build this in net beans6.0.
the save ans cancel are not working and validation as well need some help.
if some body have the working code pls tell me..

HTTP Status 404 - Servlet action is not available

type Status report

message Servlet action is not available

description The requested resource (Servlet action is not available) is not available.
Apache Tomcat/6.0.14

Posted by novicepro on Tuesday, 02.5.08 @ 07:51am | #47252

How to use reset(), defined in above ActionForm class?What are the attributes that i have to mention in struts-config xml file, to use this reset() method?

Posted by saritha on Tuesday, 01.29.08 @ 12:28pm | #46475

what is the difference between page and pagecontext in jsp

Posted by mahendar reddy on Friday, 01.18.08 @ 12:25pm | #45506

thanks for the tutorials

Posted by kurt on Wednesday, 01.2.08 @ 21:25pm | #44380

<html:html locale="true">and <title><bean:message key="welcome.title"/></title>
these tag explanation is not there in this page atleast give link of this for explanation ...it ll be better......

Posted by nagarajan on Monday, 12.10.07 @ 13:10pm | #41719

you provide Exelent course material for us.
Thanks !

Posted by vikash kumar on Wednesday, 11.28.07 @ 18:38pm | #40837

Hello,

The Class Cast exceptions that several posters have mentioned is due to using both ActionMessage and ActionErrors classes in the example.

Particularly, in the validate() method,
errors.add("", new ActionMessage(""));
This tries to add an ActionMessage into errors which is type ActionError.

Preferably, change errors to type ActionMessage class as the other one is now eprecated.

Posted by ketymoneio on Wednesday, 11.28.07 @ 17:29pm | #40835

In the sample program, you used the <bean:message>,<message-resources>... but u didnt how to create that key and property file... if u give some example it'll be more useful for us.....




The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.struts.action.ActionMessage
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.ClassCastException: org.apache.struts.action.ActionMessage
org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)
org.apache.jsp.address_jsp._jspx_meth_html_errors_0(address_jsp.java:276)
org.apache.jsp.address_jsp._jspx_meth_html_form_0(address_jsp.java:196)
org.apache.jsp.address_jsp._jspx_meth_html_html_0(address_jsp.java:128)
org.apache.jsp.address_jsp._jspService(address_jsp.java:83)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

Posted by Joe on Tuesday, 11.27.07 @ 10:06am | #40637







hai this is kalpana.i mensioned error below ,i got error like this ,can u help me to rectify this error.







javax.servlet.ServletException: No getter method for property uname of bean org.apache.struts.taglib.html.BEAN
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.pages.Login_jsp._jspService(Login_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause

javax.servlet.jsp.JspException: No getter method for property uname of bean org.apache.struts.taglib.html.BEAN
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:1031)
org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(BaseFieldTag.java:153)
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:96)
org.apache.jsp.pages.Login_jsp._jspx_meth_html_text_0(Login_jsp.java:261)
org.apache.jsp.pages.Login_jsp._jspx_meth_html_form_0(Login_jsp.java:192)
org.apache.jsp.pages.Login_jsp._jspx_meth_html_html_0(Login_jsp.java:120)
org.apache.jsp.pages.Login_jsp._jspService(Login_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

Posted by kalpana on Friday, 11.23.07 @ 16:46pm | #38746

nice tutorial

Posted by nidhin on Friday, 11.16.07 @ 13:22pm | #37555

while i using ActionMessage in validate method
i am getting this problem
org.apache.jasper.JasperException: org.apache.struts.action.ActionMessage
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:207)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:628)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:383)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:307)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:568)


root cause

java.lang.ClassCastException: org.apache.struts.action.ActionMessage
at org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)
at org.apache.jsp.welcome_jsp._jspx_meth_html_errors_0(welcome_jsp.java:154)
at org.apache.jsp.welcome_jsp._jspx_meth_html_html_0(welcome_jsp.java:100)
at org.apache.jsp.welcome_jsp._jspService(welcome_jsp.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:628)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:383)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:307)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:568)


whenever i use the ActionErrors in validate method i am not getting the problem .

Posted by ramu on Thursday, 11.15.07 @ 15:56pm | #37488

while running action form getting this error. Please Help me
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: File "/tags/struts-bean" not found
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

root cause

org.apache.jasper.JasperException: File "/tags/struts-bean" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:159)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

Posted by vijaya on Wednesday, 10.10.07 @ 20:18pm | #33018

The best thing about your site is that everything is provided in a very simple manner.

I just wish that you give us the entire application to download (or its war file) when the explanation of the code is over; including the jars and the whole package structure. This will help in reducing our time in actually setting up the application.

Posted by Prasad on Tuesday, 10.9.07 @ 16:12pm | #32640

Hi,
All thou the tutorial is good but the new version of struts have different tags uri. Can you specify in which directory the tags need to be placed?

Regards,
-sam

Posted by sam on Monday, 10.8.07 @ 14:35pm | #32468

hi
material is very fine but sufficient examples are not there...
it will be good if u provide more examples.
if not it will be more confusing

Posted by sri on Wednesday, 10.3.07 @ 19:56pm | #31319

Hi,
I am Ashis Bhar (e-mailId:ashisbhar1@rediffmail.com). While I have little time to finish for the entire Web Java course of Sun Microsystem, I was trying out the netbeans tutrial struts simple sample application.
Your way of solving just matches with my way
and infact everything is working fine excepting the cancel Button. I have just completed the same set of operation for long and it is giving me a
HTTP-STATUS:500 Error as follows:
javax.servlet.ServletException
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:211)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)


root cause

org.apache.struts.action.InvalidCancelException
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)


note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server logs.


Please Help me...
Thank You.

Posted by Ashis Bhar on Wednesday, 09.26.07 @ 00:05am | #29334

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: org.apache.struts.action.ActionMessage
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.ClassCastException: org.apache.struts.action.ActionMessage
org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:215)
org.apache.jsp.Address_jsp._jspx_meth_html_errors_0(Address_jsp.java:271)
org.apache.jsp.Address_jsp._jspx_meth_html_form_0(Address_jsp.java:191)
org.apache.jsp.Address_jsp._jspx_meth_html_html_0(Address_jsp.java:129)
org.apache.jsp.Address_jsp._jspService(Address_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:980)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

Posted by kumar on Friday, 09.7.07 @ 14:13pm | #26298

Here is how you configure the messages e.g. welcome.title in the tutorial

Edit struts-config.xml and add this line

<message-resources parameter="resources/application"/>

create a directory called resources under the the struts-config.xml's directory

cd resources
create a file application.properties
and add these lines

welcome.title=Welcome to Address Form
error.address.required=Error Address Required
error.emailaddress.required=<BR>Error Email Address Required <BR>
error.name.required=Error Name Required

Restart and see the error messages displayed on the screen

Posted by murthy on Friday, 08.24.07 @ 20:06pm | #24054

can i use a simple jsp page containing no custom tags &b yet use the action errors for validation?
also will simply defining the action errors validate method & setting validate=true do the needful for doing validations??

wanna thank u for such a simple yet really helpful tutorial.

Posted by sc on Sunday, 08.5.07 @ 12:43pm | #22702

you have to place your property files in classes folder .

Posted by ranjeet singh on Saturday, 08.4.07 @ 16:44pm | #22649

Where is the properties file?

Posted by Amit on Thursday, 06.7.07 @ 05:37am | #18453

The structure in which the folders are arranged is to be specified.
The order in which the classes or files to be written should be specified.
Description should be in the form of steps.

Thanks,
Ajay.

Posted by Ajay on Wednesday, 06.6.07 @ 09:17am | #18361

if any errors occures in the validate method of form bean, who will forward those errors to view

Posted by Veeranjaneyulu on Thursday, 05.31.07 @ 17:06pm | #17860

very good tutorial for one n all !!!

Posted by Atul Arora on Monday, 05.28.07 @ 15:35pm | #17530

Well done!
I have searched all over the internet for tutorials regarding apache struts.
This is by far one of the best that I've found
yet.
Most of the other code I've looked at wouldn't
even work for me.

Thanks for giving your time and expertise so that
newcomers to struts can get a good grasp of the
technology.

God Bless,
Duane

Posted by Duane on Wednesday, 05.23.07 @ 22:58pm | #17111

Hi,

When I send a request as Address.do the jsp is getting validated and hence errors are being displayed on the page.
But I want the page without errors.These errors should generate when I fill the form and after clicking save button only

Posted by Hussain on Thursday, 05.17.07 @ 14:10pm | #16247

I have made this example with jsp and build successed but no even error happen when i submit for "Name, Emailadrress, Address" is null. So which do i make wrong?Thank you so much.

Posted by Lê Thị Anh Thý on Thursday, 05.17.07 @ 12:05pm | #16228

why *.do is written in web.xml why not *.jsp or *.something other.........

Posted by hari on Tuesday, 05.15.07 @ 15:19pm | #15989

Oscar,

first add this to struts-config.xml
<forward name="cancel" path="/index.jsp"/>

then add this line to AddressAction.java
if (isCancelled(request))
return mapping.findForward("cancel");
else
return mapping.findForward("success");

It works fine for me.

Posted by olivo on Friday, 05.11.07 @ 21:59pm | #15666

very good to clarify who have an idea or concept on this struts

Posted by murthy on Friday, 05.4.07 @ 12:55pm | #15259

Hi,
This is explination very useful to me ,but one daught how to write checkbox fields in action
Form of struts frame work,
Thanks and regards
vijay

Posted by vijay on Saturday, 04.28.07 @ 17:48pm | #15035

Its really great and very very helpful article.
thanks.

Posted by mahi on Thursday, 04.19.07 @ 20:37pm | #14580

whether action class belongs to model or controller

Posted by sri kumar on Thursday, 04.19.07 @ 19:03pm | #14573

Cannot find message resources under key org.apache.struts.action.MESSAGE
This is the error message displayed for me, but the validation is not done, if any of the textbox is left empty, just the error message is thrown, In index.jsp page you asked to type the
"<html:link page="/pages/Address.jsp">Test the Address Form</html:link>" and please help to validate this example givne in chapter 4- AddressForm and AddressAction.


Posted by prabhu on Wednesday, 04.11.07 @ 15:30pm | #13873

ITs very good for learners

Posted by Srinu on Tuesday, 04.10.07 @ 15:56pm | #13722

Really Very Good Site for any Java People

Posted by Ashu on Saturday, 04.7.07 @ 16:00pm | #13536

Where's the full text for index.jsp? I wasn't able to successfully run the app. :(

Posted by Sangita on Wednesday, 04.4.07 @ 01:40am | #13301

good day!
i am a new user for struts and have one question about actionform:
at veiw has data like following:
id name address tel birthdate salary
01 ddd ffff ff ffff ffff
02 fff skfdj ls dd df
-- -- -- -- -- --
how can i use one actionform to get the whole data?
use map or list or have another method?
can u provide me a sample code , thanks alot!

Posted by thomas on Thursday, 03.29.07 @ 19:17pm | #12927

hello

<html:cancel>Cancel</html:cancel>

this button should cancel the form, but result of cancel action is success.jsp
can you help me?

Posted by Oscar on Wednesday, 03.28.07 @ 17:55pm | #12848

hi am just a beginner in strus. I tried the above example and found that instead of

ActionMessage we should use ActionError inside if block of validate method

(iam not sure.. but the second one worked for me)

Posted by Renjith on Monday, 03.26.07 @ 17:42pm | #12730

it is very informative site for java beginers

Posted by navneetraj on Thursday, 03.22.07 @ 14:06pm | #12486

its a very good site for java people

Posted by kiran on Tuesday, 03.13.07 @ 02:51am | #11538

How is Action Class part of Model, if you are following MVC. I always thought Action Class are part of Controller.

Posted by Kiran on Friday, 03.9.07 @ 02:30am | #11198

It helped me a lot.
Thanks

Posted by Balaji on Thursday, 03.8.07 @ 15:48pm | #11137

The work done by you people is greate, simple and better but, show the directory structure so that it will be clear how to develop this struts application.

Posted by Rock Ster on Thursday, 03.8.07 @ 14:28pm | #11122

good day!
i don't have any comment but i have a question.. can you provide me a code that generates a time randomly using struts?.. hows this..?

like for example i clicked on a button then it appears the randomized time.. the time should not be based on the present time or based on the clock of your computer. can you provide me of this? hope so. thanks alot!

Posted by angelyn on Thursday, 03.8.07 @ 11:15am | #11100

NICE TO BEGIN.. and recollect the fundas

Posted by Sandeep on Sunday, 02.25.07 @ 04:33am | #9509

But, there is missing examplea are missing for where each file located, it would be great if you give folder structure sample development.

Posted by Srini on Wednesday, 02.14.07 @ 19:31pm | #7893

This is very gud tutorial specially for beginners and it helps us a lot to implement things quite easily.

Posted by jayanta banerjee on Monday, 02.12.07 @ 15:01pm | #7527

hi,
I m learning the working of STRUTS from this tutorial and getting it very easy to achive my goal in my project from it.. thanX...
Vivek Wadekar

Posted by Vivek Wadekar on Sunday, 02.11.07 @ 16:00pm | #7332

can anyone tell me how to updated multiple records in Struts Form bean

Posted by bhavna on Wednesday, 02.7.07 @ 14:49pm | #6581

This site is really very helpful for the beginners to cope up very well.This type of Sample Code examples helps the new comers & the experienced guys well .Thanks a lottttttt.

Posted by NavaChaitanya on Friday, 02.2.07 @ 14:01pm | #5410

hey dis site is very gud for learners
hope to get more info abt validations....

Thanx
Indu

Posted by Indu on Friday, 02.2.07 @ 12:26pm | #5393

This site is really very helpful for the beginners to cope up very well.This type of Sample Code examples helps the new comers & the experienced guys well .Thanks a lottttttt.

Posted by NavaChaitanya on Friday, 02.2.07 @ 12:06pm | #5389

This tutorial is really very good and usefull for all new learners and and experienced guys also.It is very much useful for all learning guys.

Posted by Kameshwar on Wednesday, 01.31.07 @ 16:05pm | #4910

hey. this site is great especially for those new to the world of struts

Posted by mastermind on Tuesday, 01.30.07 @ 13:24pm | #4689

Thanks you for your information.well done

Posted by ashok kumar g.s on Monday, 01.29.07 @ 21:24pm | #4652

Hi,
I am learning struts from your tutorials. It is very simple and easy to understand.
When I started designing shoping cart, with struts I am finding it difficult. How should I go about one complete application (with data source) using struts. Is any tutorials/guidelines available?

Thanking you,
shanthi

Posted by shanthi Ramabhadran on Monday, 01.29.07 @ 14:19pm | #4623

"roseindia.net" is helped me a lot .i am very thank full.

could you please send me how to run struts application on weblogic server

Posted by sunil on Sunday, 01.28.07 @ 21:30pm | #4570

Hi All,

This is good site.i have got lot of help from this site.Thanks to all

Posted by chandrasekhar on Saturday, 01.27.07 @ 17:58pm | #4489

it is good message
we are create Action uml diagrams

Posted by penchalaiah on Saturday, 01.27.07 @ 08:53am | #4470

For Eg. I have 3 Action Forms for Update,Save,delete. when i click the update button how it should be identified for that particular form goes to and viceversa..?

Can anyone please help me in this?its very urgent

Posted by Balasubramanyam on Tuesday, 01.23.07 @ 12:53pm | #4132

Hi

Is there any particular intention in making ActionForm an abstract class?Action Form doesnt specify any abstract methods

Posted by Jayakrishnan on Thursday, 01.18.07 @ 14:52pm | #3757

The tutorial is nice but is not complete.
I wasted at least 4/5 hours to figure out what needs to be done in case of error. The Message properties file needs to be modified for the errors to be displayed.

The following three lines needs to be added .
error.name.required=name.required
error.address.required=address required
error.emailaddress.required=e mail address required

Also Success.jsp is been defined.

Posted by digambar on Sunday, 01.14.07 @ 04:37am | #3432

How to start with struts?
I have instaled Rational software development platform(RSA) with all components, and I have problem how to start and create simple struts project
which project do I have open?
example
FILE->NEW->what now?

Thanks for help
Mario from Croatia

Posted by mario j on Friday, 01.12.07 @ 13:39pm | #3275

This article is nicely writen and easy to understand..

One little suggestion from my side ..I think there will come this <form-beans></form-beans> tag wraping to <form-bean
name="AddressForm"
type="roseindia.net.AddressForm"/> shown in the example.

So the entry for form bean in struts-config is like this..
<form-beans>
<form-bean
name="AddressForm"
type="roseindia.net.AddressForm"/>
</form-beans>

Posted by dipen on Sunday, 01.7.07 @ 03:08am | #2814

How could i assign the particular value obtained thru formBean and keep the value as the selected option from the list of options.

Posted by Hari on Friday, 01.5.07 @ 12:29pm | #2676

Hi
its great
But it will be very nice if you please make it printable.
thanks

Posted by rakesh on Wednesday, 01.3.07 @ 16:08pm | #2548

indeed a very usefull tutorial !
still a lot has chaged now ..such as using
"errors.add("name",new ActionMessage("errors.required","Name"));"

will give the validators error message in the form.

Posted by Gaurang on Wednesday, 01.3.07 @ 15:09pm | #2542

thanks to Writer

Posted by Rehan on Friday, 12.22.06 @ 12:58pm | #1451

Thats a very good tutorial and very help full,

thanks to Writer

Rehan Rana

Posted by Rehan Rana on Friday, 12.22.06 @ 12:55pm | #1449

It is really very good tutorial for beginner. i appreciate the author to discuss the thing in detail still u can add more example.

Posted by Manohar Raulji on Wednesday, 12.20.06 @ 13:23pm | #1315

Tutorial is vey useful.
But Can u give more example it will be more understandable and easier.

Thanks

Posted by Gayatri on Thursday, 12.14.06 @ 16:36pm | #1026

It's really great help. Thanx a lot.
Friends u can also give information about such a nice web sites here.

Posted by Srinivas Jilla on Thursday, 12.14.06 @ 11:56am | #1007

This material is good for me.But i want to write the code for validations in the Action Class..Can U send any example.

Posted by dilipkumar on Wednesday, 12.13.06 @ 15:06pm | #946

Very very good tutorial

Posted by Saurabh on Monday, 12.11.06 @ 12:28pm | #759

Pl. Suggest the examples you would like to see on the roseindia.net

Thank

Posted by Deepak Kumar on Monday, 12.11.06 @ 03:50am | #741

Hi,
Really good tutorial on struts. Really crystal clear & easily understandable. Can give some more real world examples.

Posted by Ravishankar.R on Monday, 12.11.06 @ 00:17am | #738

Here is real example of struts
Login and User Registration Application

Thanks

Posted by Deepak Kumar on Friday, 12.8.06 @ 16:07pm | #650

This is a good tutorial on struts ..can u give some more real example on this tutorial

Posted by Anuj Tomar on Friday, 12.8.06 @ 15:08pm | #638

this is very useful getting the good concept

Posted by devender on Friday, 12.8.06 @ 10:42am | #623

good and understandable....

Posted by bodepudi roop kishan chowdary on Wednesday, 12.6.06 @ 14:16pm | #491

Yah its very good material

Thanks
Ram

Posted by Ram on Tuesday, 12.5.06 @ 14:02pm | #412

Great but the error messages are not being displayed.

Posted by Qavi on Monday, 12.4.06 @ 22:33pm | #394

A very good tutorial keep it up

Posted by Praveen on Monday, 12.4.06 @ 10:18am | #372

Hi;
Really nice tutorial,i will be great if you will post some more examples related to struts with the stepwise implementation of the application just from the scratch.
Thanks
bye

Posted by rafat on Monday, 11.27.06 @ 13:04pm | #131

Hi, While we want to change addres form variables address as telephone the error messages are not seen. Is the struts.jar file specific for this example?

What must I do validate my own forms. And I want use <html:errors/>

Posted by yk on Sunday, 11.26.06 @ 14:20pm | #112

It doesn't work. :( I tried deploying it in Netbeans on Tomcat server. I followed all the steps and wile running in browser an error 500 occured

Posted by Krzysiek on Friday, 11.24.06 @ 15:30pm | #82

Hi there! Nice tutorial, so far.

Still there will be some errors with Struts 1.2.9:

When you press "Cancel" button, you will have an ugly org.apache.struts.action.InvalidCancelException. To overcome this, simply put <set-property property="cancellable" value="true"/> to the action mapping. It will look like this for Struts 1.2.9 :
<action
path="/Address"
type="net.kyivstar.struts.AddressAction"
name="AddressForm"
scope="request"
validate="true"
input="/pages/Address.jsp">
<set-property property="cancellable" value="true"/>
<forward name="success" path="/pages/success.jsp"/>
</action>

More on this: http://wiki.apache.org/struts/StrutsUpgradeNotes128to129#head-2eeaeb59595f2fa6294dbfbe9d2298b4ad124cfb

Posted by Juriy on Friday, 11.24.06 @ 15:23pm | #79

thanks for giving this help
it very help ful for us.
thankyou very much

Posted by tulesh on Friday, 11.24.06 @ 15:01pm | #77

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.