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

Asked 6 days ago, Updated 6 days ago, 1 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


© 2022 pinfo. All rights reserved.