There was a problem comparing the value received through request.getParameter with the normal string...

Asked 2 years ago, Updated 2 years ago, 32 views

String stx = req.getParameter("stx"); System.out.println("stx: "+stx); if(stx == "rcontload") { service.contentload(reportno); };

When I received the value from the previous page, System.out.println ("stx: "+stx); when you print this part out, It is output to stx: rcontload.

So if you look at the if statement below, it should be stx == "rconload" true, but it appears to be false..

I wonder why the stx received as a parameter is not the same even though I saved it as a String.<

Always have a nice day :)

java jsp

2022-09-20 15:19

1 Answers

I found it!

No errors appear when compared using the equlus() function!


2022-09-20 15:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.