java - Unexpected GET values with different URLs -


the idea pass smb file url or normal website url parameter spring web mvc controller. there issues correct output:

get values:

as can see second , fourth url examples not work, question:

  • how can handle second example? correct output should www.google.com.
  • what happens during fourth example?

setup information: ubuntu 14.04 lts x64 , tomcat 8 used

java

@requestmapping(value="/document/test/{url}", method=requestmethod.get) public string test(@pathvariable string url, model model) throws ioexception {     model.addattribute("url",  url);     return "test"; } 

html

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <!doctype html> <html>     <head>     </head>     <body>         <p>value: ${url}</p>     </body> </html> 

change request mapping below:

@requestmapping(value="/document/test/{url:.+}", method = requestmethod.get) 

and 4th url not working need encode %. please find below encoded url:

http://localhost:8080/gradle-spring-mvc-web-project/document/test/%255c%255csmbserver%255caccounts%255ctestaccount%255cwas_muessen_programme_verarbeiten.docx


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -