|
|
|
| HOME | J2ME | Struts | AJAX | SOAP | SOA | MEDIA STREAMING | AXIS | | |
|
|
Struts for Beginners: Hello World ProgramBack | Tutorial Home | Next Lets follow the conventions and kick start the coding with a Hello World program. HelloWorld.java
HelloWorld extends Action class which is the is a class which manipulated the Model. Here Models like request parameters, Java Beans can be manipulated. Action class has a method called execute() which needs to be overridden in your program to make state changes to the Model.
ActionMapping: This object holds all the mappings regarding this particular
action like paths, forwards etc. Lets have a closer look at the action-mapping, We have just seen the HelloWorld class where the request is forwarded to hello. Hello here is alias to helloWorld.jsp <action-mappings> Write a simple JSP file(helloWorld.jsp) which displays Hello World. Place this file in the salsa-tutorial folder in webapps.
<html> Deploy and run your first Struts program using URL http://localhost:8080/salsa-tutorial/helloWorld.do. if the browser displays HelloWorld then you have just successfully written your first Struts program. The picture below shows the flow of your program
We will update this picture as the tutorial progresses. Back | Tutorial Home | Next site comments powered by Disqus |
|
| toolbar powered by Conduit |
|
| Copyright © 2009. All rights reserved | Terms and Conditions | About | Contact | Feed Back | |