I recently upgraded Tomcat from v7.0.26 to v7.0.76 for one of my webapp. The URLs that were working earlier are not getting encoded. : gets encoded as %3A. I tried mentioning UTF-8 in the web.xml and server.xml, but the encoding is still seen. Has anyone come across a similar issue?
After investigating the tomcat changelog and trying several versions of tomcat, found that tomcat v7.0.70 has a change for this issue. The changeset is here. This change causes the URL to be encoded when you do a getRequestURI() call.
To avoid this issue of encoding, we are using Tomcat version prior to 7.0.70.
Alternatively there is a flag dispatchersUseEncodedPaths which can be used to enable/disable this encoding that was introduced in tomcat v7.0.70.
Related
I have services developed using Spring Boot 2.2.4 which takes POST parameters as input. The problem is that if I input a string having any special symbols i.e. Copyright symbol or Trademark symbol it works fine with Windows system but when deployed on k8s, it changes to '?' symbol. I tried setting the #Consumes with charset UTF-8, setting the spring properties:
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled= true
spring.http.encoding.force= true
Still the problem persists. I am not sure if this is an encoding problem or some other configuration problem with Linux/ SpringBoot.
I'm having trouble finding in the documentation for Wildfly how to get Tapestry to redirect to my Index.tml page. This file is located in the root of my war file. However, when I try to access my localhost I get a blank page that only says "Not Found".
Has anyone run into a similar problem when switching from Tomcat to Wildfly and how did you get around this? Thanks!
There is a "problem" to make tapestry working on jboss (wildfly is a jboss starting from version 8). The point is tapestry uses own classloader to support update classes on fly but it can't find own classes in jboss/wildfly.
check out https://wiki.apache.org/tapestry/HowToRunTapestry5OnJBoss7Dot1 , if Wildfly is not changed too much from last jboss version then it could work.
If not then it could be a good starting point in looking solution.
Good luck.
P.S: Also http://wiki.apache.org/tapestry/Tapestry5HowTos could help.
P.P.S.: for case if code in wiki is broken you can use mine version of the class
codeshare.io/EqbZg (do not have reputation to post more then two links)
The index.tml should not live in the package "com.example.app.pages", depending on what you specified in the web.xml (tapestry.app-package)
I am developing a simple web service using Eclipse Java EE IDE for Web Developers : Version: Kepler Service Release 2 Build id: 20140224-0627 and Wildfly-8.2.0.Final. I chose wildfly-javaee7-webapp-blank-archetype using Maven and started development. Firstly, there was no problem, I could add some simple jsp pages and also a simple html page with some images and javascript inclusion then I could deployed, launched and accessed those pages by browser. But all of a sudden, Wildfly (I guess Undertow maybe?) started to response with HTTP response 200 with no content... I really don't get what is going on. I also did rollback my sources to the very early simple pages only. But still the symptoms are the same. Also I have tried to use newer version of Wildfly-9.0.1.Final and deployed manually but I haven't seen any difference.
ex1) this is ok. (Of course browsers take care of this...)
ex2) this kind of contents won't be loaded and sent back as content 0...
I doubted local path issue but I haven't changed anything and it was loaded earlier.
It would be really appreciated if somebody could give me a solution.
Finally I have solved this problem. I have found a problem on a servlet I have added at last. Actually I was trying to migrate my web service running on glassfish and did migrate files one by one. I specified a URL to be handled by the servlet in Web.xml when it run on glassfish. But somehow, it's not working on Wildfly which means all URL request are unexpectedly handled by the servlet... Since I have no idea to specify url to be handled by the specific servlet in Web.xml for Wildfly, I decided to filter request URL in the servlet code. So it is working now. Thank you guys trying to help me...
I'm moving old GWT app from one server to another. Both in Eclipse and on old Tomcat everything is working OK, but on new server GWT app gets loaded (so the server is working and serving files), but fails on RPC call returning 404.
My admin and I have looked at possible differences in context paths, Tomcat and Java versions, and tried to recreate config on the new server as close as possible but it seems that we're missing something so I'm looking for fresh ideas.
As mentioned on this link under common pitfalls, it indicates that web.xml is misconfigured, but this is ruled out as the same web.xml works OK on old server. My #RemoteServiceRelativePath is "app.rpc" and in web.xml this is mapped to:
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.rpc</url-pattern>
</servlet-mapping>
...and in dispatcher servlet this is mapped to a correct controller. I can also give server.xml or any other part of config if needed, but I'm looking for other things that could be incorrect.
Solved it, but by going nuclear and copying the exact same Tomcat and Java version with the same paths and all settings as on the old server. What I do know is that it was not a network problem, and that the request was received by Tomcat but never got to GWT or application code; so either Tomcat (5.5 in original configuration, 6.0 in the) or Spring (2.0.2) is the culprit. This is the old application that won't be updated and is due to be replaced and I hope it dies a quick and painless death.
I have a problem with GET request on my form and UTF-8.
UTF-8 and arabic character work fine in my web application developed by spring mvc + hibernate except with Get request in my form (post request work fine)
<form:form method="get" .... >
in controller i got character like this ÙÙسÙ
I read that i have to put URIEncoding="UTF-8" on <Connector> in server.xml i try it when i deploy my project and it's work but with eclipse i can't found this file because i'm in developing level, even when i add this line in server.xml in tomcat directory but tomcat in eclipse seems not be affected with these changes even if i change the http port !
The problem is solved i was editing the wrong file, actually in eclipse the file server.xml can be found in Servers section in Projects explorer
Because eclipse use a tomcat instance not the original tomcat.
So you have to add URIEncoding="UTF-8" on <Connector> in server.xml and the get request work fine with arabic character.