Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

jaladhi dave

Greenhorn
+ Follow
since Apr 26, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jaladhi dave

hello in the annotations you can replace your type with type="redirect" and you can pass this action to other jsp page.
11 years ago
How to add a licensing functionality to a java program?
11 years ago
i show you the code for your problem and you will get the idea...

Action:-

package com.stikiflem;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class ForwordAction extends ActionSupport implements SessionAware
{
private String userName;
private String password;
private Map session;

public String getUserName()
{
return userName;
}


public void setUserName(String userName)
{
this.userName = userName;
}


public String getPassword()
{
return password;
}


public void setPassword(String password)
{
this.password = password;
}

public String forword()
{
session.put("username", getUserName());
// setUserName(userName);

return "success";
}

public String execute()
{
userName=(String)session.get("username");

setUserName(userName);
setPassword(password);
return SUCCESS;
}


public Map getSession()
{
return session;
}


public void setSession(Map session)
{
this.session = session;
}

}


1st jsp page


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="ForwordAction.action">

<input type="text" name="userName"/>

<input type="submit" value="Next" id="submit"><br>

</form>
</body>
</html>

2nd jps page


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<form action="NextAction.action">

<input type="text" name="password"/>

<input type="submit" value="submit" id="submit"><br>
<s:property value="userName"/>
</form>
</body>
</html>

3rd jsp page



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<s:property value="userName"/>
<s:property value="password"/>

</form>
</body>
</html>

Struts.xml

<action name="ForwordAction" class="com.stikiflem.ForwordAction" method="forword">
<result name="success">Next.jsp</result>
</action>

<action name="NextAction" class="com.stikiflem.ForwordAction">
<result name="success">success.jsp</result>
</action>







11 years ago