DISQUS

Dreamz: Create Struts 2 - Hello World Application

  • Veerasundar · 1 year ago
    Atul,

    Open the Manager console in Apache Tomcat server and see the status of the struts application. If it is false, then the web application is not deployed correctly and some problem with the application WAR itself. If it is the error with any Java files, then the IDE would have shown at the compilation time itself, but if there is any error with web.xml or struts.xml, then IDE won't show any errors, but application won't be deployed in Tomcat. Please check if there is any syntax error with xml files.
  • Amit Pandey · 1 year ago
    Excellent starting point buddy. You are right, existing examples are pretty confusing. Your article is simple, precise. Thanks
  • Veerasundar · 1 year ago
    Thanks Amit!
  • priya · 1 year ago
    Thanks a lot!!!!!!!!!!!!!!!
    was very useful.............. :)
  • Veerasundar · 1 year ago
    You are welcome, Priya!
  • Neena · 1 year ago
    Thanks Veerasundar. This was very helpful
  • Veerasundar · 1 year ago
    ///Thanks Veerasundar. This was very helpful//

    Thanks Neena!
  • Atul Mishra · 1 year ago
    I tried this Sample code in following Config.
    Eclipse, tomcat 5.0, jre 1.5

    I deployed this sample application WAR file into tomcat.
    I have tried to launch this by typing its url as
    http://localhost:8080/HelloWorld

    but it was showing Error as below -


    type Status report

    message /HelloWorld/WEB-INF/web.xml

    description The requested resource (/HelloWorld/WEB-INF/web.xml) is not available.
  • Veerasundar · 1 year ago
    Hi Atul,

    The error you got is possibly because of (as the error message says) the web.xml may not be present in the WAR file that you had deployed. Can you please check your WAR file to see whether the web.xml present inside the WEB-INF folder?
  • Atul · 1 year ago
    Yes this war files contents web.xml.
    i tried this example 3 - 4 time from scratch.
    but each time i get same error.
    Actually i put struts.xml file into WEB-INF folder.
    but i seen in some example it is with scr files.
    after that i tried this also but i get an error :-
    resource is not available.
    wht should i do.

    i think some libraries are required in tomcat to read and convert these xml files.
  • Mahesh · 1 year ago
    Thanks Veer, I am able to run my fist struts 2 application. That was an excellent starting point.
  • Veera · 1 year ago
    Hi Mahesh,

    Thanks for your feedback. :)
  • Anoop · 1 year ago
    thanx man,
  • prasaddvd · 2 weeks ago
    HI
    im trying to run the above program, but it is not working properly. can any one solve my problem
  • Veera · 2 weeks ago
    hi,

    can you give us more details on the error that your are getting?