struts2-json-plugin 相关问题


Struts2下载文件名日文无法显示

我的struts2应用程序遇到一个问题。我使用struts2标签编写了下载程序。当下载文件名写的是英文时,我的程序没问题。(例如sample.xls)。但是我将文件名更改为...


通过 github 操作创建 EC2 AMI 时出现错误:exec: "session-manager-plugin": $PATH 中找不到可执行文件

==> learn-packer.amazon-ebs.ubuntu:exec:“session-manager-plugin”:在 $PATH 中找不到可执行文件 learn-packer.amazon-ebs.ubuntu:启动 portForwarding 会话“Amy-


Maven-shade-plugin 检测到某些类文件存在于两个或多个 JAR 中

我正在尝试使用 maven-shade-plugin,但收到警告: javafx-controls-18.0.1-win.jar,javafx-graphics-18.0.1-win.jar, javafx-media-18.0.1-win.jar、javafx-web-18.0.1-win.jar 定义 1 覆盖...


多次`maven-jar-plugin`执行导致编译问题

我有一个多模块Maven项目: 项目根目录 模块:主应用程序 模块:附加模块 - 取决于主应用程序 我正在使用 maven-jar-plugin 来编译额外的 JAR 文件


Struts 2 与 Apache Shiro 集成时如何显示结果页面

使用: struts2 2.5.10, 春天 4.x, struts2-spring-插件2.5.10, 希罗1.4.0, Shiro-Spring 1.4.0。 网络.xml: 使用: struts2 2.5.10, 春季 4.x, struts2-spring-插件2.5.10, 四郎1.4.0, shiro-spring 1.4.0. web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <init-param> <param-name>targetFilterLifecycle</param-name> <param-value>true</param-value> </init-param> </filter> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <!-- shiro filter mapping has to be first --> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> beanx.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd "> <bean name="loginAction" class="example.shiro.action.LoginAction" > </bean> <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager" /> <property name="loginUrl" value="/login.jsp" /> <property name="filterChainDefinitions"> <value> /login.jsp = authc /logout = logout /* = authc </value> </property> </bean> <bean id="iniRealm" class="org.apache.shiro.realm.text.IniRealm"> <property name="resourcePath" value="classpath:shiro.ini" /> </bean> <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> <property name="realm" ref="iniRealm" /> </bean> <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/> </beans> struts.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name="default" extends="struts-default"> <action name="list" class="loginAction" method="list"> <result name="success">/success.jsp</result> <result name="error">error.jsp</result> </action> </package> </struts> index.jsp: <body> <s:action name="list" /> </body> login.jsp 看起来像: <form name="loginform" action="" method="post"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr> <td>Username:</td> <td><input type="text" name="username" maxlength="30"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" maxlength="30"></td> </tr> <tr> <td colspan="2" align="left"><input type="checkbox" name="rememberMe"><font size="2">Remember Me</font></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Login"></td> </tr> </table> </form> LoginAction.list(): public String list() { Subject currentUser = SecurityUtils.getSubject(); if(currentUser.isAuthenticated()) {System.out.println("user : "+currentUser.getPrincipal()); System.out.println("You are authenticated!"); } else { System.out.println("Hey hacker, hands up!"); } return "success"; } shiro.ini: [users] root=123,admin guest=456,guest frank=789,roleA,roleB # role name=permission1,permission2,..,permissionN [roles] admin=* roleA=lightsaber:* roleB=winnebago:drive:eagle5 index.jsp、login.jsp、success.jsp放在webapp下 我想要的是:输入LoginAction.list()需要进行身份验证,如果登录成功,则运行LoginAction.list()并返回"success"然后显示定义为Struts操作结果的success.jsp。 现在登录成功后可以执行LoginAction.list(),但是success.jsp不显示,浏览器是空白页面。 为什么? 我找到了原因:我在index.jsp中使用了<s:action name="list" />,但是struts文档说如果我们想用<s:action>看到结果页面,那么我们必须将其属性executeResult设置为true,即就像<s:action name="list" executeResult="true"/>。 在我看来,这有点奇怪,这个属性默认应该是 true。 有一个示例,您应该如何使用 Shiro applicationContext.xml 进行配置: <property name="filterChainDefinitions"> <value> # some example chain definitions: /admin/** = authc, roles[admin] /** = authc # more URL-to-FilterChain definitions here </value> </property> 以 /admin/ 开头的 URL 通过角色 admin 进行保护,任何其他 URL 均不受保护。如果 Struts 操作和结果 JSP 不在受保护区域中,则会显示它们。


Jenkinsfile / recordIssues 从文件创建“过滤器”数组

我们使用“Warnings Next Generation Plugin”中的 recordIssues 来可视化 Trivy-Dockerimage-Scanner“aquasec/trivy”生成的结果。这个工具可以...


未找到巢/招摇

错误“@nestjs/swagger/plugin”找不到插件! 启动我的 Nestjs 项目时出现此错误。我不知道出了什么问题。 Nestjs/swagger 包已安装。


如何解决Eslint插件歧义?

我有一个 eslint 配置,它扩展了其他一些配置。这些包依赖于“@typescript/eslint-plugin”,但它们使用不同的版本。 扩展:['airbnb', 'airbnb-typescript', '@some-p...


Json使用内部 JsonString 解码 json

我有下一个要解码的 Json 字符串 [{ “材料 ID”:1193, “材料代码”:“AN00000211”, “material_name”:“玛格丽塔披萨”...


如何停止maven输出“[警告]配置选项'appendAssemblyId'设置为false。”?

我有一个生成jar的maven项目,但没有附加maven-assemble-plugin的appendAssemblyId。 如何让 Maven 停止发出警告:“配置选项‘appendAssemblyId’已设置...


Laravel 10 Vite“npm run build”创建空文件

由于某种原因,运行该命令时,某些脚本会编译,而某些脚本的内容会被“删除”。这是我的 vite.config.js 文件: 从“laravel-vite-plugin”导入 laravel; 导入vu...


Maven:无法找到或加载主类

我制作了第一个 Spring 应用程序,现在我需要将其打包到 jar 文件中进行部署。在 pom.xml 中,我指定了 maven-jar-plugin 以便自动创建清单文件......


角度项目中的json服务器

在我的角度项目中,我希望使用json-server。安装json服务器后,使用此代码“json-server --watch db.json”创建db.json文件。然后给出此错误。 文件:///C:/用户/...


Kotlin/Spring Boot 应用程序无法使用 Docker 在 Maven 中构建

我正在尝试为 Kotlin/Spring Boot 应用程序构建一个映像。但是当我运行 docker build 时出现以下错误: [错误] 无法执行目标 org.jetbrains.kotlin:kotlin-maven-plugin:1.7.20:


来自有序字典的Python Json

我正在尝试创建一个嵌套的 Json 结构,如下所示: 示例 Json: { “id”:“德”, “密钥”:“1234567”, “来自”:“[email protected]”, “过期”:“2018-04-2...


如何修复“在索引 0 处找到带有非文字参数的 fs.readFile”?

我正在尝试在 TypeScript 项目中添加 eslint-plugin-security。然而,对于这些代码 从 'fs' 导入 { Promise as fsp }; 从 'fs' 导入 fs; 从“路径”导入路径; 常量索引=等待...


如何在SQL中更新Json字符串

我有这个 JSON 字符串: [ { "名称": "TG名称", “价值”: ”” }, { “姓名”:“ISD”, “值”:“{\”WC\...


无法从数组中找到json路径

我是 JSON 新手。我有一个 LossHistory Json,我需要从中过滤出等于“General Liab - Excess”的“LineOfBusinessCode”,我需要显示特定的“Lossyear&qu...


Apache Superset 在 MySQL JSON 字段方面遇到问题

我有一个 MySQL 数据库,其中的记录包含 JSON 类型字段。 JSON 类型字段的示例是 {.... “callAttributes”:{“teamId”:“红色”,“operatorId”:&...


添加plugin:@typescript-eslint/recommended-requiring-type-checking后,提示tsconfig中未包含该文件

我用 npx create-react-app my-app --template typescript 创建一个项目,然后我向其中添加打字稿类型检查,但我的 App.tsx 报告以下错误: 解析错误:ESLint 已配置...


Retrofit API 出现 MalformedJsonException?

我需要发送一个json到我的网络服务,json是: { “萨拉”:{ "usuario": "%@", "对手": "%@", "atualizacao": "%@", “设备”: ”%@”, "device_tipo": "ios...


如何在c Sharp中将json字符串转换为数据表?

我有以下格式的json字符串 { “打开”: [ 3978,3856,3925,3918,3877.85,3992.7,4033.95,4012,3910,3807,3840,3769.5,3731,3646,3749, 3770,3827.9,3851,3...


如何在堆叠条上同时显示数据标签和总和

我尝试在堆叠条形图中同时显示数据标签和总和。 我使用 Chartjs-plugin-datalabels.js 来显示数据标签或总和。 上面只是带有数据标签: 以上只是机智...


无法解析 org.apache.maven.plugins 的插件描述符:maven-resources-plugin:2.4.3.. 打开 zip 文件时出错

我正在使用maven构建和编译一个spring项目,这是我收到的错误“打开zip文件时出错”。我在此处附加了 settings.xml 以表明我配置了 p...


如何解析包含多个 JSON 对象的 JSON 响应

如何解析包含多个对象的 JSON 响应 参考上面的链接,我得到多个 JSON 对象作为响应,但与上面链接中的响应不同(它接收单个数组...


OpenEdge ABL JSON 到临时表:READ-JSON

我如何将其(如下)读取到临时表中: { “参数”:{ }, "data": "{\"姓名\":\"morpheus11\",\"工作\":\"leader1221\"}&qu...


警告:尝试在已经呈现的 <UINavigationController> 上呈现 <RNNSideMenuController> <RCTModalHostViewController>

我正在使用应用内支付-react-native-plugin插件将Square支付方法集成到react native中。在 iOS 中,如果在添加新卡反应本机 p 上打开卡输入模型,则会产生问题...


如何使用webpack 5向脚本标签添加nonce属性

我使用 webpack 5 和 HtmlWebpackPlugin 来构建我的前端 SPA。 我需要向 添加随机数属性 <question vote="0"> <p>我正在使用 webpack 5 和 <pre><code>HtmlWebpackPlugin</code></pre> 来构建我的前端 SPA。</p> <p>我需要将 <pre><code>nonce</code></pre> 属性添加到 <pre><code>&lt;script ...</code></pre> 注入的 <pre><code>HtmlWebpackPlugin</code></pre> 标签中。</p> <p>我该怎么做?</p> <p>额外问题:之后我在服务之前使用此页面作为 Thymeleaf 模板。如何注入<pre><code>nonce</code></pre>值?</p> </question> <answer tick="false" vote="0"> <p>如果您使用的是 webpack 4,海里有很多鱼——只需使用任何注入属性的插件,例如 <a href="https://github.com/numical/script-ext-html-webpack-plugin" rel="nofollow noreferrer">script-ext-html-webpack-plugin</a> 或 <a href="https://github.com/dyw934854565/html-webpack-inject-attributes-plugin" rel="nofollow noreferrer">html-webpack-inject-attributes-plugin</a> </p> <p>但是,上面提到的大多数插件都不适用于 webpack 5。解决方法是使用 <pre><code>HtmlWebpackPlugin</code></pre> <a href="https://github.com/jantimon/html-webpack-plugin#writing-your-own-templates" rel="nofollow noreferrer">templates</a>。</p> <ol> <li>将<pre><code>inject</code></pre>中指定的<pre><code>false</code></pre>选项中的<pre><code>HtmlWebpackPlugin</code></pre>设置为<pre><code>webpack.config</code></pre>。</li> <li>在模板中添加以下代码,将所有生成的脚本插入到结果文件中:</li> </ol> <pre><code> &lt;% for (key in htmlWebpackPlugin.files.js) { %&gt; &lt;script type=&#34;text/javascript&#34; defer=&#34;defer&#34; src=&#34;&lt;%= htmlWebpackPlugin.files.js[key] %&gt;&#34;&gt;&lt;/script&gt; &lt;% } %&gt; </code></pre> <ol start="3"> <li>在 <pre><code>script</code></pre> 中添加所有必要的属性。百里香示例:</li> </ol> <pre><code> &lt;% for (key in htmlWebpackPlugin.files.js) { %&gt; &lt;script type=&#34;text/javascript&#34; defer=&#34;defer&#34; th:attr=&#34;nonce=${cspNonce}&#34; src=&#34;&lt;%= htmlWebpackPlugin.files.js[key] %&gt;&#34;&gt;&lt;/script&gt; &lt;% } %&gt; </code></pre> <p>基于 <a href="https://github.com/jantimon/html-webpack-plugin/issues/538#issuecomment-270340587" rel="nofollow noreferrer">github 帖子</a></p>的答案 </answer> </body></html>


.Net core Web API 将 json/model 值设置为 NULL

我有一个 .Net core Web API,它接受以下 JSON:(RequestModel) { “isSpecimen”:正确, “形式”: { “网络”:{ “abc1...


我们如何在golang中将json文件读取为json对象

我在本地计算机上存储了一个 JSON 文件。我需要在变量中读取它并循环它以获取 JSON 对象值。如果我在使用 io 读取文件后使用 Marshal 命令...


反序列化 JSON 返回 null C#

我有以下 JSON,我正在尝试反序列化。 { “输出参数”:[ { “价值”:{ “大批”:{ “元素”:[ { “字符串”:{...


如何单独渲染 JSON 数组中的各个项目?

我的 JSON 文件如下所示: { “id”:“abc”, "标题": "标题1", "封面": "https://example.tld/pic0.jpg", ...


如果 SQL 中不存在键,如何将键和值添加到 JSON

我输出 json 作为 声明 @ouptputJson nvarchar(max)='[ { “名称”:“BSData”, “价值”: ”” }, { “名称”:“ISData”, ...


在postgres中的json对象中搜索多个随机命名的子键

假设我有 json 列,如下所示: - 第一排: { “A”: { "x": {"name": "ben", "success": true}, &


“Pinia”类型的参数不可分配给“Plugin<[]>”类型的参数

我不知道 VueJS 想要从我这里得到什么。我在项目中使用打字稿。 我正在尝试将 Pinia 连接到 VueJS 项目。打字稿发誓。 我尝试为该应用程序制作一个插件,但没有成功


为什么每次我尝试将应用程序从 Anypoint Studio 部署到 CloudHub 时,我的 pom.xml 文件都会更新?

我的 pom.xml 文件中有以下部分用于我正在执行的虚拟项目: org.mule.tools.maven mule-maven-插件 我正在做的一个虚拟项目的 pom.xml 文件中有以下部分: <plugin> <groupId>org.mule.tools.maven</groupId> <artifactId>mule-maven-plugin</artifactId> <version>${mule.maven.plugin.version}</version> <extensions>true</extensions> <configuration> <classifier>mule-application</classifier> </configuration> </plugin> 每当我尝试直接从 Studio 将应用程序部署到 CloudHub 时,上面的部分就会更改为以下部分: <plugin> <groupId>org.mule.tools.maven</groupId> <artifactId>mule-maven-plugin</artifactId> <version>${mule.maven.plugin.version}</version> <extensions>true</extensions> <configuration> <classifier>---- select project type ----</classifier> </configuration> </plugin> 然后部署失败并出现以下错误: Publication status: error [INFO] ------------------------------------------------------------ [INFO] Steps: [INFO] - Description: Publishing asset [INFO] - Status: error [INFO] - Errors: [The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.] [INFO] ......................................... [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:33 min [INFO] Finished at: 2024-01-08T14:11:31+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.mule.tools.maven:exchange-mule-maven-plugin:0.0.17:exchange-deploy (default-exchange-deploy) on project super-biodata-sapi: Exchange publication failed: Publication ended with errors: [The asset is invalid, Error while trying to set type: app. Expected type is: rest-api.] -> [Help 1] 这可能是什么原因? 以下是一些细节: Anypoint Studio版本:7.16.0 Maven版本:3.8.8 Mule 运行时版本:4.4.0 Mule Maven 插件版本:3.8.0/4.0.0(两者都尝试过) Java版本:OpenJDK 11.0.9 我以前使用过 Anypoint Studio 7.15,在那里完全相同的项目没有任何问题。但更新后,我遇到了很多问题。 我还尝试使用“rest-api”而不是“mule-application”。然后,首先在部署开始时,“rest-api”更改为“mule-application”,然后再次更改为“----选择项目类型----”,最后失败。 我怀疑存在混乱。您提到您正在尝试将 Mule 4 应用程序部署到 CloudHub,但对资产的引用和错误消息与将资产发布到 Any point Exchange 相关。 CloudHub是一个部署和执行Mule应用程序的云平台。 Anypoint Exchange 是资产存储库,包括 REST API 的定义,但不包括 Mule 4 应用程序,也不用于执行任何操作。有关有效资产的详细信息,请参阅文档。 由于 mule-application 不是发布到 Exchange 的有效资产类型(对于 Mule 4),那么 Studio 似乎试图让您更改为有效的资产类型。 如果您尝试部署到 CloudHub,请参阅文档了解不同的方法。


如何检查 fetch 的响应是否是 javascript 中的 json 对象

我正在使用 fetch polyfill 从 URL 检索 JSON 或文本,我想知道如何检查响应是 JSON 对象还是只是文本 fetch(URL, 选项).then(响应 => { // ...


PostgreSQL 数据库中 JSON 数据的 WHERE 条件

我有一个 PostgreSQL 数据库,其中包含 6 行 JSON 数据: 从 js.orders 中选择 *; 回报 编号 |信息...


JSON 文本格式不正确。在位置 0

我是 SQL 中的 JSON 新手。我收到错误“JSON 文本格式不正确。在位置 0 处发现意外字符“N”。”执行以下操作时 - 声明 @json1 NVARCHAR(4000) 设置@


是什么原因导致 JsonException: JSON 值无法转换?

C# 10 / .NET 6 / System.Text.Json 我正在使用一个以 JSON 响应形式返回的 API。我正在尝试使用 System.Text.Json 将 JSON 响应反序列化为类。我收到了 JsonExce...


在golang中从struct手动创建json对象

我有一个结构可以说 类型 Foo 结构 { 字符串 `json:",omitemtpy" } 我知道我可以使用类似的方法轻松地将其转换为 json json.Marshal(Foo{}) 它会响应...


Vue3 Vite 应用:无法解析源以进行导入分析,因为内容包含无效的 JS 语法

我得到了一个使用Vite作为构建工具的Vue3应用程序。当我尝试构建应用程序时出现此错误: 但是,我确实安装了 @vitejs/plugin-vue,如我的 package.json 中所示,我相信......


如何以角度10升序对列中的JSON数据进行排序

我有一个 JSON 响应,其 teamId 从 1 到 43 [{"teamId":"1"},{"teamId":"2"},{"teamId":"3"},{"teamId":"4"},{"


执行 Dockerfile 时找不到 Json-server 命令

我正在尝试做一个 Dockerized Angular + Json-Server 应用程序,但我在设置 json-server 时遇到了麻烦,尽管我将其安装在 Dockerfile 中,但使用 docker 日志告诉我找不到


运行 json-server --watch 时出现意外错误和警告

我尝试使用 json-server,如下所示: $ json-server --watch db.json 但是,当我运行该命令时,我收到错误或警告,具体取决于我安装的版本: 1.0.0-alpha.1-1...


更新DataBricks中String列类型的JSON数据中的特定值

我在databricks目录中有一个列类型为字符串的表。它包含 JSON,我想从中更新特定值,例如“key1”。我已经使用 from_json 将其转换为 json...


如何为 JSON 数组指定 $schema

我有一个数组的 json 模式。该架构是正确的,我的数组可以根据它进行验证。现在我想在 json 中定义模式,就像我可以使用这样的对象一样: { ...


如何从嵌套的json中获取最大值

有 json 对象,我想获取 showstopinfo 的最大值: 变量数据 = [{ “信息”:[ { “票务信息”:{ “显示停止信息”:1 }...


如何在 C# 中获取没有任何空格的 JSON 格式的 WebResponse?

我尝试使用 WebRequest 调用 C# 中的 API 端点,并使用 WebResponse 来获取响应。我正在接收 JSON,但 JSON 响应充满了很多空格,我想去掉它们......


在plsql中从json数组中选择多个值

我想从 json 数组中选择值。例如: 数据在表中 数据在列名 json_col 中 { “A块”:{ “水果1”:[{ “Frt1”:“苹果...


© www.soinside.com 2019 - 2024. All rights reserved.