Struts Tutorial

struts tutorials

Struts 1.x is the most famous, classic and proven Model-View-Contraller (MVC) framework. Often times, you will listen something like, meaningless to learn Struts 1.x, it’s a dead framework. However, with the huge success of Struts 1.x in early day, there are still hundreds of thousand companies are implemented Struts 1.x, and never consider upgrade, so the Struts 1.x is still causing many maintainability.

Struts 1.x is a complete web framework, provides complete web form components, validator, internalization, error handling, tiles layout, low learning curve and easy to implement it. In this tutorials, it provides many step by step examples and explanations on using Struts 1.x MVC framework.

Happy learning Struts. 🙂

Struts Quick Start

Let’s go through a quick start to understand about the Struts 1.x framework.

Struts Configuration

All stuffs about Struts configuration.

Struts Action & ActionForm

Action and ActionForm implementation class.

Struts Web Form Components

Struts has complete support for all standard web form components.

Struts Logic Tags

Struts comes with a lot logic tags to ease the bean component iteration or conditional processing.

Struts Error and Logging

Exception handling and error logging.

Struts localization

Struts has good support in internationalizing or localization.

Struts Validator Framework

In Struts validator framework, it provides many generic methods (required, maxlength, minlength..) to validate the form components, it makes your validation code more standardize and easier to maintain.

  • Struts validator example
    A simple user registration form , and validate the username, password and email field with Struts validator.

Struts Tiles Framework

Struts tiles framework is a powerful layout framework, which is used to maintain a standard look of header, footer or menu details across all of your web pages.

  • Struts Tiles framework example
    A simple web application to demonstrate the use the Sturts tiles framework to change the header and footer page easily.

Struts Integrate with Other Frameworks

Anything about the Struts integration with others framework.

Struts Misc

Others Struts examples.

Struts Common Errors

Some Struts common error messages.

Struts Reference

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
35 Comment threads
12 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
41 Comment authors
AshokanuragManoj kumarsurya prakash singhJeevan Sunkersett Recent comment authors
newest oldest most voted
surya prakash singh
Guest
surya prakash singh

how can we judge from working application that working application is build on strusts

anurag
Guest
anurag

this is very helpful for everyone who wants to learn struts framework.
thank you

dhananjay patil
Guest
dhananjay patil

this error is coming when i am running the struts applciation please help .

org.apache.jasper.JasperException: java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor.

thank you,
dhananjay

Sagar Yadav
Guest
Sagar Yadav

Thanks.

anh nguyen
Guest
anh nguyen

thank U so much !
Your blog’s very usefully ! ^_^

Alexander Pavluchenko
Guest
Alexander Pavluchenko

Helps slove to my work, great blog!

anil
Guest
anil

thanks a lot to mkyong

Basanta Kumar nahak
Guest
Basanta Kumar nahak

what is maven?
what is the use of maven?
how can we use it?

Kamal
Guest
Kamal

i didnot find any blog of EJB 3.0. Could you please provide tthis Blog for us.

sumit
Guest
sumit

Hi Sir, whenever i tried to import the zip.file or even making my own struts1 based project using the same pom.xml i am getting this exception It did not happen while i make my project without maven means by simple impoerting all jar file manually. Please help me… Waiting for your Solved reply soon…. SEVERE: Servlet /StrutsExample threw load() exception java.lang.ClassNotFoundException: org.apache.commons.digester.RuleSet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.newInstance0(Class.java:326) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583) at… Read more »

sachin
Guest
sachin

Hi,
Thanks for all your efforts
I need a solutions for my problem. In my application there is a combination of last name and email id. When new users are trying to register. If user id and last name exist alredy. this shows a error message on top “You are already register, Please click on ID Reminder Link”. So i want a hyper link on this message to the reminder ID link.

How can i paste a link to other page in Struts error message

Saurabh Sinha
Guest
Saurabh Sinha

Sir,
How to Implement security or web container security for struts1.x based web Application.
please give a demo.
Thanks

Victoria
Guest
Victoria

Hi Mkyong,
How to achieve singleThreadModel in struts .. please share your ideas

Fearless Coder
Guest
Fearless Coder

I love your blog, extremely helpful for me (beginner), and easy to understand. THANK YOU SIR!!!!!!!!!!!!!!!!!!!!!!!!!!!!

pen
Guest
pen

Hi
I need client side form validation using javascript on struts(username and password should be start with same character)

ashish
Guest
ashish

Very nice website

haribabu
Guest
haribabu

this blog is very help ful sir , i am saying thanks to you for maintaining this website and you are doing the servicing for the people who are struggle for resolving the technical problems……………….

thank you very much, for doing the service………………………..

anh lê
Guest
anh lê

Thank you very much.

sharad srivastava
Guest
sharad srivastava

sir i am not able to upload an image in struts1.2. and to reteive it from database..
sir please help me out.
thanking you
regards
sharad srivastava

sumitra
Guest
sumitra

very nice.

sai
Guest
sai

Hi Frnds,
I am looking for email functionality in java using JMS.
1)In which i need to send as html email template(image).
2)How/where to capture the mail that is send successfully or failed.

Waiting for your valuable reply ASAP. Thanks in advance.

Anish
Guest
Anish

hi
i want to fill radio button in struts application according to database gender value.
i try so much but cant get proper output can some buddy help me……..

Gourab
Guest
Gourab

Hi i am getting the problem that ${} tag is nor working on server. Our server has tomcat 5. I tried many way but it not working. Can you help me?

${x1}

tran
Guest
tran

i am beginning java, i want create maven project, but i need struct2+spring+sitemesh. so, how do i config it? could you help me!

roja
Guest
roja

i am beginner of the spring,Hibernate MySQL project
How to create Schema in MySQL,i am installing My SQL essential And My SQL Tool how can i create schema in tool

sjharaniya
Guest
sjharaniya

Help me out to display image/blob in to jsp using strts1x ?

Navya
Guest
Navya

how can we manage dymanic form elements in struts 1.2

Navya
Guest
Navya

i am new to struts 1.2 ,can you suggest how to manage form with dynamic text fields in struts

rajkumar
Guest
rajkumar

how authentication will be given in spring ……..

garima
Guest
garima

I am performing edit operation in Struts 2. How is it possible to hide the ID to be seen in the URL?