Re: spring boot rest error
Mike Barnes <mike.barnes-f9aWwpgOZj5Wk0Htik3J/[email protected]> Wed, 29 Nov 2017 08:49:02 -0800
| Newsgroups | gmane.org.user-groups.ajug.members |
|---|---|
| Message-ID | <[email protected]> |
--===============5669020107348626710== Content-Type: multipart/alternative; boundary="_1E07D32E-C3C2-4D41-AC34-AAF1A2314D61_" --_1E07D32E-C3C2-4D41-AC34-AAF1A2314D61_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Thank you everyone for your quick response. The solution that you sent me w= orked great. Mike Barnes Sent from Mail for Windows 10 From: Marc Mamane Sent: Wednesday, November 29, 2017 8:33 AM To: [email protected] Subject: Re: [ajug-members] spring boot rest error You'll need to apply regex to the request mapping.=C2=A0 See this stack ove= rflow thread for one solution. https://www.google.com/url?sa=3Dt&source=3Dweb&rct=3Dj&url=3Dhttps://stacko= verflow.com/questions/16332092/spring-mvc-pathvariable-with-dot-is-getting-= truncated&ved=3D0ahUKEwi88IrWmuTXAhUiSt8KHSP2BmQQFggoMAA&usg=3DAOvVaw1LKqww= HOyJyiIIVvL1UTkO Hope that helps! On Nov 29, 2017 11:29 AM, "Mike Barnes" <mike.barnes-f9aWwpgOZj5Wk0Htik3J/[email protected]> wrote: Can someone help me understand why I am unable to find a record when the st= ring has periods in the string (.) =C2=A0 Example: =C2=A0 http://localhost:8080/v1/security/account/name/My.Company =C2=A0 The Spring Boot rest api appears to be truncating the value when a period a= ppears. =C2=A0 In the rest log I see name=3DMy Instead of name=3DMy.Company =C2=A0 This is how I have defined the function: =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 @GetMapping(value =3D "/name/{na= me}") =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 public ResponseEntity<?> getAcco= untByName(@PathVariable("name") String name) { =C2=A0 Any help would be appreciated. =C2=A0 Thanks Mike Barnes =C2=A0 =C2=A0 Sent from Mail for Windows 10 =C2=A0 _______________________________________________ ajug-members mailing list [email protected] Manage your subscription and unsubscribe http://lists.ajug.org/mailman/list= info/ajug-members --_1E07D32E-C3C2-4D41-AC34-AAF1A2314D61_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8" <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc= hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of= fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta ht= tp-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta name= =3DGenerator content=3D"Microsoft Word 15 (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri",sans-serif;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:#954F72; text-decoration:underline;} pre {mso-style-priority:99; mso-style-link:"HTML Preformatted Char"; margin:0in; margin-bottom:.0001pt; font-size:10.0pt; font-family:"Courier New";} span.HTMLPreformattedChar {mso-style-name:"HTML Preformatted Char"; mso-style-priority:99; mso-style-link:"HTML Preformatted"; font-family:"Courier New";} .MsoChpDefault {mso-style-type:export-only;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style></head><body lang=3DEN-US link=3Dblue vlink=3D"#954F72"><div cla= ss=3DWordSection1><p class=3DMsoNormal>Thank you everyone for your quick re= sponse. The solution that you sent me worked great.</p><p class=3DMsoNormal= ><o:p> </o:p></p><p class=3DMsoNormal>Mike Barnes</p><p class=3DMsoNor= mal><o:p> </o:p></p><p class=3DMsoNormal>Sent from <a href=3D"https://= go.microsoft.com/fwlink/?LinkId=3D550986">Mail</a> for Windows 10</p><p cla= ss=3DMsoNormal><o:p> </o:p></p><div style=3D'mso-element:para-border-d= iv;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p= class=3DMsoNormal style=3D'border:none;padding:0in'><b>From: </b><a href= =3D"mailto:[email protected]">Marc Mamane</a><br><b>Sent: </b>Wednesday, Nove= mber 29, 2017 8:33 AM<br><b>To: </b><a href=3D"mailto:[email protected]= ug.org">[email protected]</a><br><b>Subject: </b>Re: [ajug-member= s] spring boot rest error</p></div><p class=3DMsoNormal><o:p> </o:p></= p><div><div><p class=3DMsoNormal>You'll need to apply regex to the request = mapping. See this stack overflow thread for one solution.</p></div><d= iv><p class=3DMsoNormal><o:p> </o:p></p></div><div><p class=3DMsoNorma= l><a href=3D"https://www.google.com/url?sa=3Dt&source=3Dweb&rct=3Dj= &url=3Dhttps://stackoverflow.com/questions/16332092/spring-mvc-pathvari= able-with-dot-is-getting-truncated&ved=3D0ahUKEwi88IrWmuTXAhUiSt8KHSP2B= mQQFggoMAA&usg=3DAOvVaw1LKqwwHOyJyiIIVvL1UTkO">https://www.google.com/u= rl?sa=3Dt&source=3Dweb&rct=3Dj&url=3Dhttps://stackoverflow.com/= questions/16332092/spring-mvc-pathvariable-with-dot-is-getting-truncated&am= p;ved=3D0ahUKEwi88IrWmuTXAhUiSt8KHSP2BmQQFggoMAA&usg=3DAOvVaw1LKqwwHOyJ= yiIIVvL1UTkO</a></p></div><div><p class=3DMsoNormal><o:p> </o:p></p></= div><div><p class=3DMsoNormal>Hope that helps!</p></div></div><div><p class= =3DMsoNormal><o:p> </o:p></p><div><p class=3DMsoNormal>On Nov 29, 2017= 11:29 AM, "Mike Barnes" <<a href=3D"mailto:mike.barnes@site10= 01.com">mike.barnes-f9aWwpgOZj5Wk0Htik3J/[email protected]</a>> wrote:</p><blockquote style=3D'bor= der:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-l= eft:4.8pt;margin-right:0in'><div><div><p class=3DMsoNormal style=3D'mso-mar= gin-top-alt:auto;mso-margin-bottom-alt:auto'>Can someone help me understand= why I am unable to find a record when the string has periods in the string= (.)</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo= ttom-alt:auto'> </p><p class=3DMsoNormal style=3D'mso-margin-top-alt:a= uto;mso-margin-bottom-alt:auto'>Example:</p><p class=3DMsoNormal style=3D'm= so-margin-top-alt:auto;mso-margin-bottom-alt:auto'> </p><div><pre><a h= ref=3D"http://localhost:8080/v1/security/account/name/My.Company" target=3D= "_blank">http://localhost:8080/v1/security/account/name/My.Company</a></pre= ><pre> </pre><pre>The Spring Boot rest api appears to be truncating th= e value when a period appears.</pre><pre> </pre><pre>In the rest log I= see name=3DMy</pre><pre>Instead of name=3DMy.Company</pre><pre> </pre= ><pre>This is how I have defined the function:</pre><pre> </pre><pre>&= nbsp; @GetMapping(value =3D "/name= /{name}")</pre><pre> public = ResponseEntity<?> getAccountByName(@PathVariable("name") St= ring name) {</pre><pre> </pre><pre>Any help would be appreciated.</pre= ><pre> </pre><pre>Thanks</pre><pre>Mike Barnes</pre></div><p class=3DM= soNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> = ;</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto= m-alt:auto'> </p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto= ;mso-margin-bottom-alt:auto'>Sent from <a href=3D"https://go.microsoft.com/= fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p cl= ass=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto= '> </p></div></div></blockquote></div></div><p class=3DMsoNormal style= =3D'margin-left:4.8pt'><br>_______________________________________________<= br>ajug-members mailing list<br><a href=3D"mailto:[email protected]= rg">[email protected]</a><br>Manage your subscription and unsubsc= ribe <a href=3D"http://lists.ajug.org/mailman/listinfo/ajug-members" target= =3D"_blank">http://lists.ajug.org/mailman/listinfo/ajug-members</a></p><p c= lass=3DMsoNormal><o:p> </o:p></p></div></body></html>= --_1E07D32E-C3C2-4D41-AC34-AAF1A2314D61_-- --===============5669020107348626710== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYWp1Zy1tZW1i ZXJzIG1haWxpbmcgbGlzdAphanVnLW1lbWJlcnNAbGlzdHMuYWp1Zy5vcmcKTWFuYWdlIHlvdXIg c3Vic2NyaXB0aW9uIGFuZCB1bnN1YnNjcmliZSBodHRwOi8vbGlzdHMuYWp1Zy5vcmcvbWFpbG1h bi9saXN0aW5mby9hanVnLW1lbWJlcnM= --===============5669020107348626710==--