zoukankan      html  css  js  c++  java
  • UIAction 公共界面访问控制(拦截控制)

    这是struts中的公共页面jsp访问控制action,其基本思路就是通过使用通配符的方式控制拦截jsp。它是struts的核心之一:其中用到了几个struts默认的值:1.action默认是继承ActionSupport的,2.默认的访问方法是execution(),3.默认的返回值是success。详细看源码:struts.xml中配置:

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
        "http://struts.apache.org/dtds/struts-2.3.dtd">
        <struts>
        <!-- 开发模式,如果为true会报错 -->
        <constant name="struts.devMode" value="true" />
        <!-- 1.2标签主题,简单风格 -->
        <constant name="struts.ui.theme" value="simple"></constant>    
    <!-- 2.1配置公共UI访问 -->
        <package name="common" namespace="/" extends="struts-default">
            <action name="uiAction_*_*">
                <result>/WEB-INF/pages/{1}/{2}.jsp</result>
            </action>
        </package>    
    View Code

    页面使用:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>CRM系统</title>
    </head>
    <frameset rows="90,*" framespacing="0px" frameborder="no">
        <frame src="${pageContext.request.contextPath}/uiAction_frame_top" scrolling="no"/>
        <frameset id="main" cols="170,9,*" framespacing="0px" frameborder="no" >
            <frameset rows="30,*,40" framespacing="0px" frameborder="no" >
                <frame src="${pageContext.request.contextPath}/uiAction_frame_left1" scrolling="no"/>
                <frame src="${pageContext.request.contextPath}/uiAction_frame_left" scrolling="no"/>
                <frame src="${pageContext.request.contextPath}/uiAction_frame_left2" scrolling="no"/>
            </frameset>
            <frame src="${pageContext.request.contextPath}/uiAction_frame_control" scrolling="no"/>
            <frame src="${pageContext.request.contextPath}/uiAction_frame_right" name="right" scrolling="yes"/>
        </frameset>
    </frameset>
    </html>

    学习记录笔记,方便以后查看。

  • 相关阅读:
    react-flux的使用(2018/12/16)
    react-redux 的使用*(2018/12/17)
    小程序推送消息(Template)
    小程序富文本照片左右滚动
    前端自动化工具
    拾色器前端工具
    微信小程序 摇一摇
    小程序在线阅读文档
    配置JDK环境变量
    小程序 获取前几名加样式
  • 原文地址:https://www.cnblogs.com/ggr0305/p/6573964.html
Copyright © 2011-2022 走看看