http 404 errorThe origin server did not find a current representation for the target resource or is not willing to disclose that one exists

I am new to spring mvc and I have done have everything proper seeing a tutorial.But still I am facing Http 404 error -The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.why is that so?

I’m using IntelliJ IDE and tomcat server to run my code. under WEB-INF/ I have all dispatcher-servlet,jsp,web.xml file.

this is the controller class. I tried both the methods(/hello and /hi) but I’m not able to get successful results. @Controller

public class HelloController {     @RequestMapping("/hello")          public String printHello(ModelMap model) {         model.addAttribute("message", "Hello Spring MVC Framework!");         return "hello";     }     @RequestMapping("/hi")         public ModelAndView hiworld(){         ModelAndView modelAndView=new ModelAndView("hello");         modelAndView.addObject("message","hi bro its ok");         return modelAndView;     } } 

this the dispatcher-servlet.xml.

<bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver">     <property name = "prefix" value = "/WEB-INF/" />     <property name = "suffix" value = ".jsp" /> </bean> 

this is my web.xml file Spring MVC Application

<servlet>     <servlet-name>dispatcher</servlet-name>     <servlet-class>         org.springframework.web.servlet.DispatcherServlet     </servlet-class>     <load-on-startup>1</load-on-startup> </servlet>  <servlet-mapping>     <servlet-name>dispatcher</servlet-name>     <url-pattern>/</url-pattern> </servlet-mapping> 

In hello.jsp file, I am printing the message

<body> <p>$  {message}</p> </body> </html> 

expected result was the successful execution of jsp file. but I’m getting HTTP 404 ERROR-The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

PHP http request class

I would like to get you opinion on this class, which is used to send http request (at that moment only POST method ).

It is working ok, but I would like to get response on : maintainability, reusability, security, code formatting, etc…

Class HttpRequest{      private $  POST = 'POST';     private $  PUT = 'PUT';     private $  GET = 'GET';     private $  DELETE = 'DELETE';     private $  PATCH = 'PATCH';      private $  body;     private $  options;     private $  handle;     private $  httpCode;     private $  response;      public function __construct(){}       /**      * send post request      * @param url       * @param header       * @param options      * @param body      * @return json object      */     public function post($  url, $  header, $  options, $  body){         if(!$  this->handle || get_resource_type($  this->handle) == "Unknown"){             $  this->handle = curl_init();          }         curl_setopt($  this->handle, CURLOPT_URL, $  url);         curl_setopt($  this->handle, CURLOPT_HTTPHEADER, $  header);         curl_setopt_array($  this->handle, $  options);         // curl_setopt($  this->handle, CURLOPT_SSL_VERIFYPEER, true);         // curl_setopt($  this->handle, CURLOPT_SSL_VERIFYHOST, 0);         curl_setopt($  this->handle, CURLOPT_RETURNTRANSFER, true);         curl_setopt($  this->handle, CURLOPT_CUSTOMREQUEST, $  this->POST);         curl_setopt($  this->handle, CURLOPT_POSTFIELDS, $  body);         $  this->response = curl_exec($  this->handle);         $  this->httpCode = curl_getinfo($  this->handle, CURLINFO_HTTP_CODE);         curl_close($  this->handle);         return $  this->response;     }       public function getResponse(){         return $  this->response;     }      public function getHttpCode(){         return $  this->httpCode;     }      /**      * send get request      * @param url       * @param header       * @param options      */     public function get($  url,$  header=array(), $  options=array()){         /**          * @todo           * implemets this method          */     }      /**      * send patch request      */      public function patch(){         /**          * @todo           * implemets this method          */     }     /**      * send delete request      */     public function delete(){         /**          * @todo           * implemets this method          */     }     /**      * send put request      */     public function put(){         /**          * @todo           * implemets this method          */     } } 


Send a form to a HTTP server in rails using Unity

i’m trying to use UnityWebRequest to send a form to a Ruby on Rails server, but the error, HTTP/1.1 404 Not Found, keep comming.

My code is here:

public void Update_GI_Score() { StartCoroutine(Update_GI_Score_FORM()); }

 IEnumerator Update_GI_Score_FORM()  {      WWWForm form = new WWWForm();      form.AddField("myField", "myData");      Game game = Singleton.GameInstance;      foreach (Score s in game.scores)      {          form.AddField("name", s.Name);          form.AddField("value", s.rate.ToString());      }      var url = RequestController.Instance.baseURL + "atualiza_score";      UnityWebRequest www = UnityWebRequest.Post(url, form);      yield return www.SendWebRequest();      if (www.isNetworkError || www.isHttpError)      {          Debug.Log(www.error);      }      else      {          Debug.Log("Form upload complete!");      }  } 

In the rails routes i got:

post ‘atualiza_score’, controller: ‘integracao_games’, action: :atualiza_score

so how can i get the form correctly, i need to save the field into a database


HTTP Method and REST URL for Using One Object to Build Another

My application has a grid with a list of Car objects from a third party system

[{id: 1, make: "Ford", model: "Focus", ...},...] 

The user can select a Car and use its data (after some transformation) to create a Car specific to my application. The app does this by filling in a form on another HTML page with the transformed 3rd party Car data and allowing the user to modify data as needed.

When the app makes the request to retrieve the transformed 3rd party car data, should that request be a HTTP GET (even though it transformed the data (in a repeatable way))? What should the URL be using REST standard formats? I don’t think it should be /third-party/car/{id} since that is for returning the third party car as-is.

http to https redirect triggers “Duplicate without user-selected canonical”

For some reason, my Main URL ( cannot be indexed because of my domain redirects in the apache2 config.

My redirects go as follows:

  • >
  • >
  • >

The following error appears when I try to inspect my URL on the webmaster tools:
Duplicate without user-selected canonical

I understand Canonical tags are used to define duplicate pages. But I never knew it could be used in an apache redirect. At least according to Google, it can. But in this case, I don’t understand why it is during an Apache2 Redirect. No page is being generated during the redirect as it is a 301 redirect. So I cannot use a Canonical tag.

I also asked this question in the Google products forums but sadly these “Experts” apparently do not seem to know a lot regarding canonical changes Google made in October 2018.

This is my Apache2 Config for the HTTP redirect:

<VirtualHost *:80>   ServerAdmin   ServerName   ServerAlias   ServerAlias * * *    RedirectMatch 301 ^(.*)$ </VirtualHost> 

Image of the warning

Please do note that the page is indexed on google. But the metadata you see on there is about 2-3 months old and it cannot be refreshed due to this error.

The page is completely unable to index the updated page due to this.

Fazer request via FTP e retornar arquivo via HTTP

Estou desenvolvendo um blog e gostaria de utilizar recursos de um outro servidor via FTP. Afim de compartilhar alguns desses arquivos em minhas postagens imaginei que seria possível eu conectar o FTP dentro do PHP e retornar o arquivo desejado para o usuário, sem que precisasse copiar para o meu servidor PHP do blog. Daí vem as perguntas: o PHP precisaria baixar todo o arquivo antes de retorna-lo? Que método eu deveria usar da biblioteca nicolab/php-ftp-client para conseguir tal efeito?

Um exemplo mais ou menos do que penso que seria:

Route::get('files/{id_artigo}/{arquivo}', 'FTPController@pegarArquivo'); 

E dentro do método, essa seria a parte interessante, porém não sei como prosseguir:

$  ftp = FTPClient(); $  ftp->connect($  host); $  ftp->login($  user, $  passwd); // Abaixo o dummyMethod() deveria // pegar o arquivo e armazenar em $  file // NOTA: $  nome é o nome do arquivo  $  file = $  ftp->dummyMethod($  nome); return $  file; 

A strange problem about size limit in http header

Context: i maintain a kind of web service server, but with a particular implementation: all data sent by the web service are located in the http header. That means there is only http header in the response (no body part). The web service runs as a windows service. The consumer is my PHP code wich invoque the web service via CURL library. All this is in production since 3 years and work fine. I recently had to build a developpment environement. 1 – i have the web service on a windows 7 pro, as a windows service. 2 – i have my PHP consumer in another windows 7 pro (WAMP + CURL). 3 – my PHP code invoque the web service and displays the raw response. 4 – in this context the probleme occurs: if the response contains more than 1215 characters, i have an empty response (but no error message).

5 – i installed my PHP code (exactly the same) on a new linux ubuntu: i have the same problem.

6 – i installed my PHP code (exactly the same) on a new linux centos: I DON’T HAVE THE PROBLEM.

7 – i read a lot on internet about size limitation on http header, and i think today it’s not the reason of the probleme. 8 – I examined all size limitation parameters on Apache, PHP, Curl but i didn’t find somethig relevant.

If somenone has some information. All tracks are welcome. Thanks