This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Problem in running struts application. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in running struts application." Watch "Problem in running struts application." New topic
Author

Problem in running struts application.

Srikanth Ramineni
Greenhorn

Joined: Mar 18, 2010
Posts: 3
Hi ,
I worked on Struts 1.1 version 2 years back. I am familiar in working with an already existing project but am not sure on how to create one new Struts project and get it running.
I need some guidance from you experts here please. I am trying to work on a sample application that logins and redirects to Welcome.jsp page or Sorry.jsp .


Here are the steps that i followed for creating the project.

1) I am using Eclipse IDE (galileo version), Tomcat 6.0, Struts 2.0.14 versions. I downloaded them .
2) Created a Dynamic Web Project.
3) I have created Login.jsp , Welcome.jsp, Sorry.jsp in WebContent folder.
4)LoginAction.java, LoginForm.java and ValidateUser.java in src folder.
5)Created struts-config.xml in WEB-INF and updated entries correctly as shown in the snapshot.
6)updated web.xml.
7)Added the required jars into the classpath.

These are the steps that i have followed and i think i am correct till here.

Now how should i run this application ?

do we need to do some ant build and create a war file ? and then copy it to tomcat webapps directory ??
Or any other way to run it ??
I am not sure on how to run it from here on..CAn some one please point me to steps...
It would be of great help for me. Though i am familiar with most of the framework functionality, i am not able to run the application yet. It is blocking my progress.





[Thumbnail for Struts.JPG]

Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
Eclipse provide convenience that the application server can be integrated to your workspace and publish the project there on.

1. Add your Tomcat 6.0 server in your workspace.
2. Start your server.
3. Add your Web project to the server and publish the content.
Srikanth Ramineni
Greenhorn

Joined: Mar 18, 2010
Posts: 3
/////Add your Web project to the server and publish the content.

How do we add the Web project to the server? I already have tomcat added into my eclipse. I did try running the application directly by providing the url. But it is showing Error :404
Shinelin Samuel
Ranch Hand

Joined: Mar 01, 2010
Posts: 55
I believe that you have added Tomcat server to eclipse Servers view. Then, Right click and select Add and Remove projects from the menu.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You said you're using Struts 2, but everything you mention is for Struts 1--first you need to decide which version you're actually using.

Then go to the Struts 2 documentation wiki and follow the tutorial, or find another one on the net, or get a book, etc. Many of the Struts 2 books use Maven, which you may want to hold off on using for now.
Srikanth Ramineni
Greenhorn

Joined: Mar 18, 2010
Posts: 3
Can some one point me good tutorial for Struts 2.0 that will guide me from scratch to end development. Anything that you found is the best/appropriate one.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I still think the Struts 2 wiki tutorial is as good a place as any to start, although I haven't searched the web for more recent ones.
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Hi,

Try this LINK this will help you lot as it help me too.


Thanks,
Shailesh
 
Consider Paul's rocket mass heater.
 
subject: Problem in running struts application.