Get a server running locally to run a Struts app

Click For Summary
SUMMARY

To run a Struts application locally, users must compile their Java Web app using Apache Ant and ensure they have access to the servlet.jar file. The process involves copying the code into flat files, compiling it, and creating a WAR file for deployment. The WAR file should be placed in the auto-deploy directory of a Java server like Tomcat, allowing the web app to be accessed via http://localhost:8080/hello/HelloWorld. Beginners are encouraged to start with a simple JSP application before progressing to Struts.

PREREQUISITES
  • Apache Ant for building Java applications
  • Servlet API (servlet.jar) for Java web applications
  • Tomcat server for deploying Java web applications
  • Basic understanding of JSP (Java Server Pages)
NEXT STEPS
  • Learn how to configure Apache Tomcat for local development
  • Explore the process of creating and deploying WAR files
  • Study the structure and syntax of JSP for web applications
  • Investigate the features and capabilities of the Struts framework
USEFUL FOR

Java developers, web application developers, and anyone interested in deploying Java web applications using Struts and Tomcat.

DaveC426913
Gold Member
Messages
24,126
Reaction score
8,249
I need to get a server running locally so I can run my 'Hello World' Java Web app.

http://benmira.free.fr/en/j2ee/struts1.htm" I'm using. Unless I misunderstand, all I really need to do is copy all the code into flat files with the appropriate filenames - and then compile it with Ant.

But how do I run it? At some point I'll need to call http : //localhost:8080/hello/HelloWorld


To compile I'm going to need access to servlet.jar. A search of my drive shows nothing except associated with the Eclipse editor, yet I've got java rle and java sdk installed. I'm obviously missing some component.
 
Last edited by a moderator:
Technology news on Phys.org
Well if nothing else you should be able to produce a war file. War is like a jar but suited for deploying on a web server. You put the war in the auto-deploy directory of the server, and when the Tomact or whatever Java server you have running it will deploy the web app from the war. Then you can access it. I would advise you to first make a simple JSP(Java Server Pages) appliaction and then go with Struts or some other web framework.
 
We have many threads on AI, which are mostly AI/LLM, e.g,. ChatGPT, Claude, etc. It is important to draw a distinction between AI/LLM and AI/ML/DL, where ML - Machine Learning and DL = Deep Learning. AI is a broad technology; the AI/ML/DL is being developed to handle large data sets, and even seemingly disparate datasets to rapidly evaluated the data and determine the quantitative relationships in order to understand what those relationships (about the variaboles) mean. At the Harvard &...

Similar threads

  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 39 ·
2
Replies
39
Views
7K
Replies
7
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 129 ·
5
Replies
129
Views
26K