[
https://issues.apache.org/jira/browse/WW-5021?focusedWorklogId=532878&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-532878
]
ASF GitHub Bot logged work on WW-5021:
--------------------------------------
Author: ASF GitHub Bot
Created on: 08/Jan/21 07:40
Start Date: 08/Jan/21 07:40
Worklog Time Spent: 10m
Work Description: lukaszlenart commented on a change in pull request #462:
URL: https://github.com/apache/struts/pull/462#discussion_r553786793
##########
File path:
core/src/main/java/org/apache/struts2/dispatcher/StaticContentLoader.java
##########
@@ -57,4 +67,32 @@
*/
void findStaticResource(String path, HttpServletRequest request,
HttpServletResponse response) throws IOException;
+ class Validator {
+
+ private static final Logger LOG =
LogManager.getLogger(DefaultStaticContentLoader.class);
+
+ public static String validateStaticContentPath(String
uiStaticContentPath) {
+ if (StringUtils.isBlank(uiStaticContentPath)) {
+ LOG.warn("\"{}\" has been set to \"{}\", falling back into
default value \"{}\"",
+ StrutsConstants.STRUTS_UI_STATIC_CONTENT_PATH,
+ uiStaticContentPath,
+ StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH);
+ return StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH;
+ } else if ("/".equals(uiStaticContentPath)) {
+ LOG.warn("\"{}\" cannot be set to \"{}\", falling back into
default value \"{}\"",
+ StrutsConstants.STRUTS_UI_STATIC_CONTENT_PATH,
+ uiStaticContentPath,
+ StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH);
+ return StaticContentLoader.DEFAULT_STATIC_CONTENT_PATH;
+ } else if(!uiStaticContentPath.startsWith("/")) {
Review comment:
fixed!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 532878)
Time Spent: 1.5h (was: 1h 20m)
> Serve static resources from different path
> ------------------------------------------
>
> Key: WW-5021
> URL: https://issues.apache.org/jira/browse/WW-5021
> Project: Struts 2
> Issue Type: Task
> Affects Versions: 2.5.20
> Reporter: k918912
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 2.6
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> Is it somehow possible to serve the static Struts files from a different path?
> Currently domTT.js is loaded via /struts, but in my environment I would like
> to serve it via /test/struts for example. Is there any configuration I'm
> missing or is this currently not possible?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)