activity 图片显示api的url参数“.”点儿前面被截取了

问题:

调用activity的api显示流程图片的时候,发现图片名称作为参数传入到下面的方法中,参数值只截取到了“.”前面的值。“.png”被丢掉了。导致错误。

spring版本:4.3.11.RELEASE

activity版本:5.22.0

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.activiti.engine.ActivitiObjectNotFoundException: Could not find a resource with id 'leaveWithCondition' in deployment '117543'.
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:167)
	org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
	com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:83)
	org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:122)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

org.activiti.rest.service.api.repository.BaseDeploymentResourceDataResource;类的getDeploymentResourceData方法。

url:http://localhost:8080/项目/rest/repository/deployments/117543/resourcedata/leaveWithCondition.png

117543:deploymentId

leaveWithCondition.png:resourceName

解决方法1:测试无效(原因不明)

spring中设置如下

<mvc:annotation-driven>
    <mvc:path-matching suffix-pattern="false" />
</mvc:annotation-driven>

或者追加config类。

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class MvcConfig extends WebMvcConfigurerAdapter {
	@Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setUseSuffixPatternMatch(false);//可以让URL路径中带小数点 '.' 后面的值不被忽略 
    }
}

解决方法2:测试通过

url的尾部追加一个斜杠“/”

修改前:url:http://localhost:8080/项目/rest/repository/deployments/117543/resourcedata/leaveWithCondition.png

修改后:url:http://localhost:8080/项目/rest/repository/deployments/117543/resourcedata/leaveWithCondition.png/

成功调用之后,图片在ie11下可以正常显示图片,其他浏览器edge,chrome,火狐等显示乱码。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值