Reply

Ads
 

Reply

View Answers

February 3, 2009 at 11:58 PM

HelloWorld.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Struts 2 Hello World Application!</title>
</head>
<body>
<h2><s:property value="message" /></h2>
<p>Current date and time is: <b><s:property value="currentTime" /></b>
</body>
</html>

Struts2HelloWorld.java

package net.roseindia;
import com.opensymphony.xwork2.ActionSupport;
import java.util.Date;

public class Struts2HelloWorld extends ActionSupport {

public static final String MESSAGE = "Struts 2 Hello World Tutorial!";

public String execute() throws Exception {
setMessage(MESSAGE);
return SUCCESS;
}

private String message;

public void setMessage(String message){
this.message = message;
}

public String getMessage() {
return message;
}

public String getCurrentTime(){
return new Date().toString();
}
}

struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">;

<struts>

<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />

<package name="roseindia" namespace="/roseindia" extends="struts-default">

<action name="HelloWorld" class="net.roseindia.Struts2HelloWorld">
<result>/pages/HelloWorld.jsp</result>
</action>

<!-- Add actions here -->
</package>


<!-- Add packages here -->

</struts>

Thanks
vinod

Ads









Related Tutorials/Questions & Answers:
reply must
reply must  is it critical to do a software job based on games(java) i know core java & advanced java basics only please give me answer
ModuleNotFoundError: No module named 'reply'
ModuleNotFoundError: No module named 'reply'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'reply' How to remove the ModuleNotFoundError: No module named 'reply'
Advertisements
Reply me soon.........
Reply me soon.........  Any body plzz help.....how to get d checked details from previous page to current page and den insert into table
PLease reply its urgent
PLease reply its urgent   Write a java function that has the signature ΓΆβ?¬Ε?Public static int clock Inter sections(int hours, int minutes)ΓΆβ?¬Β? That takes a number of hours and minutes (up to several days), and returns
Reply Me - Java Beginners
Reply Me  Hi deepak, your sending web application is good (alphabetical searching dropdown menu) Steps:- 1:-searching is good 2:- user click inser vtton then open the pop-up windows this is write 3
hi plzz reply
hi plzz reply  in our program of Java where we r using the concept of abstraction Plz reply i m trying to learn java ...   means in language of coding we r not using abstraction this will be used only for making ideas
Version of com.klinkerapps>wearable-reply dependency
List of Version of com.klinkerapps>wearable-reply dependency
Java Program(Please reply asap)
Java Program(Please reply asap)  Find out the ways in which numbers can be added to get the same result Example:- 10 1+9=10 1+2+3+4=10 1+9=10
ModuleNotFoundError: No module named 'gs_reply_bot'
ModuleNotFoundError: No module named 'gs_reply_bot'  Hi, My Python... 'gs_reply_bot' How to remove the ModuleNotFoundError: No module named 'gs_reply_bot' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'email_reply_parser'
ModuleNotFoundError: No module named 'email_reply_parser'  Hi, My... named 'email_reply_parser' How to remove the ModuleNotFoundError: No module named 'email_reply_parser' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'py-email_reply_parser'
ModuleNotFoundError: No module named 'py-email_reply_parser'  Hi...: No module named 'py-email_reply_parser' How to remove the ModuleNotFoundError: No module named 'py-email_reply_parser' error? Thanks   Hi
ModuleNotFoundError: No module named 'pywe-message-reply'
ModuleNotFoundError: No module named 'pywe-message-reply'  Hi, My... named 'pywe-message-reply' How to remove the ModuleNotFoundError: No module named 'pywe-message-reply' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'wagtail-contact-reply'
ModuleNotFoundError: No module named 'wagtail-contact-reply'  Hi...: No module named 'wagtail-contact-reply' How to remove the ModuleNotFoundError: No module named 'wagtail-contact-reply' error? Thanks   Hi
goto statement problem. reply fast.
goto statement problem. reply fast.  I have done some operation, and want to repeat same operation again at users choice. but its not working properly. I am using goto statement. void main() { float rs, p; char z
Maven Dependency wearable-reply >> 1.0.0
You should include the dependency code given in this page to add Maven Dependency of com.klinkerapps >> wearable-reply version1.0.0 in your project
hi see and give me reply as soon as possible
hi see and give me reply as soon as possible  Hi Friend, I got path,but it will again ask path error first i was gave index.jsp.It... be send reply soon. Thanks & Regards, N.Ramesh
Reply - Struts
please reply the code to store dynamic fields in database?
please reply the code to store dynamic fields in database?  <%@ page import ="java.sql.*" %> <%@ page import ="javax.sql.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <title>Login User<
ModuleNotFoundError: No module named 'django-rest-kakao-auto-reply'
ModuleNotFoundError: No module named 'django-rest-kakao-auto-reply'  ...: No module named 'django-rest-kakao-auto-reply' How to remove the ModuleNotFoundError: No module named 'django-rest-kakao-auto-reply' error
ModuleNotFoundError: No module named 'django-rest-kakao-auto-reply'
ModuleNotFoundError: No module named 'django-rest-kakao-auto-reply'  ...: No module named 'django-rest-kakao-auto-reply' How to remove the ModuleNotFoundError: No module named 'django-rest-kakao-auto-reply' error
Would you know answer means please send reply urgent
Would you know answer means please send reply urgent  HTTP Status 404 - /struts/HelloWorld.jsp type Status report message /struts/HelloWorld.jsp description The requested resource (/struts/HelloWorld.jsp) is not available
struts problem ... need help urgently.. please reply ASAP
struts problem ... need help urgently.. please reply ASAP  Hi Every1, I want to make an application using struts 1.2. I am a beginner on struts... depends on server or IDE. Please reply ASAP. Thanx , am2085
pls send reply - Java Beginners
Thanks for fast reply - Java Beginners
how to pass string array from action class to jsp page? pls reply me.
how to pass string array from action class to jsp page? pls reply me.  how to pass string array from action class to jsp page? pls reply me.   You can use session.setAttribute() and session.getAttribute() methods
Round Cube
Round Cube       Ajax based webmail client, has the basic functionality of the webmail (send mails, fwd, reply, folders, ...) Read full Description
Replying to messages using Java mail
;    This Example shows you how reply to message using javamail api. The Message class have a reply() method to configure a new... there. This does not add any content to the message, reply() method have a boolean
Hi
Hi  Hi How to implement I18N concept in struts 1.3? Please reply to me
java
java  reply in static method   Have a look at the following link: Java Static Method
age calculation
age calculation  pls send me the age calculation validation coding in java script. i'm waiting for ur reply
table in java
table in java  Could any one make compiler in java please reply me

Ads