广州北大青鸟计算机职业培训学校
互联网技术培训、软件技术培训、大数据培训、云计算培训、数据分析培训信息网
当前位置:网站首页 > 软件教程 > Java技术 > 正文

惠州struts2如何修改默认后缀?_北大青鸟IT学校

作者:邓华发布时间:2021-06-11分类:Java技术浏览:836


导读:Java是现在非常主流的编程语言之一,很多人想转行学习Java。那么,struts2如何修改默认后缀?下面就让我们一起来看看惠州北大青鸟老师是怎么回答的。

Java是现在非常主流的编程语言之一,很多人想转行学习Java。那么,struts2如何修改默认后缀?下面就让我们一起来看看惠州北大青鸟老师是怎么回答的。

struts2修改默认后缀的3种方法 -= 方法一:在web.xml中配置

  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">



  3.   <filter>

  4.     <filter-name>struts2</filter-name>

  5.     <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>

  6.     <init-param>

  7.         <param-name>struts.action.extension</param-name>

  8.         <param-value>action,do,</param-value>

  9.     </init-param>

  10.   </filter>

  11.   <filter-mapping>

  12.     <filter-name>struts2</filter-name>

  13.     <url-pattern>/*</url-pattern>

  14.   </filter-mapping>



  15. </web-app>

方法二:在struts.xml中配置

  1. <?xml version="1.0" encoding="UTF-8" ?>

  2. <!DOCTYPE struts PUBLIC

  3.     "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"

  4.     "http://struts.apache.org/dtds/struts-2.3.dtd">



  5. <struts>

  6.     <constant name="struts.action.extension" value="do,action,"></constant>

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



  8.     </package>



  9. </struts>

方法三:在struts.properties中配置

struts.action.extension=do,action,,

想了解更多关于Java的资讯,可以来惠州北大青鸟新方舟校区了解一下。

java6.png

Java

标签:惠州计算机JAVA软件开发惠州计算机Java软件开发惠州计算机JAVA培训惠州计算机JAVA软件开发学校惠州计算机Java软件开发培训JAVAJava软件开发北大青鸟IT计算机学校北大青鸟IT软件学校北大青鸟IT学校


Java技术排行
标签列表
网站分类
文章归档
最近发表