IntelliJ Java IDE
The moose likes Spring and the fly likes EMail Adresses and Spring Controller methods Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "EMail Adresses and Spring Controller methods" Watch "EMail Adresses and Spring Controller methods" New topic
Author

EMail Adresses and Spring Controller methods

Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Hi,

I have a problem with Spring, RequestMapping and eMail-Addresse which I send to my controller method. Actually every email address is received without the ending (after the last point) So if I send this
name@domain.com the controller method receives name@domain.
I found this as a bug but the workaround didn't help me: https://jira.springsource.org/browse/SPR-6164
It's all because of the dots I learned. I build a workaround by replacing the dots with dollarsigns, but this is really ugly and also is shown in the address bar, which is forbidden.

Has anybody an idea?

Thank you.
cheers
Robin

Here is my controller method. Well only the header:


SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

I wish I could find that other post that had the same issue and gave a solution. Not perfect, but works and is cleaner than the "$"

Where you create two PathVariables, one for the String before the dot, and one for the String after the dot.

Basically, try


Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Bob Wheeler
Ranch Hand

Joined: Apr 24, 2009
Posts: 317
Thank you for your effort. Indeed this is also a solution for my problem. Not perfect, but it is a solution.
But luckily, for me, my boss changed his mind, and didn't want to use the eMail address as an ID.

But still thank you,
Robin
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Bob Wheeler wrote:Thank you for your effort. Indeed this is also a solution for my problem. Not perfect, but it is a solution.
But luckily, for me, my boss changed his mind, and didn't want to use the eMail address as an ID.

But still thank you,
Robin


Are you Robin or Bob?

Mark
 
 
subject: EMail Adresses and Spring Controller methods
 
Threads others viewed
JSF, strange form action generated
@Controller annotation query
@ModelAttribute behavior
javax.el.PropertyNotFoundException: in the JSP page of a Spring MVC Application
InternalResourceViewResolver failing JUnit test -- Spring Demo Source
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture