struts2.x把jsp页面放入web-inf保护起来的访问方式

JSP:
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”;
%>
<%@taglib prefix="s" uri="/struts-tags"%>











This is my JSP page.

[color=red]
link [/color]

struts.xml:

“-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”
“http://struts.apache.org/dtds/struts-2.0.dtd”>


/WEB-INF/jsp/main.jsp

IndexAction:
package aaa;

import com.opensymphony.xwork2.ActionSupport;

public class IndexAction extends ActionSupport{

public String execute() throws Exception
{
return “success”;
}
}

上一篇:

发表回复

您的电子邮箱地址不会被公开。

昵称 *