java.lang.IllegalArgumentException: URLDecoder: Incomplete trailing escape () pattern

后端 未结 2 1741
南旧
南旧 2020-12-21 02:50

I have a URL like,

http://localhost:8080/Project-war/utility/Login.jsf?fallback=%2FProject-war%2Fpublic_resources%2FShowDetails.jsf%3Fid%3D9

Thi

相关标签:
2条回答
  • 2020-12-21 03:18

    This is a bug in GlassFish4.

    There's no way to solve this problem from the webapp side on. Not with a Filter, not with a ServletRequestListener, not with a ServletContainerInitializer, even not with a GlassFish-specific GlassFishValve. The one responsible for determining the request parameter and thus triggering this GlassFish bug, Weld, is initialized very early in GlassFish's startup in GlassFish's own WebConfigListener. Due to this tight-coupling of GlassFish and Weld, there's no way to run some code before Weld's ServletRequestListener, the WeldListener, gets triggered. If it were possible, then you could just call request.getParameterMap() inside a try-catch before delegating.

    Your best bet is reporting this as another issue to GlassFish. However, as Oracle has stopped with commercial support for GlassFish, you shouldn't expect new open source GlassFish releases soon. These days, you'd better grab WildFly (Oracle/JBoss minded and already Java EE 7 ready) or TomEE (Apache minded, but not Java EE 7 ready yet) as alternative to open source edition of GlassFish. Those servers are smart enough to just skip this kind of corrupted request parameters and merely log a warning instead of throwing an IllegalArgumentException which kills the entire web application.

    0 讨论(0)
  • 2020-12-21 03:21

    Don't put the return URL in the query string. Embed it in the page, or put it in a session variable (cookie).

    0 讨论(0)
提交回复
热议问题