I have a Spring Controller to handle 404 - the Controller's RequestMapping URI is configured to handle 404 errorCode in web.xml.
I'm using embedded Jetty Server for testing. There's no web.xml file. How can I configure the Jetty server to redirect 404 to my Controller? I've looked at Jetty ErrorHandler, but I'd like to configure and test out my 404 Controller. Is it possible?
Thanks.
Related
We have a Java/Jetty server. The servlets on this server are called by some of our internal applications over http.
I have been asked to create a webapp /website which will use many of these servlets / api.
However this is an external customer facing website and needs to be served over https / ssl. The servelet urls look like
http://internalServer:9999?parameters.
Now my webapp is ready and has been deployed on Apache on Debian. Everything works fine but as soon as I enable
https/ssl the backend calls do not go through. On chrome I get "Mixed content. Page was loaded on https but is requestig resource over http...". On Safari I get -could not load resource due to access control checks.
I understand the reasons for these errors but I would like to know ways to solve this.
I have full control over apache server and website code.
I have very limited control over internal jetty server and no control over servelt code.(don't want to mess with existing apps).
Is there something I can do just with apache configuration? can I use it as a reverse proxy for the Jetty(http) server?
Thanks for your help.
"Mixed content. Page was loaded on https but is requestig resource over http..."
That error message means your HTML has resources that are being requested over http://... specifically.
You'll need to fix your HTML (and any references in javascript and css) that request resources (or references resources) to also use https://....
If you try to call an http service from an https site you will have Mixed content error.
You can avoid that error using apache2 proxy settings inside your example.org.conf
You can find it inside the folder /apache2/sites-enabled
Add some code:
<VirtualHost *:443>
...
ProxyPass /service1 http://internalServer:9999
ProxyPassReverse /service1 http://internalServer:9999
</VirtuaHost>
From your https site you have to fetch the url
https://example.org/service1`
to reach the service.
In that way you can call your services http from a https site.
i have IHS 7 installed on an AIX system and its pointing to Application Server . now my requirement is if Application is not accessible or if we are working on the Application it self then whoever access the URL, it redirects to a custom page on the webserver that Application is under construction .
for example url is https://my.Application.com:8089/application if anyone hits this URL then this URL is redirected to custom URL on same webserver https://my.webserver
i have configured a proxy on IHS httpd.conf but it is not working
The good practice in such case is to create two config files and one maintenance page. When your app server do not work you should restart http server with config file which point to the maintenance page.
I have an ASP.NET Core 2.1 WebAPI project with Swashbuckle.AspNetCore 3.0.0. It has a domain xx.xx.com and a dynamic subdomain /something rewritten to / in my reverse proxy.
I've configured the UI to use a relative path with:
c.SwaggerEndpoint("v1/swagger.json", "MY API V1");
The problem is the methods are called in the root of the domain instead of with a relative path and I get error 404 for all "Try it out"s.
It calls xx.xx.com/method instead of xx.xx.com/something/method.
Is there a way to overcome this issue without changing the reverse proxy behavior?
I want to hit restfull api inside tomcat valve. I create tomcat valve successfully using this link [How to create tomcat valve ][1]
[1]: Verify header before request receive in tomcat .Now i want to authorized headers inside valve. In my application There is restful web service for authorized token. I used spring rest template for hit webservice but when i restart tomcat when is show me error multivaluedmap class not found ,but same code run in simple java application.After this I used Apache http client for hit rest web service (code is ok) . But when i restart tomcat there is again exception : java.lang.NoClassDefFoundError: org/apache/http/client/ClientProtocolException
I simple want to authorized header inside tomcat valve so anyone can suggest to me how can i hit restfull api inside tomcat valve.
I think you should try with tomcat class loader .These Exception occur when these class not loaded. So you should load these class on runtime with the help tomcat class loader.
java.lang.NoClassDefFoundError:
org/apache/http/client/ClientProtocolException
It means this class not found . You should be add required jar files in tomcat.It is helpful for loading the class on runtime.
Hi I have rest web services running on tomcat. I'm trying to get wadl generated. What I read is that I just need to type url: http://ip:8080/application.wadl and it will be generated. However all I get is 404 status.
If my deployed war name is ABC for example I'm also trying to execute: http://ip:8080/ABC.wadl, but again 404.
Any idea what I'm doing wrong?
It really does depends on the framework that is mediating between Tomcat and your implementation classes. For example, with Apache CXF you get the WADL for a service by fetching http://example.com:8080/ABC?wadl (this is in the simplest case where your webapp is deployed as ABC and the root RESTful resource is served by the root of the webapp).