package liulixin.org;
import com.opensymphony.xwork2.ActionSupport;
public class LogInOrNotAction extends ActionSupport{
public String isLogin(){
if(1==1)
return "nosir";
else
return "yessir";
}
}
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="LaiLa" class="liulixin.org.LogInOrNotAction" method="isLogin">
<result name="yessir">/pages/Login.jsp</result>
<result name="nosir">/pages/NotYe.jsp</result>
</action>
</package>
</struts>
再建立两个文件:page/Login.jsp和NotYe.jsp
输入http://localhost:8080/struts2_session/LaiLa
源代码:http://pan.baidu.com/share/link?shareid=441057&uk=3878681452