0

I've written a Bank application in java , the server side uses Mysql & JSP pages .

When I pass queries from the client side to the server side , the inputs that I entered are shown in the URL address .

For example :

enter image description here enter image description here enter image description here

As you can see , the username and password are shown in the address bar .

I want to avoid that .

What would be the best approach to accomplish that ?

FYI : The screen shots are from inside Eclipse J2EE.

This project is pretty big , so if some code is needed , please say which is needed and I'd attach it.

JAN
  • 21,236
  • 66
  • 181
  • 318
  • 1
    use post instead of get – aehiilrs Mar 25 '14 at 21:46
  • 3
    Use POST. But also when you actually put this on the web, if it ever happens, you'll want to buy an SSL certificate. Even with POST the password is sent plaintext unless you are going through the SSL protocal `https://` – developerwjk Mar 25 '14 at 21:49
  • I doubt it's ever going to go on the internet - if you check his profile, he's a student. I remember doing this same assignment in one of my classes. :) – aehiilrs Mar 27 '14 at 17:26

2 Answers2

4

Probably you are passing data using the GET HTTP method.

In order to avoid viewing form parameters in the URL's querystring, make sure to set the attribute method="post" inside the form tag, in this way:

<form action="Bank/loginPage" method="post">
    <!-- form input fields -->
</form>
2

Use POST Use SSL (https) Familiarize yourself with cookies, session, etc. Look here: Spring Security Authentication using RestTemplate

Community
  • 1
  • 1
Alexandre Santos
  • 8,170
  • 10
  • 42
  • 64